aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <[email protected]>2011-05-20 09:12:34 +0200
committerhjk <[email protected]>2011-05-20 11:00:28 +0200
commitc31bc05e2e333d242ac5d8015d089281a1ca356a (patch)
tree2d0a833f66ceef7b91537d29718113fbf02e02ba
parent705d450910f80465b58f3dc30a1d37e467188d5d (diff)
analyzer: make output pane not pop up automatically in all cases
Change-Id: Ief96ab7093d78915087a273f3eff0b4489c3b370 Reviewed-on: http://codereview.qt.nokia.com/30 Reviewed-by: hjk
-rw-r--r--src/plugins/analyzerbase/analyzermanager.cpp6
-rw-r--r--src/plugins/analyzerbase/analyzermanager.h1
-rw-r--r--src/plugins/analyzerbase/ianalyzertool.h3
-rw-r--r--src/plugins/callgrind/callgrindengine.cpp4
-rw-r--r--src/plugins/callgrind/callgrindengine.h2
-rw-r--r--src/plugins/callgrind/callgrindhelper.cpp13
-rw-r--r--src/plugins/callgrind/callgrindhelper.h4
-rw-r--r--src/plugins/callgrind/callgrindtool.cpp28
-rw-r--r--src/plugins/callgrind/callgrindtool.h2
-rw-r--r--src/plugins/callgrind/callgrindvisualisation.cpp12
-rw-r--r--src/plugins/callgrind/callgrindvisualisation.h4
-rw-r--r--src/plugins/memcheck/memchecktool.cpp11
-rw-r--r--src/plugins/memcheck/memchecktool.h15
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp11
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.h2
-rw-r--r--src/plugins/valgrindtoolbase/valgrindengine.cpp2
16 files changed, 63 insertions, 57 deletions
diff --git a/src/plugins/analyzerbase/analyzermanager.cpp b/src/plugins/analyzerbase/analyzermanager.cpp
index 93444245068..2cd8ac1e689 100644
--- a/src/plugins/analyzerbase/analyzermanager.cpp
+++ b/src/plugins/analyzerbase/analyzermanager.cpp
@@ -516,6 +516,8 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool()
// make sure mode is shown
q->showMode();
+ if (q->currentTool()->needsOutputPane())
+ q->popupOutputPane();
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
@@ -896,6 +898,10 @@ void AnalyzerManager::showMode()
{
if (d->m_mode)
ModeManager::instance()->activateMode(d->m_mode->id());
+}
+
+void AnalyzerManager::popupOutputPane()
+{
d->m_outputpane->popup();
}
diff --git a/src/plugins/analyzerbase/analyzermanager.h b/src/plugins/analyzerbase/analyzermanager.h
index e41cd71b8cd..990bcfd8f85 100644
--- a/src/plugins/analyzerbase/analyzermanager.h
+++ b/src/plugins/analyzerbase/analyzermanager.h
@@ -102,6 +102,7 @@ public:
AnalyzerRunControl *createAnalyzer(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc = 0);
void showMode();
+ void popupOutputPane();
public slots:
void startTool();
diff --git a/src/plugins/analyzerbase/ianalyzertool.h b/src/plugins/analyzerbase/ianalyzertool.h
index 26fc14a2f1f..5354fb2d0a7 100644
--- a/src/plugins/analyzerbase/ianalyzertool.h
+++ b/src/plugins/analyzerbase/ianalyzertool.h
@@ -110,6 +110,9 @@ public:
/// @return true when this tool can be run remotely, e.g. on a meego or maemo device
virtual bool canRunRemotely() const = 0;
+
+ /// @return true when this tool needs the output pane to be show on startup
+ virtual bool needsOutputPane() const = 0;
};
} // namespace Analyzer
diff --git a/src/plugins/callgrind/callgrindengine.cpp b/src/plugins/callgrind/callgrindengine.cpp
index 7d01c287b68..9f88d281edb 100644
--- a/src/plugins/callgrind/callgrindengine.cpp
+++ b/src/plugins/callgrind/callgrindengine.cpp
@@ -61,10 +61,6 @@ CallgrindEngine::CallgrindEngine(const AnalyzerStartParameters &sp,
m_progress->setProgressRange(0, 2);
}
-CallgrindEngine::~CallgrindEngine()
-{
-}
-
QStringList CallgrindEngine::toolArguments() const
{
QStringList arguments;
diff --git a/src/plugins/callgrind/callgrindengine.h b/src/plugins/callgrind/callgrindengine.h
index 37fc69c0f74..e23fb52658f 100644
--- a/src/plugins/callgrind/callgrindengine.h
+++ b/src/plugins/callgrind/callgrindengine.h
@@ -44,10 +44,10 @@ namespace Internal {
class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
{
Q_OBJECT
+
public:
explicit CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
- virtual ~CallgrindEngine();
void start();
diff --git a/src/plugins/callgrind/callgrindhelper.cpp b/src/plugins/callgrind/callgrindhelper.cpp
index 1e08b74bf34..020c900a21c 100644
--- a/src/plugins/callgrind/callgrindhelper.cpp
+++ b/src/plugins/callgrind/callgrindhelper.cpp
@@ -38,7 +38,8 @@
#include <QtCore/QMap>
#include <QtCore/QString>
-using namespace Callgrind::Internal;
+namespace Callgrind {
+namespace Internal {
QColor CallgrindHelper::colorForString(const QString &text)
{
@@ -65,10 +66,12 @@ QString CallgrindHelper::toPercent(float costs, const QLocale &locale)
{
if (costs > 99.9f)
return locale.toString(100) + locale.percent();
- else if (costs > 9.99f)
+ if (costs > 9.99f)
return locale.toString(costs, 'f', 1) + locale.percent();
- else if (costs > 0.009f)
+ if (costs > 0.009f)
return locale.toString(costs, 'f', 2) + locale.percent();
- else
- return QString("<") + locale.toString(0.01f) + locale.percent();
+ return QString("<") + locale.toString(0.01f) + locale.percent();
}
+
+} // namespace Internal
+} // namespace Callgrind
diff --git a/src/plugins/callgrind/callgrindhelper.h b/src/plugins/callgrind/callgrindhelper.h
index 383d56456b9..d013f9be497 100644
--- a/src/plugins/callgrind/callgrindhelper.h
+++ b/src/plugins/callgrind/callgrindhelper.h
@@ -62,7 +62,7 @@ namespace CallgrindHelper
QString toPercent(float costs, const QLocale &locale = QLocale());
}
-}
-}
+} // namespace Internal
+} // namespace Callgrind
#endif // CALLGRINDHELPER_H
diff --git a/src/plugins/callgrind/callgrindtool.cpp b/src/plugins/callgrind/callgrindtool.cpp
index 0ff3379d00b..3d158e55637 100644
--- a/src/plugins/callgrind/callgrindtool.cpp
+++ b/src/plugins/callgrind/callgrindtool.cpp
@@ -43,7 +43,6 @@
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzersettings.h>
#include <analyzerbase/analyzerutils.h>
-#include <analyzerbase/ianalyzeroutputpaneadapter.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
@@ -98,13 +97,13 @@ static QToolButton *createToolButton(QAction *action)
}
CallgrindTool::CallgrindTool(QObject *parent)
-: Analyzer::IAnalyzerTool(parent)
-, m_callgrindWidgetHandler(0)
-, m_dumpAction(0)
-, m_resetAction(0)
-, m_pauseAction(0)
-, m_showCostsOfFunctionAction(0)
-, m_toolbarWidget(0)
+ : Analyzer::IAnalyzerTool(parent)
+ , m_callgrindWidgetHandler(0)
+ , m_dumpAction(0)
+ , m_resetAction(0)
+ , m_pauseAction(0)
+ , m_showCostsOfFunctionAction(0)
+ , m_toolbarWidget(0)
{
Core::ICore *core = Core::ICore::instance();
@@ -226,12 +225,12 @@ IAnalyzerEngine *CallgrindTool::createEngine(const AnalyzerStartParameters &sp,
{
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
- connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)), SLOT(takeParserData(CallgrindEngine *)));
-
+ connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
+ SLOT(takeParserData(CallgrindEngine *)));
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
- this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
+ SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
connect(engine, SIGNAL(finished()),
- this, SLOT(engineFinished()));
+ SLOT(engineFinished()));
connect(this, SIGNAL(dumpRequested()), engine, SLOT(dump()));
connect(this, SIGNAL(resetRequested()), engine, SLOT(reset()));
@@ -299,11 +298,6 @@ QWidget *CallgrindTool::createControlWidget()
return widget;
}
-CallgrindWidgetHandler *CallgrindTool::callgrindWidgetHandler() const
-{
- return m_callgrindWidgetHandler;
-}
-
void CallgrindTool::clearErrorView()
{
clearTextMarks();
diff --git a/src/plugins/callgrind/callgrindtool.h b/src/plugins/callgrind/callgrindtool.h
index 3b724e44599..d36fdac34f4 100644
--- a/src/plugins/callgrind/callgrindtool.h
+++ b/src/plugins/callgrind/callgrindtool.h
@@ -85,10 +85,10 @@ public:
virtual QWidget *createControlWidget();
// For the output pane adapter.
- CallgrindWidgetHandler *callgrindWidgetHandler() const;
void clearErrorView();
virtual bool canRunRemotely() const;
+ bool needsOutputPane() const { return false; }
signals:
void dumpRequested();
diff --git a/src/plugins/callgrind/callgrindvisualisation.cpp b/src/plugins/callgrind/callgrindvisualisation.cpp
index 511c0d0fc92..3ff9b6b6eaa 100644
--- a/src/plugins/callgrind/callgrindvisualisation.cpp
+++ b/src/plugins/callgrind/callgrindvisualisation.cpp
@@ -57,7 +57,7 @@
// QGraphicsView::fitInView(const QRectF &rect,
// Qt::AspectRatioMode aspectRatioMode)
// Bug report here: http://bugreports.qt.nokia.com/browse/QTBUG-11945
-#define FIT_IN_VIEW_MARGIN 2;
+static const int FIT_IN_VIEW_MARGIN = 2;
using namespace Valgrind::Callgrind;
@@ -218,7 +218,6 @@ class Visualisation::Private
{
public:
Private(Visualisation *qq);
- ~Private();
void handleMousePressEvent(QMouseEvent *event, bool doubleClicked);
qreal sceneHeight() const;
@@ -245,11 +244,6 @@ Visualisation::Private::Private(Visualisation *qq)
qq, SLOT(populateScene()));
}
-Visualisation::Private::~Private()
-{
-
-}
-
void Visualisation::Private::handleMousePressEvent(QMouseEvent *event,
bool doubleClicked)
{
@@ -466,5 +460,5 @@ void Visualisation::resizeEvent(QResizeEvent *event)
QGraphicsView::resizeEvent(event);
}
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Callgrind
diff --git a/src/plugins/callgrind/callgrindvisualisation.h b/src/plugins/callgrind/callgrindvisualisation.h
index a971408c275..2694d0c1817 100644
--- a/src/plugins/callgrind/callgrindvisualisation.h
+++ b/src/plugins/callgrind/callgrindvisualisation.h
@@ -88,7 +88,7 @@ private:
Private *d;
};
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Callgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H
diff --git a/src/plugins/memcheck/memchecktool.cpp b/src/plugins/memcheck/memchecktool.cpp
index aac5e90f1fb..932584478fd 100644
--- a/src/plugins/memcheck/memchecktool.cpp
+++ b/src/plugins/memcheck/memchecktool.cpp
@@ -320,9 +320,11 @@ IAnalyzerTool::ToolMode MemcheckTool::mode() const
return DebugMode;
}
-class FrameFinder : public ErrorListModel::RelevantFrameFinder {
+class FrameFinder : public ErrorListModel::RelevantFrameFinder
+{
public:
- Frame findRelevant(const Error &error) const {
+ Frame findRelevant(const Error &error) const
+ {
const QVector<Stack> stacks = error.stacks();
if (stacks.isEmpty())
return Frame();
@@ -467,7 +469,7 @@ void MemcheckTool::engineStarting(const IAnalyzerEngine *engine)
QMenu *MemcheckTool::filterMenu() const
{
- QTC_ASSERT(m_suppressionSeparator, return 0; )
+ QTC_ASSERT(m_suppressionSeparator, return 0);
foreach (QWidget *w, m_suppressionSeparator->associatedWidgets())
if (QMenu *menu = qobject_cast<QMenu *>(w))
return menu;
@@ -491,7 +493,8 @@ void MemcheckTool::parserError(const Valgrind::XmlProtocol::Error &error)
void MemcheckTool::internalParserError(const QString &errorString)
{
- QMessageBox::critical(m_errorView, tr("Internal Error"), tr("Error occurred parsing valgrind output: %1").arg(errorString));
+ QMessageBox::critical(m_errorView, tr("Internal Error"),
+ tr("Error occurred parsing valgrind output: %1").arg(errorString));
}
void MemcheckTool::clearErrorView()
diff --git a/src/plugins/memcheck/memchecktool.h b/src/plugins/memcheck/memchecktool.h
index 52997cd8903..4895898cb18 100644
--- a/src/plugins/memcheck/memchecktool.h
+++ b/src/plugins/memcheck/memchecktool.h
@@ -64,6 +64,7 @@ class AnalyzerSettings;
namespace Memcheck {
namespace Internal {
+
class MemCheckOutputPaneAdapter;
class MemcheckErrorView;
class FrameFinder;
@@ -71,6 +72,7 @@ class FrameFinder;
class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
+
public:
MemcheckErrorFilterProxyModel(QObject *parent = 0);
@@ -80,6 +82,7 @@ public slots:
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
+
private:
QList<int> m_acceptedKinds;
bool m_filterExternalIssues;
@@ -88,6 +91,7 @@ private:
class MemcheckTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
+
public:
explicit MemcheckTool(QObject *parent = 0);
@@ -96,18 +100,19 @@ public:
ToolMode mode() const;
void initialize();
- virtual void extensionsInitialized() {}
+ void extensionsInitialized() {}
- virtual Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
- virtual Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
- ProjectExplorer::RunConfiguration *runConfiguration = 0);
+ Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
+ Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
+ ProjectExplorer::RunConfiguration *runConfiguration = 0);
// For the output pane adapter.
MemcheckErrorView *ensurePaneErrorView();
QWidget *createPaneToolBarWidget();
void clearErrorView();
- virtual bool canRunRemotely() const;
+ bool canRunRemotely() const;
+ bool needsOutputPane() const { return true; }
private slots:
void settingsDestroyed(QObject *settings);
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index ba00d299ec8..4b7932b38a2 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -36,16 +36,17 @@
#include "qmlprofilerplugin.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilerattachdialog.h"
+#include "qmlprofilersummaryview.h"
#include "tracewindow.h"
+#include "timelineview.h"
+
#include <qmljsdebugclient/qdeclarativedebugclient_p.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerconstants.h>
#include <analyzerbase/ianalyzeroutputpaneadapter.h>
-#include "timelineview.h"
-
#include "canvas/qdeclarativecanvas_p.h"
#include "canvas/qdeclarativecontext2d_p.h"
#include "canvas/qdeclarativetiledcanvas_p.h"
@@ -69,10 +70,8 @@
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
-#include <QtGui/QToolButton>
-
#include <QtGui/QTabWidget>
-#include "qmlprofilersummaryview.h"
+#include <QtGui/QToolButton>
using namespace Analyzer;
using namespace QmlProfiler::Internal;
@@ -96,7 +95,6 @@ public:
virtual void goToNext() { /*TODO*/ }
virtual void goToPrev() { /*TODO*/ }
-
private:
QmlProfilerTool *m_tool;
};
@@ -402,6 +400,7 @@ void QmlProfilerTool::attach()
connectClient();
AnalyzerManager::instance()->showMode();
+ AnalyzerManager::instance()->popupOutputPane();
} else {
stopRecording();
}
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h
index ef9948c4b13..aec68644641 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.h
+++ b/src/plugins/qmlprofiler/qmlprofilertool.h
@@ -43,6 +43,7 @@ namespace Internal {
class QmlProfilerTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
+
public:
explicit QmlProfilerTool(QObject *parent = 0);
~QmlProfilerTool();
@@ -62,6 +63,7 @@ public:
QWidget *createTimeLineWidget();
bool canRunRemotely() const;
+ bool needsOutputPane() const { return false; }
void clearDisplay();
diff --git a/src/plugins/valgrindtoolbase/valgrindengine.cpp b/src/plugins/valgrindtoolbase/valgrindengine.cpp
index 78991b94469..71c9a9743a0 100644
--- a/src/plugins/valgrindtoolbase/valgrindengine.cpp
+++ b/src/plugins/valgrindtoolbase/valgrindengine.cpp
@@ -187,7 +187,7 @@ void ValgrindEngine::receiveProcessError(const QString &error, QProcess::Process
///FIXME: get a better API for this into Qt Creator
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
- QList< Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
+ QList<Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
foreach (Core::IOutputPane *pane, panes) {
if (pane->displayName() == tr("Application Output")) {
pane->popup(false);