diff options
-rw-r--r-- | src/plugins/cppeditor/cppeditorplugin.cpp | 12 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppeditorplugin.h | 3 | ||||
-rw-r--r-- | src/plugins/cppeditor/fileandtokenactions_test.cpp | 11 | ||||
-rw-r--r-- | src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp | 2 |
4 files changed, 8 insertions, 20 deletions
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp index aeda4b1fede..7852855763e 100644 --- a/src/plugins/cppeditor/cppeditorplugin.cpp +++ b/src/plugins/cppeditor/cppeditorplugin.cpp @@ -511,18 +511,6 @@ void CppEditorPlugin::registerTests() #endif } -void CppEditorPlugin::switchDeclarationDefinition() -{ - if (CppEditorWidget *editorWidget = currentCppEditorWidget()) - editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false); -} - -void CppEditorPlugin::renameSymbolUnderCursor() -{ - if (CppEditorWidget *editorWidget = currentCppEditorWidget()) - editorWidget->renameSymbolUnderCursor(); -} - void CppEditorPluginPrivate::onTaskStarted(Id type) { if (type == Constants::TASK_INDEX) { diff --git a/src/plugins/cppeditor/cppeditorplugin.h b/src/plugins/cppeditor/cppeditorplugin.h index 85a038060b2..4e12c3a322a 100644 --- a/src/plugins/cppeditor/cppeditorplugin.h +++ b/src/plugins/cppeditor/cppeditorplugin.h @@ -22,9 +22,6 @@ public: static void clearHeaderSourceCache(); - void renameSymbolUnderCursor(); - void switchDeclarationDefinition(); - private: void initialize() override; void extensionsInitialized() override; diff --git a/src/plugins/cppeditor/fileandtokenactions_test.cpp b/src/plugins/cppeditor/fileandtokenactions_test.cpp index 66f9e5d31eb..ca6411116f8 100644 --- a/src/plugins/cppeditor/fileandtokenactions_test.cpp +++ b/src/plugins/cppeditor/fileandtokenactions_test.cpp @@ -330,13 +330,14 @@ public: void run(CppEditorWidget *) override; }; -void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *) +void SwitchDeclarationDefinitionTokenAction::run(CppEditorWidget *editorWidget) { // Switch Declaration/Definition IEditor *editorBefore = EditorManager::currentEditor(); const int originalLine = editorBefore->currentLine(); const int originalColumn = editorBefore->currentColumn(); - CppEditorPlugin::instance()->switchDeclarationDefinition(); + if (editorWidget) + editorWidget->switchDeclarationDefinition(/*inNextSplit*/ false); QApplication::processEvents(); // Go back @@ -368,9 +369,11 @@ public: void run(CppEditorWidget *) override; }; -void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *) +void RenameSymbolUnderCursorTokenAction::run(CppEditorWidget *editorWidget) { - CppEditorPlugin::instance()->renameSymbolUnderCursor(); + if (editorWidget) + editorWidget->renameSymbolUnderCursor(); + QApplication::processEvents(); } diff --git a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp index 583d99d0969..0c06f86783c 100644 --- a/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp +++ b/src/plugins/cppeditor/followsymbol_switchmethoddecldef_test.cpp @@ -357,7 +357,7 @@ F2TestCase::F2TestCase(CppEditorAction action, if (useClangd && tag.endsWith("Var")) initialTestFile->m_editorWidget->openLinkUnderCursor(); else - CppEditorPlugin::instance()->switchDeclarationDefinition(); + initialTestFile->m_editorWidget->switchDeclarationDefinition(/*inNextSplit*/false); break; default: QFAIL("Unknown test action"); |