forked from qt-creator/qt-creator
analyzer: move responsibility for run modes to individual tools
Change-Id: Iaf2fa9d4c087470649336a453c6a9a7db12d220f Reviewed-on: http://codereview.qt.nokia.com/1051 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -45,16 +45,15 @@ using namespace QmlProfiler::Internal;
|
||||
|
||||
bool QmlProfilerPlugin::debugOutput = false;
|
||||
|
||||
QmlProfilerPlugin::QmlProfilerPlugin()
|
||||
{}
|
||||
|
||||
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
addAutoReleasedObject(new QmlProjectAnalyzerRunControlFactory());
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(true, this));
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(false, this));
|
||||
StartModes modes;
|
||||
modes.append(StartMode(StartLocal));
|
||||
modes.append(StartMode(StartRemote));
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(this), modes);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,6 @@ public:
|
||||
|
||||
QmlProfilerTool *q;
|
||||
|
||||
bool m_local;
|
||||
QDeclarativeDebugConnection *m_client;
|
||||
QTimer m_connectionTimer;
|
||||
int m_connectionAttempts;
|
||||
@@ -119,10 +118,9 @@ public:
|
||||
QString m_ostDevice;
|
||||
};
|
||||
|
||||
QmlProfilerTool::QmlProfilerTool(bool local, QObject *parent)
|
||||
QmlProfilerTool::QmlProfilerTool(QObject *parent)
|
||||
: IAnalyzerTool(parent), d(new QmlProfilerToolPrivate(this))
|
||||
{
|
||||
d->m_local = local;
|
||||
d->m_client = 0;
|
||||
d->m_connectionAttempts = 0;
|
||||
d->m_traceWindow = 0;
|
||||
@@ -151,24 +149,12 @@ QmlProfilerTool::~QmlProfilerTool()
|
||||
|
||||
QByteArray QmlProfilerTool::id() const
|
||||
{
|
||||
return d->m_local ? "QmlLocalProfiler" : "QmlRemoteProfiler";
|
||||
return "QmlProfiler";
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::displayName() const
|
||||
{
|
||||
return d->m_local ? tr("QML Profiler") : tr("QML Profiler (Remote)");
|
||||
}
|
||||
|
||||
QByteArray QmlProfilerTool::menuGroup() const
|
||||
{
|
||||
return d->m_local ? Analyzer::Constants::G_ANALYZER_TOOLS
|
||||
: Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS;
|
||||
}
|
||||
|
||||
void QmlProfilerTool::startTool()
|
||||
{
|
||||
return d->m_local ? AnalyzerManager::startLocalTool(this)
|
||||
: AnalyzerManager::startRemoteTool(this);
|
||||
return tr("QML Profiler");
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::description() const
|
||||
|
||||
@@ -45,12 +45,11 @@ class QmlProfilerTool : public Analyzer::IAnalyzerTool
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QmlProfilerTool(bool local, QObject *parent);
|
||||
explicit QmlProfilerTool(QObject *parent);
|
||||
~QmlProfilerTool();
|
||||
|
||||
QByteArray id() const;
|
||||
QString displayName() const;
|
||||
QByteArray menuGroup() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
@@ -58,7 +57,6 @@ public:
|
||||
void initializeDockWidgets();
|
||||
void toolSelected();
|
||||
void toolDeselected();
|
||||
void startTool();
|
||||
|
||||
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
Reference in New Issue
Block a user