QmlProfiler: Move the file finder into the QML model

This is the place where we need it most. In addition, this allows us to
use the DetailsRewriter's cache also on gotoSourceLocation.

Change-Id: I14e0f11ba7c8a2a3888b2e8439a375068b36e29a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Ulf Hermann
2016-12-28 16:45:43 +01:00
parent 5dd25c42cb
commit 827d48db6e
12 changed files with 115 additions and 81 deletions

View File

@@ -94,14 +94,13 @@ QString getInitialDetails(const QmlEventType &event)
return details;
}
QmlProfilerDataModel::QmlProfilerDataModel(Utils::FileInProjectFinder *fileFinder,
QmlProfilerModelManager *parent) :
QmlProfilerDataModel::QmlProfilerDataModel(QmlProfilerModelManager *parent) :
QObject(parent), d_ptr(new QmlProfilerDataModelPrivate)
{
Q_D(QmlProfilerDataModel);
Q_ASSERT(parent);
d->detailsRewriter = new QmlProfilerDetailsRewriter(this);
d->modelManager = parent;
d->detailsRewriter = new QmlProfilerDetailsRewriter(fileFinder, this);
d->modelId = d->modelManager->registerModelProxy();
connect(d->detailsRewriter, &QmlProfilerDetailsRewriter::rewriteDetailsString,
this, &QmlProfilerDataModel::detailsChanged);
@@ -146,6 +145,19 @@ void QmlProfilerDataModel::addEventType(const QmlEventType &type)
d->rewriteType(typeIndex);
}
void QmlProfilerDataModel::populateFileFinder(
const ProjectExplorer::RunConfiguration *runConfiguration)
{
Q_D(QmlProfilerDataModel);
d->detailsRewriter->populateFileFinder(runConfiguration);
}
QString QmlProfilerDataModel::findLocalFile(const QString &remoteFile)
{
Q_D(QmlProfilerDataModel);
return d->detailsRewriter->getLocalFile(remoteFile);
}
void QmlProfilerDataModel::addEvent(const QmlEvent &event)
{
Q_D(QmlProfilerDataModel);