m_okButton->setShortcut(Qt::CTRL + Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &RenameDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &RenameDialog::reject);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QObject::deleteLater);
m_okButton->setDefault(true);
KGuiItem::assign(m_okButton, KGuiItem(i18nc("@action:button", "&Rename"), QStringLiteral("dialog-ok-apply")));
m_spinBox->setDisplayIntegerBase(10);
QHBoxLayout* horizontalLayout = new QHBoxLayout(page);
- horizontalLayout->setMargin(0);
+ horizontalLayout->setContentsMargins(0, 0, 0, 0);
horizontalLayout->addWidget(infoLabel);
horizontalLayout->addWidget(m_spinBox);
KIO::FileUndoManager::self()->recordJob(cmdType, srcList, parentUrl, job);
connect(job, &KJob::result, this, &RenameDialog::slotResult);
+ connect(job, &KJob::result, this, &QObject::deleteLater);
job->uiDelegate()->setAutoErrorHandlingEnabled(true);
void RenameDialog::slotTextChanged(const QString& newName)
{
- bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1String("."));
+ bool enable = !newName.isEmpty() && (newName != QLatin1String("..")) && (newName != QLatin1Char('.'));
if (enable && !m_renameOneItem) {
const int count = newName.count(QLatin1Char('#'));
if (count == 0) {