diff options
author | hjk <hjk@qt.io> | 2024-01-26 15:43:08 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2024-01-29 13:01:39 +0000 |
commit | 524167a9362960e2a535a56b38876c5165b7e96b (patch) | |
tree | 759f75a377c06c5f225a653c8d0a3cca78f57177 /src/plugins/texteditor/findinopenfiles.cpp | |
parent | 66b50438d8a450518be9bd517bbdf15c8443fffa (diff) |
TextEditor: Use new setup pattern for the finders
The FindInFiles definition cannot go yet to the .cpp yet as there
are some exported functions.
Change-Id: I2d2f02ae80b560e3147f461fcbee0fa62b8085a3
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/texteditor/findinopenfiles.cpp')
-rw-r--r-- | src/plugins/texteditor/findinopenfiles.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/plugins/texteditor/findinopenfiles.cpp b/src/plugins/texteditor/findinopenfiles.cpp index 52c04d3b1d..dcd505cbe1 100644 --- a/src/plugins/texteditor/findinopenfiles.cpp +++ b/src/plugins/texteditor/findinopenfiles.cpp @@ -3,6 +3,7 @@ #include "findinopenfiles.h" +#include "basefilefind.h" #include "textdocument.h" #include "texteditortr.h" @@ -15,6 +16,25 @@ using namespace Utils; namespace TextEditor::Internal { +class FindInOpenFiles : public BaseFileFind +{ +public: + FindInOpenFiles(); + +private: + QString id() const final; + QString displayName() const final; + bool isEnabled() const final; + void writeSettings(Utils::QtcSettings *settings) final; + void readSettings(Utils::QtcSettings *settings) final; + + QString label() const final; + QString toolTip() const final; + + FileContainerProvider fileContainerProvider() const final; + void updateEnabledState() { emit enabledChanged(isEnabled()); } +}; + FindInOpenFiles::FindInOpenFiles() { connect(Core::EditorManager::instance(), &Core::EditorManager::editorOpened, @@ -84,9 +104,11 @@ void FindInOpenFiles::readSettings(QtcSettings *settings) settings->endGroup(); } -void FindInOpenFiles::updateEnabledState() + + +void setupFindInOpenFiles() { - emit enabledChanged(isEnabled()); + static FindInOpenFiles theFindInOpenFiles; } } // TextEditor::Internal |