QmlProfiler: Don't access QmlProfilerTool from QmlProfilerTextMark

Only QmlProfilerViewManager is needed, so use that, as a step to
reduce the interface of the QmlProfilerTool singleton.

Change-Id: I19e55e3b22b3c64ff98b8ea29cbc5164a60ee15d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
hjk
2017-08-15 18:44:18 +02:00
parent 7458880298
commit 4342eeab33
4 changed files with 22 additions and 33 deletions

View File

@@ -290,7 +290,7 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
connect(editorManager, &EditorManager::editorCreated,
model, [this, model](Core::IEditor *editor, const QString &fileName) {
Q_UNUSED(editor);
model->createMarks(this, fileName);
model->createMarks(d->m_viewContainer, fileName);
});
}
@@ -437,11 +437,6 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber,
EditorManager::DoNotSwitchToDesignMode | EditorManager::DoNotSwitchToEditMode);
}
void QmlProfilerTool::selectType(int typeId)
{
d->m_viewContainer->typeSelected(typeId);
}
void QmlProfilerTool::updateTimeDisplay()
{
double seconds = 0;
@@ -500,7 +495,7 @@ void QmlProfilerTool::createTextMarks()
{
QmlProfilerTextMarkModel *model = d->m_profilerModelManager->textMarkModel();
foreach (IDocument *document, DocumentModel::openedDocuments())
model->createMarks(this, document->filePath().toString());
model->createMarks(d->m_viewContainer, document->filePath().toString());
}
void QmlProfilerTool::clearTextMarks()
@@ -569,16 +564,6 @@ void QmlProfilerTool::attachToWaitingApplication()
ProjectExplorerPlugin::startRunControl(runControl);
}
QString QmlProfilerTool::summary(const QVector<int> &typeIds) const
{
return d->m_viewContainer->statisticsView()->summary(typeIds);
}
QStringList QmlProfilerTool::details(int typeId) const
{
return d->m_viewContainer->statisticsView()->details(typeId);
}
void QmlProfilerTool::logState(const QString &msg)
{
MessageManager::write(msg, MessageManager::Flash);