forked from qt-creator/qt-creator
QmlProfiler: rename requestId into typeId
No need to invent a new name for the same thing. Change-Id: I370ec7be9c762642ae35e4f7a60ff9f5eb8ae3fe Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -267,11 +267,11 @@ void QmlProfilerDataModel::finalize()
|
||||
d->detailsRewriter->reloadDocuments();
|
||||
}
|
||||
|
||||
void QmlProfilerDataModel::detailsChanged(int requestId, const QString &newString)
|
||||
void QmlProfilerDataModel::detailsChanged(int typeId, const QString &newString)
|
||||
{
|
||||
Q_D(QmlProfilerDataModel);
|
||||
QTC_ASSERT(requestId < d->eventTypes.count(), return);
|
||||
d->eventTypes[requestId].setData(newString);
|
||||
QTC_ASSERT(typeId < d->eventTypes.count(), return);
|
||||
d->eventTypes[typeId].setData(newString);
|
||||
}
|
||||
|
||||
} // namespace QmlProfiler
|
||||
|
||||
@@ -59,7 +59,7 @@ signals:
|
||||
void allTypesLoaded();
|
||||
|
||||
protected slots:
|
||||
void detailsChanged(int requestId, const QString &newString);
|
||||
void detailsChanged(int typeId, const QString &newString);
|
||||
|
||||
private:
|
||||
class QmlProfilerDataModelPrivate;
|
||||
|
||||
@@ -91,7 +91,7 @@ QmlProfilerDetailsRewriter::QmlProfilerDetailsRewriter(Utils::FileInProjectFinde
|
||||
{
|
||||
}
|
||||
|
||||
void QmlProfilerDetailsRewriter::requestDetailsForLocation(int requestId,
|
||||
void QmlProfilerDetailsRewriter::requestDetailsForLocation(int typeId,
|
||||
const QmlEventLocation &location)
|
||||
{
|
||||
QString localFile;
|
||||
@@ -113,7 +113,7 @@ void QmlProfilerDetailsRewriter::requestDetailsForLocation(int requestId,
|
||||
if (m_pendingEvents.isEmpty())
|
||||
connectQmlModel();
|
||||
|
||||
m_pendingEvents.insert(localFile, {location, requestId});
|
||||
m_pendingEvents.insert(localFile, {location, typeId});
|
||||
}
|
||||
|
||||
void QmlProfilerDetailsRewriter::reloadDocuments()
|
||||
@@ -132,7 +132,7 @@ void QmlProfilerDetailsRewriter::reloadDocuments()
|
||||
}
|
||||
|
||||
void QmlProfilerDetailsRewriter::rewriteDetailsForLocation(
|
||||
const QString &source, QmlJS::Document::Ptr doc, int requestId,
|
||||
const QString &source, QmlJS::Document::Ptr doc, int typeId,
|
||||
const QmlEventLocation &location)
|
||||
{
|
||||
PropertyVisitor propertyVisitor;
|
||||
@@ -144,7 +144,7 @@ void QmlProfilerDetailsRewriter::rewriteDetailsForLocation(
|
||||
const quint32 startPos = node->firstSourceLocation().begin();
|
||||
const quint32 len = node->lastSourceLocation().end() - startPos;
|
||||
|
||||
emit rewriteDetailsString(requestId, source.mid(startPos, len).simplified());
|
||||
emit rewriteDetailsString(typeId, source.mid(startPos, len).simplified());
|
||||
}
|
||||
|
||||
void QmlProfilerDetailsRewriter::connectQmlModel()
|
||||
@@ -185,7 +185,7 @@ void QmlProfilerDetailsRewriter::documentReady(QmlJS::Document::Ptr doc)
|
||||
const bool sourceHasContents = !source.isEmpty();
|
||||
for (auto it = first; it != m_pendingEvents.end() && it.key() == fileName;) {
|
||||
if (sourceHasContents)
|
||||
rewriteDetailsForLocation(source, doc, it->requestId, it->location);
|
||||
rewriteDetailsForLocation(source, doc, it->typeId, it->location);
|
||||
it = m_pendingEvents.erase(it);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,17 +43,17 @@ public:
|
||||
QObject *parent = nullptr);
|
||||
|
||||
void clearRequests();
|
||||
void requestDetailsForLocation(int requestId, const QmlEventLocation &location);
|
||||
void requestDetailsForLocation(int typeId, const QmlEventLocation &location);
|
||||
void reloadDocuments();
|
||||
void documentReady(QmlJS::Document::Ptr doc);
|
||||
|
||||
struct PendingEvent {
|
||||
QmlEventLocation location;
|
||||
int requestId;
|
||||
int typeId;
|
||||
};
|
||||
|
||||
signals:
|
||||
void rewriteDetailsString(int requestId, const QString &details);
|
||||
void rewriteDetailsString(int typeId, const QString &details);
|
||||
void eventDetailsChanged();
|
||||
|
||||
private:
|
||||
@@ -61,7 +61,7 @@ private:
|
||||
Utils::FileInProjectFinder *m_projectFinder;
|
||||
QHash<QString, QString> m_filesCache;
|
||||
|
||||
void rewriteDetailsForLocation(const QString &source, QmlJS::Document::Ptr doc, int requestId,
|
||||
void rewriteDetailsForLocation(const QString &source, QmlJS::Document::Ptr doc, int typeId,
|
||||
const QmlEventLocation &location);
|
||||
void connectQmlModel();
|
||||
void disconnectQmlModel();
|
||||
|
||||
Reference in New Issue
Block a user