Commit b0d79542 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Replace QStringList with QString in event data



We never have multi-string event data and dragging around the list
everywhere just adds noise.

Change-Id: I4c73543464abea01d342e3f0a296ed1b05ee2a88
Reviewed-by: default avatarKai Koehne <kai.koehne@digia.com>
parent c7c4be9c
......@@ -47,7 +47,7 @@ public:
QmlProfilerTraceClient *q;
qint64 inProgressRanges;
QStack<qint64> rangeStartTimes[MaximumRangeType];
QStack<QStringList> rangeDatas[MaximumRangeType];
QStack<QString> rangeDatas[MaximumRangeType];
QStack<QmlEventLocation> rangeLocations[MaximumRangeType];
QStack<BindingType> bindingTypes;
int rangeCount[MaximumRangeType];
......@@ -175,7 +175,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
stream >> threadId;
else
threadId = 0;
emit rangedEvent(Event, MaximumRangeType, AnimationFrame, time, 0, QStringList(),
emit rangedEvent(Event, MaximumRangeType, AnimationFrame, time, 0, QString(),
QmlDebug::QmlEventLocation(), frameRate, animationCount, threadId,0,0);
d->maximumTime = qMax(time, d->maximumTime);
} else if (event == StartTrace) {
......@@ -199,7 +199,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
while (count<5)
params[count++] = 0;
emit rangedEvent(SceneGraphFrame, QmlDebug::MaximumRangeType, sgEventType,time, 0,
QStringList(), QmlDebug::QmlEventLocation(), params[0], params[1],
QString(), QmlDebug::QmlEventLocation(), params[0], params[1],
params[2], params[3], params[4]);
} else if (messageType == PixmapCacheEvent) {
int pixEvTy, width = 0, height = 0, refcount = 0;
......@@ -212,7 +212,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
refcount = 1;
}
emit rangedEvent(QmlDebug::PixmapCacheEvent, QmlDebug::MaximumRangeType, pixEvTy, time, 0,
QStringList(), QmlDebug::QmlEventLocation(pixUrl,0,0), width, height,
QString(), QmlDebug::QmlEventLocation(pixUrl,0,0), width, height,
refcount, 0, 0);
d->maximumTime = qMax(time, d->maximumTime);
} else if (messageType == MemoryAllocation) {
......@@ -220,7 +220,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
qint64 delta;
stream >> type >> delta;
emit rangedEvent(QmlDebug::MemoryAllocation, QmlDebug::MaximumRangeType, type, time, 0,
QStringList(), QmlDebug::QmlEventLocation(), delta, 0, 0, 0, 0);
QString(), QmlDebug::QmlEventLocation(), delta, 0, 0, 0, 0);
d->maximumTime = qMax(time, d->maximumTime);
} else {
int range;
......@@ -252,8 +252,8 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
int count = d->rangeCount[range];
if (count > 0) {
while (d->rangeDatas[range].count() < count)
d->rangeDatas[range].push(QStringList());
d->rangeDatas[range][count-1] << data;
d->rangeDatas[range].push(QString());
d->rangeDatas[range][count-1] = data;
}
} else if (messageType == RangeLocation) {
......@@ -274,7 +274,7 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
d->inProgressRanges &= ~(static_cast<qint64>(1) << range);
d->maximumTime = qMax(time, d->maximumTime);
QStringList data = d->rangeDatas[range].count() ? d->rangeDatas[range].pop() : QStringList();
QString data = d->rangeDatas[range].count() ? d->rangeDatas[range].pop() : QString();
QmlEventLocation location = d->rangeLocations[range].count() ? d->rangeLocations[range].pop() : QmlEventLocation();
qint64 startTime = d->rangeStartTimes[range].pop();
......
......@@ -68,7 +68,7 @@ signals:
void traceFinished( qint64 time );
void traceStarted( qint64 time );
void rangedEvent(QmlDebug::Message, QmlDebug::RangeType, int detailType, qint64 startTime,
qint64 length, const QStringList &data,
qint64 length, const QString &data,
const QmlDebug::QmlEventLocation &location, qint64 param1, qint64 param2,
qint64 param3, qint64 param4, qint64 param5);
void recordingChanged(bool arg);
......
......@@ -176,11 +176,11 @@ void QmlProfilerClientManager::connectClientSignals()
this, SLOT(qmlComplete(qint64)));
connect(d->qmlclientplugin.data(),
SIGNAL(rangedEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,qint64,qint64,qint64,
QString,QmlDebug::QmlEventLocation,qint64,qint64,qint64,
qint64,qint64)),
d->modelManager,
SLOT(addQmlEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,qint64,qint64,qint64,qint64,
QString,QmlDebug::QmlEventLocation,qint64,qint64,qint64,qint64,
qint64)));
connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)),
d->modelManager->traceTime(), SLOT(setEndTime(qint64)));
......
......@@ -88,7 +88,8 @@ QString getInitialDetails(const QmlProfilerDataModel::QmlEventData &event)
if (event.data.isEmpty())
details = QmlProfilerDataModel::tr("Source code not available.");
else {
details = event.data.join(QLatin1String(" ")).replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
details = event.data;
details.replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
if (details.isEmpty()) {
details = QmlProfilerDataModel::tr("anonymous function");
} else {
......@@ -163,7 +164,7 @@ void QmlProfilerDataModel::complete()
QmlEventData *event = &d->eventList[i];
event->location = getLocation(*event);
event->displayName = getDisplayName(*event);
event->data = QStringList() << getInitialDetails(*event);
event->data = getInitialDetails(*event);
//
// request further details from files
......@@ -191,7 +192,7 @@ void QmlProfilerDataModel::complete()
void QmlProfilerDataModel::addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType,
int detailType, qint64 startTime,
qint64 duration, const QStringList &data,
qint64 duration, const QString &data,
const QmlDebug::QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3,
qint64 ndata4, qint64 ndata5)
......@@ -239,7 +240,7 @@ void QmlProfilerDataModel::detailsChanged(int requestId, const QString &newStrin
QTC_ASSERT(requestId < d->eventList.count(), return);
QmlEventData *event = &d->eventList[requestId];
event->data = QStringList(newString);
event->data = newString;
}
}
......@@ -46,7 +46,7 @@ public:
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
qint64 startTime;
qint64 duration;
QStringList data;
QString data;
QmlDebug::QmlEventLocation location;
qint64 numericData1;
qint64 numericData2;
......@@ -63,7 +63,7 @@ public:
virtual bool isEmpty() const;
virtual void complete();
void addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType, int bindingType,
qint64 startTime, qint64 duration, const QStringList &data,
qint64 startTime, qint64 duration, const QString &data,
const QmlDebug::QmlEventLocation &location, qint64 ndata1, qint64 ndata2,
qint64 ndata3, qint64 ndata4, qint64 ndata5);
static QString getHashString(const QmlProfilerDataModel::QmlEventData &event);
......
......@@ -159,7 +159,7 @@ void QmlProfilerEventsModelProxy::loadData(qint64 rangeStart, qint64 rangeEnd)
QmlEventStats stats = {
event->displayName,
hash,
event->data.join(QLatin1String(" ")),
event->data,
event->location,
event->message,
event->rangeType,
......@@ -354,7 +354,7 @@ void QmlProfilerEventParentsModelProxy::loadData()
0,
0,
0,
QStringList() << tr("Main Program"),
tr("Main Program"),
QmlDebug::QmlEventLocation(rootEventName, 0, 0),
0,0,0,0,0 // numericData fields
};
......@@ -413,7 +413,7 @@ void QmlProfilerEventParentsModelProxy::loadData()
parent->rangeType = parentEvent->rangeType;
parent->duration = event.duration;
parent->calls = 1;
parent->details = parentEvent->data.join(QLatin1String(""));
parent->details = parentEvent->data;
parent->isBindingLoop = eventsInBindingLoop.contains(parentHash);
}
......@@ -486,7 +486,7 @@ void QmlProfilerEventChildrenModelProxy::loadData()
child->rangeType = event.rangeType;
child->duration = event.duration;
child->calls = 1;
child->details = event.data.join(QLatin1String(""));
child->details = event.data;
child->isBindingLoop = eventsInBindingLoop.contains(parentHash);
}
......
......@@ -254,7 +254,7 @@ void QmlProfilerModelManager::addQmlEvent(QmlDebug::Message message,
int detailType,
qint64 startTime,
qint64 length,
const QStringList &data,
const QString &data,
const QmlDebug::QmlEventLocation &location,
qint64 ndata1,
qint64 ndata2,
......@@ -356,10 +356,10 @@ void QmlProfilerModelManager::load()
QmlProfilerFileReader reader;
connect(&reader, SIGNAL(error(QString)), this, SIGNAL(error(QString)));
connect(&reader, SIGNAL(rangedEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,
QString,QmlDebug::QmlEventLocation,
qint64, qint64, qint64, qint64, qint64)),
this, SLOT(addQmlEvent(QmlDebug::Message,QmlDebug::RangeType,int,qint64,qint64,
QStringList,QmlDebug::QmlEventLocation,
QString,QmlDebug::QmlEventLocation,
qint64, qint64, qint64, qint64, qint64)));
connect(&reader, SIGNAL(traceStartTime(qint64)), traceTime(), SLOT(setStartTime(qint64)));
connect(&reader, SIGNAL(traceEndTime(qint64)), traceTime(), SLOT(setEndTime(qint64)));
......
......@@ -140,7 +140,7 @@ public slots:
void prepareForWriting();
void addQmlEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType, int bindingType,
qint64 startTime, qint64 length, const QStringList &data,
qint64 startTime, qint64 length, const QString &data,
const QmlDebug::QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
void addV8Event(int depth, const QString &function,const QString &filename, int lineNumber,
......
......@@ -117,7 +117,7 @@ void RangeTimelineModel::loadData()
if (i == eventIdsByHash.cend()) {
QmlRangeEventData rangeEventData = {
event.displayName,
event.data.join(QLatin1String(" ")),
event.data,
event.location,
lastEventId++ // event id
};
......
......@@ -388,7 +388,7 @@ void QmlProfilerFileReader::processQmlEvents()
QmlEvent &event = m_qmlEvents[eventIndex];
emit rangedEvent(event.message, event.rangeType, event.detailType, range.startTime,
range.duration, QStringList(event.details),
range.duration, event.details,
QmlEventLocation(event.filename, event.line, event.column),
range.numericData1,range.numericData2, range.numericData3,
range.numericData4, range.numericData5);
......@@ -428,7 +428,7 @@ void QmlProfilerFileWriter::setQmlEvents(const QVector<QmlProfilerDataModel::Qml
QmlEvent e = {
event.displayName,
event.location.filename,
event.data.join(_("")),
event.data,
event.message,
event.rangeType,
event.detailType,
......
......@@ -87,7 +87,7 @@ signals:
void traceEndTime(qint64 traceStartTime);
void rangedEvent(QmlDebug::Message message, QmlDebug::RangeType rangeType, int detailType,
qint64 startTime, qint64 length, const QStringList &data,
qint64 startTime, qint64 length, const QString &data,
const QmlDebug::QmlEventLocation &location,
qint64 param1, qint64 param2, qint64 param3, qint64 param4, qint64 param5);
void error(const QString &error);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment