┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/renamedialog.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-13 17:31:54 +0000
committerPeter Penz <[email protected]>2007-03-13 17:31:54 +0000
commitd9ac44e08f8d2abe7104c20e308d05038e1896da (patch)
treed3c900322778ec3bab372855d391f19d739563df /src/renamedialog.h
parent75da26f8b0ad0835768c2d16fb7047e99f6b9705 (diff)
Allow renaming of items (note that currently the "rename multiple files" dialog is temporary used for this until KFileItemDelegate offers editing functionality).
svn path=/trunk/KDE/kdebase/apps/; revision=642219
Diffstat (limited to 'src/renamedialog.h')
-rw-r--r--src/renamedialog.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/renamedialog.h b/src/renamedialog.h
index 093484f2b..c08856f8c 100644
--- a/src/renamedialog.h
+++ b/src/renamedialog.h
@@ -1,6 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Peter Penz *
+ * Copyright (C) 2006 by Peter Penz ([email protected]) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -22,7 +21,8 @@
#include <kdialog.h>
#include <kurl.h>
-#include <qstring.h>
+
+#include <QString>
class KLineEdit;
@@ -35,10 +35,15 @@ class KLineEdit;
* RenameDialog dialog(...);
* if (dialog.exec() == QDialog::Accepted) {
* const QString& newName = dialog.newName();
- * // ... rename items corresponding to the new name
+ * if (newName.isEmpty()) {
+ * // an invalid name has been chosen, use
+ * // dialog.errorString() to tell the user about this
+ * }
+ * else {
+ * // rename items corresponding to the new name
+ * }
* }
* \endcode
- * @author Peter Penz
*/
class RenameDialog : public KDialog
{
@@ -56,12 +61,18 @@ public:
*/
const QString& newName() const { return m_newName; }
+ /**
+ * Returns the error string, if Dialog::newName() returned an empty string.
+ */
+ const QString& errorString() const { return m_errorString; }
+
protected slots:
virtual void slotButtonClicked(int button);
private:
KLineEdit* m_lineEdit;
QString m_newName;
+ QString m_errorString;
};
#endif