X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4143a69c05be6da8a91c8ba0db505a47b22ddc75..681d8bb6c:/src/views/renamedialog.h diff --git a/src/views/renamedialog.h b/src/views/renamedialog.h index 3964c0a5c..08571cd9d 100644 --- a/src/views/renamedialog.h +++ b/src/views/renamedialog.h @@ -22,16 +22,19 @@ #include "dolphin_export.h" -#include #include + +#include #include class QLineEdit; class QSpinBox; class QPushButton; - +class KJob; /** * @brief Dialog for renaming a variable number of files. + * + * The dialog deletes itself when accepted or rejected. */ class DOLPHIN_EXPORT RenameDialog : public QDialog { @@ -39,30 +42,23 @@ class DOLPHIN_EXPORT RenameDialog : public QDialog public: explicit RenameDialog(QWidget* parent, const KFileItemList& items); - virtual ~RenameDialog(); + ~RenameDialog() override; + +signals: + void renamingFinished(const QList& urls); private slots: void slotAccepted(); void slotTextChanged(const QString& newName); + void slotFileRenamed(const QUrl& oldUrl, const QUrl& newUrl); + void slotResult(KJob* job); protected: void showEvent(QShowEvent* event) override; -private: - void renameItems(); - void renameItem(const KFileItem &item, const QString& newName); - - /** - * @return Returns the string \p name, where the characters represented by - * \p indexPlaceHolder get replaced by the index \p index. - * E. g. Calling indexedName("Test #.jpg", 12, '#') returns "Test 12.jpg". - * A connected sequence of placeholders results in leading zeros: - * indexedName("Test ####.jpg", 12, '#') returns "Test 0012.jpg". - */ - static QString indexedName(const QString& name, int index, const QChar& indexPlaceHolder); - private: bool m_renameOneItem; + QList m_renamedItems; QString m_newName; QLineEdit* m_lineEdit; KFileItemList m_items;