diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-10-20 12:49:12 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-10-21 08:19:25 +0000 |
commit | 135e76f965618747b68ab1caae5768feda5fcee0 (patch) | |
tree | d96af1a6950f62f2e87fe3b060934d7da8a31107 /src/plugins/cppeditor/cppquickfix_test.cpp | |
parent | ed292f3f9b59c23114f27a562a131a145bd67d82 (diff) |
CppEditor: Offer InsertDefsOperation quickfix for all classes
The check whether there are unimplemented member functions takes quite
long, so Creator would freeze for several seconds when right-clicking on
the name of even a medium-sized class.
Therefore, we offer the operation for all classes with member functions
and move the expensive check into the perform() method.
Change-Id: Ie19958ba8c53493be859f9982d7d5697e6e9d88b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfix_test.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfix_test.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 1dbfeafedf..e5257df4c0 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -3653,6 +3653,23 @@ void CppEditorPlugin::test_quickfix_InsertDefsFromDecls_data() } // namespace N)"; QTest::addRow("no candidates") + << QByteArrayList{origHeader, origHeader} + << QByteArrayList{origSource, origSource} + << int(InsertDefsFromDecls::Mode::Alternating); + + origHeader = R"( + namespace N { + class @C + { + public: + friend void ignoredFriend(); + void ignoredImplemented() {}; + + signals: + void ignoredSignal(); + }; + } // namespace N)"; + QTest::addRow("no member functions") << QByteArrayList{origHeader, ""} << QByteArrayList{origSource, ""} << int(InsertDefsFromDecls::Mode::Alternating); |