From 0694e3af3bb2f3da569199402acc49ca288b7276 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Tue, 17 Mar 2009 17:38:16 +0100
Subject: [PATCH] Removed CPPEditorActionHandler

Didn't add anything to the TextEditorActionHandler.
---
 src/plugins/cppeditor/cppeditor.pro           |  4 --
 .../cppeditor/cppeditoractionhandler.cpp      | 53 -----------------
 .../cppeditor/cppeditoractionhandler.h        | 57 -------------------
 src/plugins/cppeditor/cppplugin.cpp           |  4 +-
 src/plugins/cppeditor/cppplugin.h             |  3 +-
 5 files changed, 3 insertions(+), 118 deletions(-)
 delete mode 100644 src/plugins/cppeditor/cppeditoractionhandler.cpp
 delete mode 100644 src/plugins/cppeditor/cppeditoractionhandler.h

diff --git a/src/plugins/cppeditor/cppeditor.pro b/src/plugins/cppeditor/cppeditor.pro
index 5660b26b1e9..2ea6fb53245 100644
--- a/src/plugins/cppeditor/cppeditor.pro
+++ b/src/plugins/cppeditor/cppeditor.pro
@@ -8,7 +8,6 @@ include(../../qworkbenchplugin.pri)
 include(cppeditor_dependencies.pri)
 HEADERS += cppplugin.h \
     cppeditor.h \
-    cppeditoractionhandler.h \
     cpphighlighter.h \
     cpphoverhandler.h \
     cppfilewizard.h \
@@ -16,13 +15,10 @@ HEADERS += cppplugin.h \
     cppeditorenums.h \
     cppeditor_global.h \
     cppclasswizard.h
-
 SOURCES += cppplugin.cpp \
-    cppeditoractionhandler.cpp \
     cppeditor.cpp \
     cpphighlighter.cpp \
     cpphoverhandler.cpp \
     cppfilewizard.cpp \
     cppclasswizard.cpp
-
 RESOURCES += cppeditor.qrc
diff --git a/src/plugins/cppeditor/cppeditoractionhandler.cpp b/src/plugins/cppeditor/cppeditoractionhandler.cpp
deleted file mode 100644
index e28a8fead8b..00000000000
--- a/src/plugins/cppeditor/cppeditoractionhandler.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact:  Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-**
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-**
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-**************************************************************************/
-
-#include "cppeditoractionhandler.h"
-#include "cppeditorconstants.h"
-#include "cppeditor.h"
-#include <QAction>
-
-using namespace CppEditor::Internal;
-
-CPPEditorActionHandler::CPPEditorActionHandler(const QString &context,
-                                               uint optionalActions)
-    : TextEditor::TextEditorActionHandler(context, optionalActions)
-{ }
-
-CPPEditorActionHandler::~CPPEditorActionHandler()
-{ }
-
-void CPPEditorActionHandler::createActions()
-{
-    TextEditor::TextEditorActionHandler::createActions();
-}
-
-void CPPEditorActionHandler::updateActions(UpdateMode um)
-{
-    TextEditor::TextEditorActionHandler::updateActions(um);
-}
diff --git a/src/plugins/cppeditor/cppeditoractionhandler.h b/src/plugins/cppeditor/cppeditoractionhandler.h
deleted file mode 100644
index f9ccd363ae7..00000000000
--- a/src/plugins/cppeditor/cppeditoractionhandler.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/**************************************************************************
-**
-** This file is part of Qt Creator
-**
-** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-**
-** Contact:  Qt Software Information (qt-info@nokia.com)
-**
-** Commercial Usage
-**
-** Licensees holding valid Qt Commercial licenses may use this file in
-** accordance with the Qt Commercial License Agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Nokia.
-**
-** GNU Lesser General Public License Usage
-**
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file.  Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-**
-**************************************************************************/
-
-#ifndef CPPEDITORACTIONHANDLER_H
-#define CPPEDITORACTIONHANDLER_H
-
-#include <texteditor/texteditoractionhandler.h>
-
-namespace CppEditor {
-namespace Internal {
-
-class CPPEditorActionHandler : public TextEditor::TextEditorActionHandler
-{
-    Q_OBJECT
-
-public:
-    CPPEditorActionHandler(const QString &context,
-                           uint optionalActions = None);
-    virtual ~CPPEditorActionHandler();
-
-    using TextEditor::TextEditorActionHandler::updateActions;
-
-protected:
-    virtual void createActions();
-    virtual void updateActions(UpdateMode um);
-};
-
-} // namespace Internal
-} // namespace CppEditor
-
-#endif // CPPEDITORACTIONHANDLER_H
diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp
index 804c9f98b82..3d635578e61 100644
--- a/src/plugins/cppeditor/cppplugin.cpp
+++ b/src/plugins/cppeditor/cppplugin.cpp
@@ -30,7 +30,6 @@
 #include "cppplugin.h"
 #include "cppclasswizard.h"
 #include "cppeditor.h"
-#include "cppeditoractionhandler.h"
 #include "cppeditorconstants.h"
 #include "cppeditorenums.h"
 #include "cppfilewizard.h"
@@ -47,6 +46,7 @@
 #include <texteditor/completionsupport.h>
 #include <texteditor/fontsettings.h>
 #include <texteditor/storagesettings.h>
+#include <texteditor/texteditoractionhandler.h>
 #include <texteditor/texteditorsettings.h>
 #include <cpptools/cpptoolsconstants.h>
 
@@ -207,7 +207,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
     am->actionContainer(CppEditor::Constants::M_CONTEXT)->addAction(cmd);
     am->actionContainer(CppTools::Constants::M_TOOLS_CPP)->addAction(cmd);
 
-    m_actionHandler = new CPPEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
+    m_actionHandler = new TextEditor::TextEditorActionHandler(CppEditor::Constants::C_CPPEDITOR,
         TextEditor::TextEditorActionHandler::Format
         | TextEditor::TextEditorActionHandler::UnCommentSelection
         | TextEditor::TextEditorActionHandler::UnCollapseAll);
diff --git a/src/plugins/cppeditor/cppplugin.h b/src/plugins/cppeditor/cppplugin.h
index 84c107ecca3..f5180a421de 100644
--- a/src/plugins/cppeditor/cppplugin.h
+++ b/src/plugins/cppeditor/cppplugin.h
@@ -44,7 +44,6 @@ namespace CppEditor {
 namespace Internal {
 
 class CPPEditor;
-class CPPEditorActionHandler;
 class CppPluginEditorFactory;
 
 class CppPlugin : public ExtensionSystem::IPlugin
@@ -73,7 +72,7 @@ private:
 
     static CppPlugin *m_instance;
 
-    CPPEditorActionHandler *m_actionHandler;
+    TextEditor::TextEditorActionHandler *m_actionHandler;
     CppPluginEditorFactory *m_factory;
 };
 
-- 
GitLab