From f7ae0102741af82f1576e8d659f5acf406e1cb01 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 18 Jul 2022 23:11:09 +0800 Subject: [PATCH] Rename interface --- src/gui/fspathedit.cpp | 8 ++++---- src/gui/fspathedit.h | 4 ++-- src/gui/fspathedit_p.h | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/fspathedit.cpp b/src/gui/fspathedit.cpp index a2c7b1491..750f5e7f3 100644 --- a/src/gui/fspathedit.cpp +++ b/src/gui/fspathedit.cpp @@ -70,14 +70,14 @@ class FileSystemPathEdit::FileSystemPathEditPrivate Q_DECLARE_PUBLIC(FileSystemPathEdit) Q_DISABLE_COPY_MOVE(FileSystemPathEditPrivate) - FileSystemPathEditPrivate(FileSystemPathEdit *q, Private::FileEditorWithCompletion *editor); + FileSystemPathEditPrivate(FileSystemPathEdit *q, Private::IFileEditorWithCompletion *editor); void modeChanged(); void browseActionTriggered(); QString dialogCaptionOrDefault() const; FileSystemPathEdit *q_ptr = nullptr; - std::unique_ptr m_editor; + std::unique_ptr m_editor; QAction *m_browseAction = nullptr; QToolButton *m_browseBtn = nullptr; QString m_fileNameFilter; @@ -88,7 +88,7 @@ class FileSystemPathEdit::FileSystemPathEditPrivate }; FileSystemPathEdit::FileSystemPathEditPrivate::FileSystemPathEditPrivate( - FileSystemPathEdit *q, Private::FileEditorWithCompletion *editor) + FileSystemPathEdit *q, Private::IFileEditorWithCompletion *editor) : q_ptr {q} , m_editor {editor} , m_browseAction {new QAction(q)} @@ -183,7 +183,7 @@ void FileSystemPathEdit::FileSystemPathEditPrivate::modeChanged() m_validator->setCheckWritePermission((m_mode == FileSystemPathEdit::Mode::FileSave) || (m_mode == FileSystemPathEdit::Mode::DirectorySave)); } -FileSystemPathEdit::FileSystemPathEdit(Private::FileEditorWithCompletion *editor, QWidget *parent) +FileSystemPathEdit::FileSystemPathEdit(Private::IFileEditorWithCompletion *editor, QWidget *parent) : QWidget(parent) , d_ptr(new FileSystemPathEditPrivate(this, editor)) { diff --git a/src/gui/fspathedit.h b/src/gui/fspathedit.h index 772714f47..34d2bcaa6 100644 --- a/src/gui/fspathedit.h +++ b/src/gui/fspathedit.h @@ -35,8 +35,8 @@ namespace Private { class FileComboEdit; - class FileEditorWithCompletion; class FileLineEdit; + class IFileEditorWithCompletion; } /*! @@ -92,7 +92,7 @@ signals: void selectedPathChanged(const Path &path); protected: - explicit FileSystemPathEdit(Private::FileEditorWithCompletion *editor, QWidget *parent); + explicit FileSystemPathEdit(Private::IFileEditorWithCompletion *editor, QWidget *parent); template Widget *editWidget() const diff --git a/src/gui/fspathedit_p.h b/src/gui/fspathedit_p.h index 1b63af12b..92f109004 100644 --- a/src/gui/fspathedit_p.h +++ b/src/gui/fspathedit_p.h @@ -95,10 +95,10 @@ namespace Private mutable QValidator::State m_lastValidationState = QValidator::Invalid; }; - class FileEditorWithCompletion + class IFileEditorWithCompletion { public: - virtual ~FileEditorWithCompletion() = default; + virtual ~IFileEditorWithCompletion() = default; virtual void completeDirectoriesOnly(bool completeDirsOnly) = 0; virtual void setFilenameFilters(const QStringList &filters) = 0; virtual void setBrowseAction(QAction *action) = 0; @@ -108,7 +108,7 @@ namespace Private virtual QWidget *widget() = 0; }; - class FileLineEdit final : public QLineEdit, public FileEditorWithCompletion + class FileLineEdit final : public QLineEdit, public IFileEditorWithCompletion { Q_OBJECT Q_DISABLE_COPY_MOVE(FileLineEdit) @@ -140,7 +140,7 @@ namespace Private QFileIconProvider m_iconProvider; }; - class FileComboEdit final : public QComboBox, public FileEditorWithCompletion + class FileComboEdit final : public QComboBox, public IFileEditorWithCompletion { Q_OBJECT Q_DISABLE_COPY_MOVE(FileComboEdit)