forked from qt-creator/qt-creator
Debugger: Remove return value from AnalyzerManager::createDockWidget()
Change-Id: If6cd2a68f2f99a1977ded0f05a12790194143274 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -41,10 +41,9 @@ const char ANALYZER[] = "Analyzer";
|
||||
|
||||
const char TraceFileExtension[] = ".qtd";
|
||||
|
||||
const char QmlProfilerTimelineDock[] = "QmlProfilerTimelineDock";
|
||||
|
||||
const char QmlProfilerPerspective[] = "QmlProfilerPerspective";
|
||||
const char QmlProfilerLocalActionId[] = "QmlProfiler.Local";
|
||||
const char QmlProfilerPerspectiveId[] = "QmlProfiler.Perspective";
|
||||
const char QmlProfilerTimelineDockId[] = "QmlProfiler.Timeline.Dock";
|
||||
const char QmlProfilerLocalActionId[] = "QmlProfiler.Local";
|
||||
const char QmlProfilerRemoteActionId[] = "QmlProfiler.Remote";
|
||||
|
||||
const char QmlProfilerLoadActionId[] =
|
||||
|
||||
@@ -49,11 +49,19 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
|
||||
QmlProfilerPlugin::instance = this;
|
||||
|
||||
if (!Utils::HostOsInfo::canCreateOpenGLContext(errorString))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlProfilerPlugin::extensionsInitialized()
|
||||
{
|
||||
factory = ExtensionSystem::PluginManager::getObject<QmlProfilerTimelineModelFactory>();
|
||||
|
||||
auto tool = new QmlProfilerTool(this);
|
||||
auto widgetCreator = [tool] { return tool->createWidgets(); };
|
||||
auto runControlCreator = [tool](ProjectExplorer::RunConfiguration *runConfiguration, Core::Id) {
|
||||
return tool->createRunControl(runConfiguration);
|
||||
};
|
||||
@@ -65,20 +73,16 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
ActionDescription desc;
|
||||
desc.setText(tr("QML Profiler"));
|
||||
desc.setToolTip(description);
|
||||
desc.setActionId(Constants::QmlProfilerLocalActionId);
|
||||
desc.setPerspectiveId(Constants::QmlProfilerPerspective);
|
||||
desc.setWidgetCreator(widgetCreator);
|
||||
desc.setPerspectiveId(Constants::QmlProfilerPerspectiveId);
|
||||
desc.setRunControlCreator(runControlCreator);
|
||||
desc.setToolPreparer([tool] { return tool->prepareTool(); });
|
||||
desc.setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
desc.setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
|
||||
AnalyzerManager::addAction(desc);
|
||||
AnalyzerManager::registerAction(Constants::QmlProfilerLocalActionId, desc);
|
||||
|
||||
desc.setText(tr("QML Profiler (External)"));
|
||||
desc.setToolTip(description);
|
||||
desc.setActionId(Constants::QmlProfilerRemoteActionId);
|
||||
desc.setPerspectiveId(Constants::QmlProfilerPerspective);
|
||||
desc.setWidgetCreator(widgetCreator);
|
||||
desc.setPerspectiveId(Constants::QmlProfilerPerspectiveId);
|
||||
desc.setRunControlCreator(runControlCreator);
|
||||
desc.setCustomToolStarter([tool](ProjectExplorer::RunConfiguration *rc) {
|
||||
tool->startRemoteTool(rc);
|
||||
@@ -86,18 +90,12 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
|
||||
desc.setToolPreparer([tool] { return tool->prepareTool(); });
|
||||
desc.setRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
|
||||
desc.setMenuGroup(Analyzer::Constants::G_ANALYZER_REMOTE_TOOLS);
|
||||
AnalyzerManager::addAction(desc);
|
||||
AnalyzerManager::registerAction(Constants::QmlProfilerRemoteActionId, desc);
|
||||
|
||||
addAutoReleasedObject(new QmlProfilerRunControlFactory());
|
||||
addAutoReleasedObject(new Internal::QmlProfilerOptionsPage());
|
||||
QmlProfilerPlugin::instance = this;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmlProfilerPlugin::extensionsInitialized()
|
||||
{
|
||||
factory = ExtensionSystem::PluginManager::getObject<QmlProfilerTimelineModelFactory>();
|
||||
AnalyzerManager::registerToolbar(Constants::QmlProfilerPerspectiveId, tool->createWidgets());
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
|
||||
|
||||
@@ -90,12 +90,13 @@ void QmlProfilerViewManager::createViews()
|
||||
this, &QmlProfilerViewManager::typeSelected);
|
||||
connect(this, &QmlProfilerViewManager::typeSelected,
|
||||
d->traceView, &QmlProfilerTraceView::selectByTypeId);
|
||||
AnalyzerManager::createDockWidget(d->traceView, Constants::QmlProfilerTimelineDock);
|
||||
AnalyzerManager::registerDockWidget(Constants::QmlProfilerTimelineDockId, d->traceView);
|
||||
|
||||
new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, d->traceView);
|
||||
|
||||
Perspective perspective(Constants::QmlProfilerPerspective);
|
||||
perspective.addDock(Constants::QmlProfilerTimelineDock, Core::Id(), Perspective::SplitVertical);
|
||||
Perspective perspective;
|
||||
perspective.addSplit({Constants::QmlProfilerTimelineDockId, Core::Id(),
|
||||
Perspective::SplitVertical});
|
||||
|
||||
d->eventsViews << new QmlProfilerStatisticsView(0, d->profilerModelManager);
|
||||
if (d->eventsViewFactory)
|
||||
@@ -104,7 +105,7 @@ void QmlProfilerViewManager::createViews()
|
||||
// Clear settings if the new views aren't there yet. Otherwise we get glitches
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
settings->beginGroup(QLatin1String("AnalyzerViewSettings_") +
|
||||
QLatin1String(QmlProfiler::Constants::QmlProfilerPerspective));
|
||||
QLatin1String(QmlProfiler::Constants::QmlProfilerPerspectiveId));
|
||||
|
||||
foreach (QmlProfilerEventsView *view, d->eventsViews) {
|
||||
connect(view, &QmlProfilerEventsView::typeSelected,
|
||||
@@ -118,14 +119,14 @@ void QmlProfilerViewManager::createViews()
|
||||
connect(view, &QmlProfilerEventsView::showFullRange,
|
||||
this, [this](){restrictEventsToRange(-1, -1);});
|
||||
Core::Id dockId = Core::Id::fromString(view->objectName());
|
||||
QDockWidget *eventsDock = AnalyzerManager::createDockWidget(view, dockId);
|
||||
perspective.addDock(dockId, Constants::QmlProfilerTimelineDock, Perspective::AddToTab);
|
||||
AnalyzerManager::registerDockWidget(dockId, view);
|
||||
perspective.addSplit({dockId, Constants::QmlProfilerTimelineDockId, Perspective::AddToTab});
|
||||
new QmlProfilerStateWidget(d->profilerState, d->profilerModelManager, view);
|
||||
|
||||
if (!settings->contains(eventsDock->objectName()))
|
||||
if (!settings->contains(view->parent()->objectName())) // parent() is QDockWidget.
|
||||
settings->remove(QString());
|
||||
}
|
||||
AnalyzerManager::addPerspective(perspective);
|
||||
AnalyzerManager::registerPerspective(Constants::QmlProfilerPerspectiveId, perspective);
|
||||
|
||||
settings->endGroup();
|
||||
QTC_ASSERT(qobject_cast<QDockWidget *>(d->traceView->parentWidget()), return);
|
||||
|
||||
Reference in New Issue
Block a user