]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/views/renamedialog.cpp
If 'remember view-properties' is selected, store the .directory files only if the...
[dolphin.git] / src / views / renamedialog.cpp
index 39e61c4640f8fc3d4a26059d2f16c4ac5ce3732e..aae546e7a8b20d6aee07faa77d6c7dfe6a27ba44 100644 (file)
@@ -64,6 +64,7 @@ RenameDialog::RenameDialog(QWidget *parent, const KFileItemList& items) :
     }
 
     m_lineEdit = new KLineEdit(page);
+    connect(m_lineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)));
 
     QString fileName = items[0].url().prettyUrl();
     QString extension = KMimeType::extractKnownExtension(fileName.toLower());
@@ -129,4 +130,11 @@ void RenameDialog::slotButtonClicked(int button)
     KDialog::slotButtonClicked(button);
 }
 
+void RenameDialog::slotTextChanged(const QString &newName)
+{
+    const bool enable = !newName.isEmpty() && (m_renameOneItem ? (newName != m_newName) : newName.contains('#'));
+    enableButtonOk(enable);
+}
+
+
 #include "renamedialog.moc"