]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/renamedialog.cpp
Merge branch 'Applications/19.08'
[dolphin.git] / src / views / renamedialog.cpp
index e49f56e2de6266b0ae92f445c7792c27f3fdfe52..96068564d16dab31659d3c96507a24ef695aed53 100644 (file)
@@ -62,6 +62,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
     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")));
@@ -136,7 +137,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
         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);
 
@@ -178,6 +179,7 @@ void RenameDialog::slotAccepted()
     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);
 
@@ -186,7 +188,7 @@ void RenameDialog::slotAccepted()
 
 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) {