icontext: remove BaseContext class

This commit is contained in:
hjk
2011-04-13 14:34:24 +02:00
parent 70d392d235
commit 5b7b39cbda
4 changed files with 11 additions and 18 deletions

View File

@@ -91,17 +91,6 @@ protected:
QPointer<QWidget> m_widget; QPointer<QWidget> 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 } // namespace Core
#endif //ICONTEXT_H #endif //ICONTEXT_H

View File

@@ -579,9 +579,10 @@ void HelpPlugin::createRightPaneContextViewer()
agg->add(m_helpViewerForSideBar); agg->add(m_helpViewerForSideBar);
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar)); agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
Core::Context context(Constants::C_HELP_SIDEBAR); Core::IContext *context = new Core::IContext(this);
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, context->setContext(Core::Context(Constants::C_HELP_SIDEBAR));
context, this)); context->setWidget(m_helpViewerForSideBar);
m_core->addContextObject(context);
QAction *copy = new QAction(this); QAction *copy = new QAction(this);
Core::Command *cmd = m_core->actionManager()->registerAction(copy, Core::Command *cmd = m_core->actionManager()->registerAction(copy,

View File

@@ -485,9 +485,12 @@ OutputWindow::OutputWindow(QWidget *parent)
setWordWrapMode(QTextOption::NoWrap); setWordWrapMode(QTextOption::NoWrap);
static uint usedIds = 0; static uint usedIds = 0;
Core::ICore *core = Core::ICore::instance();
Core::Context context(Constants::C_APP_OUTPUT, usedIds++); 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); core->addContextObject(m_outputWindowContext);
QAction *undoAction = new QAction(this); QAction *undoAction = new QAction(this);

View File

@@ -47,7 +47,7 @@ class QAction;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { namespace Core {
class BaseContext; class IContext;
} }
namespace ProjectExplorer { namespace ProjectExplorer {
@@ -189,7 +189,7 @@ private:
void enableUndoRedo(); void enableUndoRedo();
QString doNewlineEnfocement(const QString &out); QString doNewlineEnfocement(const QString &out);
Core::BaseContext *m_outputWindowContext; Core::IContext *m_outputWindowContext;
OutputFormatter *m_formatter; OutputFormatter *m_formatter;
bool m_enforceNewline; bool m_enforceNewline;