diff options
author | hjk <qtc-committer@nokia.com> | 2011-06-30 19:30:56 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2011-07-04 12:02:01 +0200 |
commit | d6bf0c37321d942a248c5bc22086202ec0a915d3 (patch) | |
tree | a7553a6c445f60c4b3f3051e6b05dd5778029034 /src | |
parent | fd370662bae51a883eaee7d17efcc6f19ebe0045 (diff) | |
download | qt-creator-d6bf0c37321d942a248c5bc22086202ec0a915d3.tar.gz |
analyzer: remove dummy control widgets
Change-Id: I9c15e557699f2f321619fb07feea8d4489006c83
Reviewed-on: http://codereview.qt.nokia.com/1053
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/analyzerbase/analyzerconstants.h | 3 | ||||
-rw-r--r-- | src/plugins/analyzerbase/analyzermanager.cpp | 10 | ||||
-rw-r--r-- | src/plugins/analyzerbase/analyzerutils.cpp | 7 | ||||
-rw-r--r-- | src/plugins/analyzerbase/analyzerutils.h | 2 | ||||
-rw-r--r-- | src/plugins/analyzerbase/ianalyzertool.cpp | 5 | ||||
-rw-r--r-- | src/plugins/analyzerbase/ianalyzertool.h | 6 |
6 files changed, 7 insertions, 26 deletions
diff --git a/src/plugins/analyzerbase/analyzerconstants.h b/src/plugins/analyzerbase/analyzerconstants.h index 5d1f51558e..aa78ed1fd3 100644 --- a/src/plugins/analyzerbase/analyzerconstants.h +++ b/src/plugins/analyzerbase/analyzerconstants.h @@ -86,9 +86,6 @@ const char * const ANALYZER_CONTROL_STOP_ICON = const char * const ANALYZERTASK_ID = "Analyzer.TaskId"; -// private -const char * const ANALYZER_DUMMYWIDGET_ID = "Analyzer.DummyWidget"; - } // namespace Constants } // namespace Analyzer diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp index 60d9781a1d..4cc96a059c 100644 --- a/src/plugins/analyzerbase/analyzermanager.cpp +++ b/src/plugins/analyzerbase/analyzermanager.cpp @@ -711,14 +711,12 @@ void AnalyzerManagerPrivate::selectAction(QAction *action) void AnalyzerManagerPrivate::addTool(IAnalyzerTool *tool, const StartModes &modes) { - delayedInit(); // be sure that there is a valid IMode instance - - ActionManager *am = Core::ICore::instance()->actionManager(); - QWidget *controlWidget = tool->createControlWidget(); // might be 0 - m_controlsWidget->addWidget(controlWidget - ? controlWidget : AnalyzerUtils::createDummyWidget()); + delayedInit(); // Make sure that there is a valid IMode instance. const bool blocked = m_toolBox->blockSignals(true); // Do not make current. + + m_controlsWidget->addWidget(tool->createControlWidget()); + ActionManager *am = Core::ICore::instance()->actionManager(); foreach (StartMode mode, modes) { QString actionName = tool->actionName(mode); QString menuGroup = tool->menuGroup(mode); diff --git a/src/plugins/analyzerbase/analyzerutils.cpp b/src/plugins/analyzerbase/analyzerutils.cpp index 532a3c559f..83107e8312 100644 --- a/src/plugins/analyzerbase/analyzerutils.cpp +++ b/src/plugins/analyzerbase/analyzerutils.cpp @@ -116,10 +116,3 @@ CPlusPlus::Symbol *AnalyzerUtils::findSymbolUnderCursor() const CPlusPlus::LookupItem &lookupItem = lookupItems.first(); // ### TODO: select best candidate. return lookupItem.declaration(); } - -QWidget *AnalyzerUtils::createDummyWidget() -{ - QWidget *widget = new QWidget; - widget->setProperty(Constants::ANALYZER_DUMMYWIDGET_ID, QVariant(true)); - return widget; -} diff --git a/src/plugins/analyzerbase/analyzerutils.h b/src/plugins/analyzerbase/analyzerutils.h index cece97438f..61f6b8a98d 100644 --- a/src/plugins/analyzerbase/analyzerutils.h +++ b/src/plugins/analyzerbase/analyzerutils.h @@ -46,8 +46,6 @@ class Symbol; namespace AnalyzerUtils { ANALYZER_EXPORT CPlusPlus::Symbol *findSymbolUnderCursor(); - - ANALYZER_EXPORT QWidget *createDummyWidget(); } #endif // ANALYZERUTILS_H diff --git a/src/plugins/analyzerbase/ianalyzertool.cpp b/src/plugins/analyzerbase/ianalyzertool.cpp index b77104ba08..eb0abbfd48 100644 --- a/src/plugins/analyzerbase/ianalyzertool.cpp +++ b/src/plugins/analyzerbase/ianalyzertool.cpp @@ -87,9 +87,4 @@ void IAnalyzerTool::initializeDockWidgets() { } -QWidget *IAnalyzerTool::createControlWidget() -{ - return 0; -} - } // namespace Analyzer diff --git a/src/plugins/analyzerbase/ianalyzertool.h b/src/plugins/analyzerbase/ianalyzertool.h index 74de749c81..50e526ed2e 100644 --- a/src/plugins/analyzerbase/ianalyzertool.h +++ b/src/plugins/analyzerbase/ianalyzertool.h @@ -116,9 +116,9 @@ public: */ virtual void initializeDockWidgets(); - /// Returns a control widget which will be shown - /// in the output pane when this tool is selected. - virtual QWidget *createControlWidget(); + /// Returns a control widget which will be shown in the status bar when + /// this tool is selected. Must be non-zero. + virtual QWidget *createControlWidget() = 0; /// Returns a new engine for the given start parameters. /// Called each time the tool is launched. |