QmlProfiler: Move constants to qmlprofilerconstants.h

Change-Id: Ic4f1b02bbf9e1467811334a16cd9c13d1924c47e
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2015-12-10 16:49:47 +01:00
parent b769156c19
commit 01e4ba4a10
4 changed files with 16 additions and 14 deletions

View File

@@ -35,7 +35,6 @@ namespace QmlProfiler {
namespace Constants { namespace Constants {
const char ATTACH[] = "Menu.Analyzer.Attach"; const char ATTACH[] = "Menu.Analyzer.Attach";
const char TraceFileExtension[] = ".qtd";
const char TASK_LOAD[] = "QmlProfiler.TaskLoad"; const char TASK_LOAD[] = "QmlProfiler.TaskLoad";
const char TASK_SAVE[] = "QmlProfiler.TaskSave"; const char TASK_SAVE[] = "QmlProfiler.TaskSave";
const char FLUSH_ENABLED[] = "Analyzer.QmlProfiler.FlushEnabled"; const char FLUSH_ENABLED[] = "Analyzer.QmlProfiler.FlushEnabled";
@@ -45,6 +44,11 @@ const char AGGREGATE_TRACES[] = "Analyzer.QmlProfiler.AggregateTraces";
const char SETTINGS[] = "Analyzer.QmlProfiler.Settings"; const char SETTINGS[] = "Analyzer.QmlProfiler.Settings";
const char ANALYZER[] = "Analyzer"; const char ANALYZER[] = "Analyzer";
const char TraceFileExtension[] = ".qtd";
const char QmlProfilerToolId[] = "QmlProfiler";
const char QmlProfilerLocalActionId[] = "QmlProfiler.Local";
const char QmlProfilerRemoteActionId[] = "QmlProfiler.Remote";
} // namespace Constants } // namespace Constants
} // namespace QmlProfiler } // namespace QmlProfiler

View File

@@ -71,20 +71,20 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
"applications using QML."); "applications using QML.");
action = new AnalyzerAction(this); action = new AnalyzerAction(this);
action->setActionId(QmlProfilerLocalActionId); action->setActionId(Constants::QmlProfilerLocalActionId);
action->setToolId(QmlProfilerToolId); action->setToolId(Constants::QmlProfilerToolId);
action->setWidgetCreator(widgetCreator); action->setWidgetCreator(widgetCreator);
action->setRunControlCreator(runControlCreator); action->setRunControlCreator(runControlCreator);
action->setToolPreparer([tool] { return tool->prepareTool(); }); action->setToolPreparer([tool] { return tool->prepareTool(); });
action->setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); action->setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
action->setText(tr("QML Profiler")); action->setText(tr("QML Profiler"));
action->setToolTip(description); action->setToolTip(description);
action->setMenuGroup(Constants::G_ANALYZER_TOOLS); action->setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
AnalyzerManager::addAction(action); AnalyzerManager::addAction(action);
action = new AnalyzerAction(this); action = new AnalyzerAction(this);
action->setActionId(QmlProfilerRemoteActionId); action->setActionId(Constants::QmlProfilerRemoteActionId);
action->setToolId(QmlProfilerToolId); action->setToolId(Constants::QmlProfilerToolId);
action->setWidgetCreator(widgetCreator); action->setWidgetCreator(widgetCreator);
action->setRunControlCreator(runControlCreator); action->setRunControlCreator(runControlCreator);
action->setCustomToolStarter([tool] { tool->startRemoteTool(); }); action->setCustomToolStarter([tool] { tool->startRemoteTool(); });
@@ -92,7 +92,7 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
action->setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); action->setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
action->setText(tr("QML Profiler (External)")); action->setText(tr("QML Profiler (External)"));
action->setToolTip(description); action->setToolTip(description);
action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS); action->setMenuGroup(Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS);
AnalyzerManager::addAction(action); AnalyzerManager::addAction(action);
addAutoReleasedObject(new QmlProfilerRunControlFactory()); addAutoReleasedObject(new QmlProfilerRunControlFactory());

View File

@@ -31,9 +31,11 @@
#ifndef QMLPROFILERTOOL_H #ifndef QMLPROFILERTOOL_H
#define QMLPROFILERTOOL_H #define QMLPROFILERTOOL_H
#include "qmlprofilerconstants.h"
#include "qmldebug/qmlprofilereventtypes.h"
#include <analyzerbase/ianalyzertool.h> #include <analyzerbase/ianalyzertool.h>
#include <analyzerbase/analyzerruncontrol.h> #include <analyzerbase/analyzerruncontrol.h>
#include "qmldebug/qmlprofilereventtypes.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QMessageBox; class QMessageBox;
@@ -42,10 +44,6 @@ QT_END_NAMESPACE
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
const char QmlProfilerToolId[] = "QmlProfiler";
const char QmlProfilerLocalActionId[] = "QmlProfiler.Local";
const char QmlProfilerRemoteActionId[] = "QmlProfiler.Remote";
class QmlProfilerTool : public QObject class QmlProfilerTool : public QObject
{ {
Q_OBJECT Q_OBJECT

View File

@@ -109,9 +109,9 @@ void QmlProfilerViewManager::createViews()
d->eventsView, &QmlProfilerEventsWidget::onVisibleFeaturesChanged); d->eventsView, &QmlProfilerEventsWidget::onVisibleFeaturesChanged);
QDockWidget *eventsDock = AnalyzerManager::createDockWidget QDockWidget *eventsDock = AnalyzerManager::createDockWidget
(QmlProfilerToolId, d->eventsView); (Constants::QmlProfilerToolId, d->eventsView);
d->timelineDock = AnalyzerManager::createDockWidget d->timelineDock = AnalyzerManager::createDockWidget
(QmlProfilerToolId, d->traceView); (Constants::QmlProfilerToolId, d->traceView);
eventsDock->show(); eventsDock->show();
d->timelineDock->show(); d->timelineDock->show();