X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/2744fb4a0b70cdff98c4f7e857247828cffe791e..87f30d3fc8172649b3c905b04e20655ca18ac68f:/src/views/renamedialog.h diff --git a/src/views/renamedialog.h b/src/views/renamedialog.h index 430c707a3..08571cd9d 100644 --- a/src/views/renamedialog.h +++ b/src/views/renamedialog.h @@ -20,53 +20,51 @@ #ifndef RENAMEDIALOG_H #define RENAMEDIALOG_H -#include "libdolphin_export.h" +#include "dolphin_export.h" -#include #include -class KLineEdit; -class KIntSpinBox; - +#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 LIBDOLPHINPRIVATE_EXPORT RenameDialog : public KDialog +class DOLPHIN_EXPORT RenameDialog : public QDialog { Q_OBJECT public: explicit RenameDialog(QWidget* parent, const KFileItemList& items); - virtual ~RenameDialog(); + ~RenameDialog() override; -protected slots: - virtual void slotButtonClicked(int button); +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); -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); +protected: + void showEvent(QShowEvent* event) override; private: bool m_renameOneItem; + QList m_renamedItems; QString m_newName; - KLineEdit* m_lineEdit; + QLineEdit* m_lineEdit; KFileItemList m_items; bool m_allExtensionsDifferent; - KIntSpinBox* m_spinBox; + QSpinBox* m_spinBox; + QPushButton* m_okButton; }; #endif