QmlProfiler: Retrieve common actions from ActionManager

This removes the need to pass the QmlProfilerTool instance to all views.
QmlProfilerTool is exported so that we can access the common actions
from plugins.

Change-Id: Ie7072c23ef35763b729f4b87acce47ecbdb76e43
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-01-04 17:20:13 +01:00
parent c16b843ecc
commit e4efb9bb3b
9 changed files with 32 additions and 38 deletions

View File

@@ -57,11 +57,9 @@ public:
QmlProfilerStatisticsView *eventsView;
QmlProfilerStateManager *profilerState;
QmlProfilerModelManager *profilerModelManager;
QmlProfilerTool *profilerTool;
};
QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent,
QmlProfilerTool *profilerTool,
QmlProfilerModelManager *modelManager,
QmlProfilerStateManager *profilerState)
: QObject(parent), d(new QmlProfilerViewManagerPrivate(this))
@@ -71,7 +69,6 @@ QmlProfilerViewManager::QmlProfilerViewManager(QObject *parent,
d->eventsView = 0;
d->profilerState = profilerState;
d->profilerModelManager = modelManager;
d->profilerTool = profilerTool;
createViews();
}
@@ -88,15 +85,12 @@ void QmlProfilerViewManager::createViews()
Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow();
d->traceView = new QmlProfilerTraceView(mw,
d->profilerTool,
this,
d->profilerModelManager);
d->traceView = new QmlProfilerTraceView(mw, this, d->profilerModelManager);
d->traceView->setWindowTitle(tr("Timeline"));
connect(d->traceView, &QmlProfilerTraceView::gotoSourceLocation,
this, &QmlProfilerViewManager::gotoSourceLocation);
d->eventsView = new QmlProfilerStatisticsView(mw, d->profilerTool, d->profilerModelManager);
d->eventsView = new QmlProfilerStatisticsView(mw, d->profilerModelManager);
d->eventsView->setWindowTitle(tr("Statistics"));
connect(d->eventsView, &QmlProfilerStatisticsView::gotoSourceLocation,
this, &QmlProfilerViewManager::gotoSourceLocation);