┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views/renamedialog.cpp
diff options
context:
space:
mode:
authorMatthias Fuchs <[email protected]>2010-09-20 21:04:48 +0000
committerMatthias Fuchs <[email protected]>2010-09-20 21:04:48 +0000
commitb51083c12b6459ca6c33f022881ece4e83fcedc2 (patch)
tree365f31f7ef777c603f23f087200665c663648653 /src/views/renamedialog.cpp
parentc7e8c4af3dbcec9973a161c319fcd63fd1086f23 (diff)
Disables the rename button if no name or an identical name has been specified.
Checks for '#' in the case of renaming multiple files. svn path=/trunk/KDE/kdebase/apps/; revision=1177675
Diffstat (limited to 'src/views/renamedialog.cpp')
-rw-r--r--src/views/renamedialog.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/views/renamedialog.cpp b/src/views/renamedialog.cpp
index 39e61c464..f35528074 100644
--- a/src/views/renamedialog.cpp
+++ b/src/views/renamedialog.cpp
@@ -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,12 @@ void RenameDialog::slotButtonClicked(int button)
KDialog::slotButtonClicked(button);
}
+void RenameDialog::slotTextChanged(const QString &newName)
+{
+ bool enable = !newName.isEmpty();
+ enable &= (m_renameOneItem ? (newName != m_newName) : newName.contains('#'));
+ enableButtonOk(enable);
+}
+
+
#include "renamedialog.moc"