QmlProfiler: Actually update the details when rewriter tells us to

Before, only the signal was sent. While we're at it, also disambiguate
the method and signal names.

Change-Id: Iafce9b06841d7faedfefdb0638d0fa1f60c061c1
Task-number: QTCREATORBUG-20500
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2018-05-30 13:32:29 +02:00
parent 7a68196328
commit cb70c38ca2
2 changed files with 6 additions and 5 deletions

View File

@@ -123,7 +123,7 @@ QmlProfilerModelManager::QmlProfilerModelManager(QObject *parent) :
d->detailsRewriter = new Internal::QmlProfilerDetailsRewriter(this); d->detailsRewriter = new Internal::QmlProfilerDetailsRewriter(this);
connect(d->detailsRewriter, &Internal::QmlProfilerDetailsRewriter::rewriteDetailsString, connect(d->detailsRewriter, &Internal::QmlProfilerDetailsRewriter::rewriteDetailsString,
this, &QmlProfilerModelManager::typeDetailsChanged); this, &QmlProfilerModelManager::setTypeDetails);
connect(d->detailsRewriter, &Internal::QmlProfilerDetailsRewriter::eventDetailsChanged, connect(d->detailsRewriter, &Internal::QmlProfilerDetailsRewriter::eventDetailsChanged,
this, &QmlProfilerModelManager::typeDetailsFinished); this, &QmlProfilerModelManager::typeDetailsFinished);
@@ -287,12 +287,13 @@ QString QmlProfilerModelManager::findLocalFile(const QString &remoteFile)
return d->detailsRewriter->getLocalFile(remoteFile); return d->detailsRewriter->getLocalFile(remoteFile);
} }
void QmlProfilerModelManager::detailsChanged(int typeId, const QString &newString) void QmlProfilerModelManager::setTypeDetails(int typeId, const QString &details)
{ {
QTC_ASSERT(typeId < numEventTypes(), return); QTC_ASSERT(typeId < numEventTypes(), return);
QmlEventType type = eventType(typeId); QmlEventType type = eventType(typeId);
type.setData(newString); type.setData(details);
setEventType(typeId, std::move(type)); // Don't rewrite the details again, but directly push the type into the type storage.
Timeline::TimelineTraceManager::setEventType(typeId, std::move(type));
emit typeDetailsChanged(typeId); emit typeDetailsChanged(typeId);
} }

View File

@@ -89,7 +89,7 @@ signals:
void typeDetailsFinished(); void typeDetailsFinished();
private: private:
void detailsChanged(int typeId, const QString &newString); void setTypeDetails(int typeId, const QString &details);
void restrictByFilter(QmlEventFilter filter); void restrictByFilter(QmlEventFilter filter);
void clearEventStorage() final; void clearEventStorage() final;