From 5b7b39cbda874058363e754228f4b3bda06e2543 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 13 Apr 2011 14:34:24 +0200 Subject: [PATCH] icontext: remove BaseContext class --- src/plugins/coreplugin/icontext.h | 11 ----------- src/plugins/help/helpplugin.cpp | 7 ++++--- src/plugins/projectexplorer/outputwindow.cpp | 7 +++++-- src/plugins/projectexplorer/outputwindow.h | 4 ++-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/plugins/coreplugin/icontext.h b/src/plugins/coreplugin/icontext.h index 82fc88c2fbc..7088f4de12c 100644 --- a/src/plugins/coreplugin/icontext.h +++ b/src/plugins/coreplugin/icontext.h @@ -91,17 +91,6 @@ protected: QPointer m_widget; }; -class BaseContext : public Core::IContext -{ -public: - BaseContext(QWidget *widget, const Context &context, QObject *parent = 0) - : Core::IContext(parent) - { - setWidget(widget); - setContext(context); - } -}; - } // namespace Core #endif //ICONTEXT_H diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp index 520ae722553..1de13f6d616 100644 --- a/src/plugins/help/helpplugin.cpp +++ b/src/plugins/help/helpplugin.cpp @@ -579,9 +579,10 @@ void HelpPlugin::createRightPaneContextViewer() agg->add(m_helpViewerForSideBar); agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar)); - Core::Context context(Constants::C_HELP_SIDEBAR); - m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, - context, this)); + Core::IContext *context = new Core::IContext(this); + context->setContext(Core::Context(Constants::C_HELP_SIDEBAR)); + context->setWidget(m_helpViewerForSideBar); + m_core->addContextObject(context); QAction *copy = new QAction(this); Core::Command *cmd = m_core->actionManager()->registerAction(copy, diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index 5e6eea3adf8..e4bc2920cc7 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -485,9 +485,12 @@ OutputWindow::OutputWindow(QWidget *parent) setWordWrapMode(QTextOption::NoWrap); static uint usedIds = 0; - Core::ICore *core = Core::ICore::instance(); Core::Context context(Constants::C_APP_OUTPUT, usedIds++); - m_outputWindowContext = new Core::BaseContext(this, context); + Core::ICore *core = Core::ICore::instance(); + + m_outputWindowContext = new Core::IContext; + m_outputWindowContext->setContext(context); + m_outputWindowContext->setWidget(this); core->addContextObject(m_outputWindowContext); QAction *undoAction = new QAction(this); diff --git a/src/plugins/projectexplorer/outputwindow.h b/src/plugins/projectexplorer/outputwindow.h index 8b7216a294c..85dac7c6b15 100644 --- a/src/plugins/projectexplorer/outputwindow.h +++ b/src/plugins/projectexplorer/outputwindow.h @@ -47,7 +47,7 @@ class QAction; QT_END_NAMESPACE namespace Core { - class BaseContext; + class IContext; } namespace ProjectExplorer { @@ -189,7 +189,7 @@ private: void enableUndoRedo(); QString doNewlineEnfocement(const QString &out); - Core::BaseContext *m_outputWindowContext; + Core::IContext *m_outputWindowContext; OutputFormatter *m_formatter; bool m_enforceNewline;