QmlProfiler: Apply some code cosmetics

Change-Id: I772713aec3a6c25136174b39b853a9ef3ee42a0b
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-04-28 16:02:54 +02:00
parent 54b1106f4b
commit a53780924d
33 changed files with 91 additions and 106 deletions

View File

@@ -25,8 +25,8 @@
#include "flamegraphmodel.h" #include "flamegraphmodel.h"
#include <qmlprofiler/qmlprofilermodelmanager.h> #include "qmlprofilermodelmanager.h"
#include <qmlprofiler/qmlprofilerdatamodel.h> #include "qmlprofilerdatamodel.h"
#include <utils/algorithm.h> #include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>

View File

@@ -25,9 +25,8 @@
#include "flamegraphview.h" #include "flamegraphview.h"
#include "flamegraph.h" #include "flamegraph.h"
#include "qmlprofilerconstants.h"
#include <qmlprofiler/qmlprofilerconstants.h> #include "qmlprofilertool.h"
#include <qmlprofiler/qmlprofilertool.h>
#include <QQmlContext> #include <QQmlContext>
#include <QVBoxLayout> #include <QVBoxLayout>

View File

@@ -37,9 +37,10 @@
#include <QTcpServer> #include <QTcpServer>
#include <QTemporaryFile> #include <QTemporaryFile>
using namespace QmlProfiler;
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace QmlProfiler {
QString LocalQmlProfilerRunner::findFreeSocket() QString LocalQmlProfilerRunner::findFreeSocket()
{ {
QTemporaryFile file; QTemporaryFile file;
@@ -140,3 +141,5 @@ void LocalQmlProfilerRunner::stop()
if (m_launcher.isRunning()) if (m_launcher.isRunning())
m_launcher.stop(); m_launcher.stop();
} }
} // namespace QmlProfiler

View File

@@ -35,16 +35,16 @@ struct QmlEventType {
const QmlEventLocation &location = QmlEventLocation(), const QmlEventLocation &location = QmlEventLocation(),
Message message = MaximumMessage, RangeType rangeType = MaximumRangeType, Message message = MaximumMessage, RangeType rangeType = MaximumRangeType,
int detailType = -1, const QString &data = QString()) : int detailType = -1, const QString &data = QString()) :
displayName(displayName), location(location), message(message), rangeType(rangeType), displayName(displayName), data(data), location(location), message(message),
detailType(detailType), data(data) rangeType(rangeType), detailType(detailType)
{} {}
QString displayName; QString displayName;
QString data;
QmlEventLocation location; QmlEventLocation location;
Message message; Message message;
RangeType rangeType; RangeType rangeType;
int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType int detailType; // can be EventType, BindingType, PixmapEventType or SceneGraphFrameType
QString data;
}; };
} // namespace QmlProfiler } // namespace QmlProfiler

View File

@@ -26,16 +26,16 @@
#include "qmlprofileranimationsmodel.h" #include "qmlprofileranimationsmodel.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include <utils/qtcassert.h>
#include <QCoreApplication>
#include <utils/qtcassert.h>
#include <QCoreApplication>
#include <QVector> #include <QVector>
#include <QHash> #include <QHash>
#include <QUrl> #include <QUrl>
#include <QString> #include <QString>
#include <QStack> #include <QStack>
#include <QDebug>
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
@@ -205,5 +205,5 @@ QVariantMap QmlProfilerAnimationsModel::details(int index) const
return result; return result;
} }
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -77,5 +77,5 @@ private:
int rowFromThreadId(int threadId) const; int rowFromThreadId(int threadId) const;
}; };
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -26,7 +26,6 @@
#include "qmlprofilerattachdialog.h" #include "qmlprofilerattachdialog.h"
#include <projectexplorer/kitchooser.h> #include <projectexplorer/kitchooser.h>
#include <coreplugin/id.h> #include <coreplugin/id.h>
#include <QSpinBox> #include <QSpinBox>

View File

@@ -380,5 +380,5 @@ void BindingLoopsRenderPassState::updateIndexes(int from, int to)
m_indexTo = to; m_indexTo = to;
} }
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -25,10 +25,12 @@
#pragma once #pragma once
#include "qmlprofilerrangemodel.h"
#include "timeline/timelineabstractrenderer.h" #include "timeline/timelineabstractrenderer.h"
#include "timeline/timelinerenderpass.h" #include "timeline/timelinerenderpass.h"
#include "timeline/timelinerenderstate.h" #include "timeline/timelinerenderstate.h"
#include "qmlprofilerrangemodel.h"
#include <QSGMaterial> #include <QSGMaterial>
namespace QmlProfiler { namespace QmlProfiler {
@@ -46,5 +48,5 @@ protected:
QmlProfilerBindingLoopsRenderPass(); QmlProfilerBindingLoopsRenderPass();
}; };
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -30,11 +30,11 @@
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QPointer> #include <QPointer>
#include <QTimer> #include <QTimer>
#include <QMessageBox> #include <QMessageBox>
using namespace QmlDebug;
using namespace Core; using namespace Core;
namespace QmlProfiler { namespace QmlProfiler {
@@ -45,7 +45,7 @@ class QmlProfilerClientManager::QmlProfilerClientManagerPrivate
public: public:
QmlProfilerStateManager *profilerState; QmlProfilerStateManager *profilerState;
QmlDebugConnection *connection; QmlDebug::QmlDebugConnection *connection;
QPointer<QmlProfilerTraceClient> qmlclientplugin; QPointer<QmlProfilerTraceClient> qmlclientplugin;
QTimer connectionTimer; QTimer connectionTimer;
@@ -169,7 +169,7 @@ void QmlProfilerClientManager::connectLocalClient(const QString &file)
void QmlProfilerClientManager::createConnection() void QmlProfilerClientManager::createConnection()
{ {
d->connection = new QmlDebugConnection; d->connection = new QmlDebug::QmlDebugConnection;
QTC_ASSERT(d->profilerState, return); QTC_ASSERT(d->profilerState, return);
disconnectClientSignals(); disconnectClientSignals();
@@ -180,13 +180,13 @@ void QmlProfilerClientManager::createConnection()
d->profilerState->requestedFeatures()); d->profilerState->requestedFeatures());
d->qmlclientplugin->setFlushInterval(d->flushInterval); d->qmlclientplugin->setFlushInterval(d->flushInterval);
connectClientSignals(); connectClientSignals();
connect(d->connection, &QmlDebugConnection::connected, connect(d->connection, &QmlDebug::QmlDebugConnection::connected,
this, &QmlProfilerClientManager::qmlDebugConnectionOpened); this, &QmlProfilerClientManager::qmlDebugConnectionOpened);
connect(d->connection, &QmlDebugConnection::disconnected, connect(d->connection, &QmlDebug::QmlDebugConnection::disconnected,
this, &QmlProfilerClientManager::qmlDebugConnectionClosed); this, &QmlProfilerClientManager::qmlDebugConnectionClosed);
connect(d->connection, &QmlDebugConnection::socketError, connect(d->connection, &QmlDebug::QmlDebugConnection::socketError,
this, &QmlProfilerClientManager::qmlDebugConnectionError); this, &QmlProfilerClientManager::qmlDebugConnectionError);
connect(d->connection, &QmlDebugConnection::socketStateChanged, connect(d->connection, &QmlDebug::QmlDebugConnection::socketStateChanged,
this, &QmlProfilerClientManager::qmlDebugConnectionStateChanged); this, &QmlProfilerClientManager::qmlDebugConnectionStateChanged);
} }
@@ -313,7 +313,7 @@ void QmlProfilerClientManager::qmlDebugConnectionClosed()
void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketError error) void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketError error)
{ {
logState(QmlDebugConnection::socketErrorToString(error)); logState(QmlDebug::QmlDebugConnection::socketErrorToString(error));
if (d->connection->isConnected()) { if (d->connection->isConnected()) {
disconnectClient(); disconnectClient();
emit connectionClosed(); emit connectionClosed();
@@ -324,7 +324,7 @@ void QmlProfilerClientManager::qmlDebugConnectionError(QAbstractSocket::SocketEr
void QmlProfilerClientManager::qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state) void QmlProfilerClientManager::qmlDebugConnectionStateChanged(QAbstractSocket::SocketState state)
{ {
logState(QmlDebugConnection::socketStateToString(state)); logState(QmlDebug::QmlDebugConnection::socketStateToString(state));
} }
void QmlProfilerClientManager::logState(const QString &msg) void QmlProfilerClientManager::logState(const QString &msg)

View File

@@ -95,5 +95,5 @@ private:
void stopClientsRecording(); void stopClientsRecording();
}; };
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -38,6 +38,8 @@ const char AGGREGATE_TRACES[] = "Analyzer.QmlProfiler.AggregateTraces";
const char SETTINGS[] = "Analyzer.QmlProfiler.Settings"; const char SETTINGS[] = "Analyzer.QmlProfiler.Settings";
const char ANALYZER[] = "Analyzer"; const char ANALYZER[] = "Analyzer";
const int QML_MIN_LEVEL = 1; // Set to 0 to remove the empty line between models in the timeline
const char TraceFileExtension[] = ".qtd"; const char TraceFileExtension[] = ".qtd";
const char QmlProfilerPerspectiveId[] = "QmlProfiler.Perspective"; const char QmlProfilerPerspectiveId[] = "QmlProfiler.Perspective";

View File

@@ -291,4 +291,4 @@ void QmlProfilerDataModel::detailsDone()
d->modelManager->processingDone(); d->modelManager->processingDone();
} }
} } // namespace QmlProfiler

View File

@@ -42,4 +42,4 @@ struct QMLPROFILER_EXPORT QmlEventLocation
int column; int column;
}; };
} } // namespace QmlProfiler

View File

@@ -53,4 +53,4 @@ public slots:
virtual void onVisibleFeaturesChanged(quint64 features) = 0; virtual void onVisibleFeaturesChanged(quint64 features) = 0;
}; };
} } // namespace QmlProfiler

View File

@@ -169,7 +169,6 @@ inline ProfileFeature featureFromRangeType(RangeType range)
} }
namespace Constants { namespace Constants {
const int QML_MIN_LEVEL = 1; // Set to 0 to remove the empty line between models in the timeline
// Shorthand for all QML and JS range features. // Shorthand for all QML and JS range features.
const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) | const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) |
@@ -177,6 +176,6 @@ const quint64 QML_JS_RANGE_FEATURES = (1 << ProfileCompiling) |
(1 << ProfileBinding) | (1 << ProfileBinding) |
(1 << ProfileHandlingSignal) | (1 << ProfileHandlingSignal) |
(1 << ProfileJavaScript); (1 << ProfileJavaScript);
} } // namespace Constants
} // namespace QmlProfiler } // namespace QmlProfiler

View File

@@ -129,18 +129,14 @@ void QmlProfilerTraceTime::increaseEndTime(qint64 time)
class QmlProfilerModelManager::QmlProfilerModelManagerPrivate class QmlProfilerModelManager::QmlProfilerModelManagerPrivate
{ {
public: public:
QmlProfilerModelManagerPrivate(QmlProfilerModelManager *qq) : q(qq) {}
~QmlProfilerModelManagerPrivate() {}
QmlProfilerModelManager *q;
QmlProfilerDataModel *model; QmlProfilerDataModel *model;
QmlProfilerNotesModel *notesModel; QmlProfilerNotesModel *notesModel;
QmlProfilerModelManager::State state; QmlProfilerModelManager::State state;
QmlProfilerTraceTime *traceTime; QmlProfilerTraceTime *traceTime;
QVector <double> partialCounts; QVector<double> partialCounts;
QVector <int> partialCountWeights; QVector<int> partialCountWeights;
quint64 availableFeatures; quint64 availableFeatures;
quint64 visibleFeatures; quint64 visibleFeatures;
quint64 recordedFeatures; quint64 recordedFeatures;
@@ -152,7 +148,7 @@ public:
QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *finder, QObject *parent) : QmlProfilerModelManager::QmlProfilerModelManager(Utils::FileInProjectFinder *finder, QObject *parent) :
QObject(parent), d(new QmlProfilerModelManagerPrivate(this)) QObject(parent), d(new QmlProfilerModelManagerPrivate)
{ {
d->totalWeight = 0; d->totalWeight = 0;
d->previousProgress = 0; d->previousProgress = 0;
@@ -293,12 +289,12 @@ void QmlProfilerModelManager::addQmlEvent(Message message, RangeType rangeType,
ndata2, ndata3, ndata4, ndata5); ndata2, ndata3, ndata4, ndata5);
} }
void QmlProfilerModelManager::addDebugMessage(QtMsgType type, qint64 timestamp, const QString &text, void QmlProfilerModelManager::addDebugMessage(qint64 timestamp, QtMsgType messageType,
const QmlEventLocation &location) const QString &text, const QmlEventLocation &location)
{ {
if (state() == AcquiringData) if (state() == AcquiringData)
d->model->addEvent(DebugMessage, MaximumRangeType, type, timestamp, 0, text, location, 0, 0, d->model->addEvent(DebugMessage, MaximumRangeType, messageType, timestamp, 0, text,
0, 0, 0); location, 0, 0, 0, 0, 0);
} }
void QmlProfilerModelManager::acquiringDone() void QmlProfilerModelManager::acquiringDone()
@@ -443,7 +439,7 @@ void QmlProfilerModelManager::clear()
setState(Empty); setState(Empty);
} }
void QmlProfilerModelManager::prepareForWriting() void QmlProfilerModelManager::startAcquiring()
{ {
setState(AcquiringData); setState(AcquiringData);
} }

View File

@@ -116,7 +116,6 @@ signals:
void loadFinished(); void loadFinished();
void saveFinished(); void saveFinished();
void requestDetailsForLocation(int eventType, const QmlEventLocation &location);
void availableFeaturesChanged(quint64 features); void availableFeaturesChanged(quint64 features);
void visibleFeaturesChanged(quint64 features); void visibleFeaturesChanged(quint64 features);
void recordedFeaturesChanged(quint64 features); void recordedFeaturesChanged(quint64 features);
@@ -124,11 +123,11 @@ signals:
public slots: public slots:
void clear(); void clear();
void prepareForWriting(); void startAcquiring();
void addQmlEvent(Message message, RangeType rangeType, int bindingType, qint64 startTime, void addQmlEvent(Message message, RangeType rangeType, int bindingType, qint64 startTime,
qint64 length, const QString &data, const QmlEventLocation &location, qint64 length, const QString &data, const QmlEventLocation &location,
qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5); qint64 ndata1, qint64 ndata2, qint64 ndata3, qint64 ndata4, qint64 ndata5);
void addDebugMessage(QtMsgType type, qint64 timestamp, const QString &text, void addDebugMessage(qint64 timestamp, QtMsgType type, const QString &text,
const QmlEventLocation &location); const QmlEventLocation &location);
void save(const QString &filename); void save(const QString &filename);
@@ -142,4 +141,4 @@ private:
QmlProfilerModelManagerPrivate *d; QmlProfilerModelManagerPrivate *d;
}; };
} } // namespace QmlProfiler

View File

@@ -27,6 +27,7 @@
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "qmlprofilerbindingloopsrenderpass.h" #include "qmlprofilerbindingloopsrenderpass.h"
#include "timeline/timelinenotesrenderpass.h" #include "timeline/timelinenotesrenderpass.h"
#include "timeline/timelineitemsrenderpass.h" #include "timeline/timelineitemsrenderpass.h"
#include "timeline/timelineselectionrenderpass.h" #include "timeline/timelineselectionrenderpass.h"
@@ -38,12 +39,9 @@
#include <QString> #include <QString>
#include <QStack> #include <QStack>
#include <QDebug>
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range, QmlProfilerRangeModel::QmlProfilerRangeModel(QmlProfilerModelManager *manager, RangeType range,
QObject *parent) : QObject *parent) :
QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent) QmlProfilerTimelineModel(manager, MaximumMessage, range, featureFromRangeType(range), parent)
@@ -272,5 +270,5 @@ QList<const Timeline::TimelineRenderPass *> QmlProfilerRangeModel::supportedRend
} }
} } // namespace Internal
} } // namespaec QmlProfiler

View File

@@ -29,6 +29,7 @@
#include "qmlprofilerdatamodel.h" #include "qmlprofilerdatamodel.h"
#include "qmlprofilereventtypes.h" #include "qmlprofilereventtypes.h"
#include "qmlprofilereventlocation.h" #include "qmlprofilereventlocation.h"
#include "qmlprofilerconstants.h"
#include <QVariantList> #include <QVariantList>
#include <QColor> #include <QColor>
@@ -86,5 +87,5 @@ private:
QVector<int> m_expandedRowTypes; QVector<int> m_expandedRowTypes;
}; };
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -24,7 +24,6 @@
****************************************************************************/ ****************************************************************************/
#include "qmlprofilerruncontrol.h" #include "qmlprofilerruncontrol.h"
#include "localqmlprofilerrunner.h" #include "localqmlprofilerrunner.h"
#include "qmlprofilertool.h" #include "qmlprofilertool.h"

View File

@@ -176,4 +176,4 @@ void QmlProfilerStateManager::setRecordedFeatures(quint64 features)
} }
} }
} } // namespace QmlProfiler

View File

@@ -70,4 +70,4 @@ private:
QmlProfilerStateManagerPrivate *d; QmlProfilerStateManagerPrivate *d;
}; };
} } // namespace QmlProfiler

View File

@@ -227,5 +227,5 @@ void QmlProfilerStateWidget::updateDisplay()
setVisible(false); setVisible(false);
} }
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -25,11 +25,11 @@
#pragma once #pragma once
#include <QWidget>
#include "qmlprofilerstatemanager.h" #include "qmlprofilerstatemanager.h"
#include "qmlprofilermodelmanager.h" #include "qmlprofilermodelmanager.h"
#include <QWidget>
namespace QmlProfiler { namespace QmlProfiler {
namespace Internal { namespace Internal {
@@ -54,5 +54,5 @@ private:
QmlProfilerStateWidgetPrivate *d; QmlProfilerStateWidgetPrivate *d;
}; };
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -32,12 +32,9 @@
#include <QVector> #include <QVector>
#include <QHash> #include <QHash>
#include <QUrl>
#include <QString> #include <QString>
#include <QStack> #include <QStack>
#include <QElapsedTimer> #include <QSet>
#include <QDebug>
namespace QmlProfiler { namespace QmlProfiler {

View File

@@ -29,6 +29,7 @@
#include "qmlprofilernotesmodel.h" #include "qmlprofilernotesmodel.h"
#include "qmlprofilereventtypes.h" #include "qmlprofilereventtypes.h"
#include "qmlprofilereventlocation.h" #include "qmlprofilereventlocation.h"
#include "qmlprofilerconstants.h"
#include <QHash> #include <QHash>
#include <QVector> #include <QVector>

View File

@@ -24,28 +24,23 @@
****************************************************************************/ ****************************************************************************/
#include "qmlprofilerstatisticsview.h" #include "qmlprofilerstatisticsview.h"
#include "qmlprofilerviewmanager.h"
#include "qmlprofilertool.h"
#include <coreplugin/minisplitter.h>
#include <utils/qtcassert.h>
#include <QUrl> #include <QUrl>
#include <QHash> #include <QHash>
#include <QStandardItem> #include <QStandardItem>
#include <QHeaderView> #include <QHeaderView>
#include <QApplication> #include <QApplication>
#include <QClipboard> #include <QClipboard>
#include <QContextMenuEvent> #include <QContextMenuEvent>
#include <QDebug>
#include <coreplugin/minisplitter.h>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
#include "qmlprofilerviewmanager.h"
#include "qmlprofilertool.h"
#include <QMenu> #include <QMenu>
#include <utils/qtcassert.h>
#include <functional> #include <functional>
namespace QmlProfiler { namespace QmlProfiler {

View File

@@ -123,7 +123,6 @@ public:
void setShowExtendedStatistics(bool); void setShowExtendedStatistics(bool);
bool showExtendedStatistics() const; bool showExtendedStatistics() const;
signals: signals:
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
void typeSelected(int typeIndex); void typeSelected(int typeIndex);

View File

@@ -875,7 +875,7 @@ void QmlProfilerTool::serverRecordingChanged()
if (!d->m_profilerConnections->aggregateTraces() || if (!d->m_profilerConnections->aggregateTraces() ||
d->m_profilerModelManager->state() == QmlProfilerModelManager::Done) d->m_profilerModelManager->state() == QmlProfilerModelManager::Done)
clearData(); clearData();
d->m_profilerModelManager->prepareForWriting(); d->m_profilerModelManager->startAcquiring();
} else { } else {
setRecording(false); setRecording(false);
@@ -908,5 +908,5 @@ void QmlProfilerTool::toggleVisibleFeature(QAction *action)
d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature))); d->m_profilerModelManager->visibleFeatures() & (~(1ULL << feature)));
} }
} } // namespace Internal
} } // namespace QmlProfiler

View File

@@ -64,10 +64,6 @@ public:
quint32 flushInterval; quint32 flushInterval;
}; };
} // namespace QmlProfiler
using namespace QmlProfiler;
void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId) void QmlProfilerTraceClientPrivate::sendRecordingStatus(int engineId)
{ {
QmlDebug::QPacket stream(q->connection()->currentDataStreamVersion()); QmlDebug::QPacket stream(q->connection()->currentDataStreamVersion());
@@ -150,7 +146,7 @@ void QmlProfilerTraceClient::setRequestedFeatures(quint64 features)
const QmlDebug::QDebugContextInfo &context) const QmlDebug::QDebugContextInfo &context)
{ {
d->updateFeatures(ProfileDebugMessages); d->updateFeatures(ProfileDebugMessages);
emit debugMessage(type, context.timestamp, text, emit debugMessage(context.timestamp, type, text,
QmlEventLocation(context.file, context.line, 1)); QmlEventLocation(context.file, context.line, 1));
}); });
} else { } else {
@@ -399,3 +395,5 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data)
break; break;
} }
} }
} // namespace QmlProfiler

View File

@@ -41,9 +41,6 @@ class QmlProfilerTraceClient : public QmlDebug::QmlDebugClient
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged) Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
// don't hide by signal
using QObject::event;
public: public:
QmlProfilerTraceClient(QmlDebug::QmlDebugConnection *client, quint64 features); QmlProfilerTraceClient(QmlDebug::QmlDebugConnection *client, quint64 features);
~QmlProfilerTraceClient(); ~QmlProfilerTraceClient();
@@ -60,13 +57,16 @@ public slots:
signals: signals:
void complete(qint64 maximumTime); void complete(qint64 maximumTime);
void traceFinished(qint64 time, const QList<int> &engineIds); void traceFinished(qint64 timestamp, const QList<int> &engineIds);
void traceStarted(qint64 time, const QList<int> &engineIds); void traceStarted(qint64 timestamp, const QList<int> &engineIds);
void rangedEvent(Message, RangeType, int detailType, qint64 startTime, qint64 length, void rangedEvent(Message, RangeType, int detailType, qint64 startTime, qint64 length,
const QString &data, const QmlEventLocation &location, qint64 param1, const QString &data, const QmlEventLocation &location, qint64 param1,
qint64 param2, qint64 param3, qint64 param4, qint64 param5); qint64 param2, qint64 param3, qint64 param4, qint64 param5);
void debugMessage(QtMsgType type, qint64 timestamp, const QString &text,
void debugMessage(qint64 timestamp, QtMsgType type, const QString &text,
const QmlEventLocation &location); const QmlEventLocation &location);
void recordingChanged(bool arg); void recordingChanged(bool arg);
void recordedFeaturesChanged(quint64 features); void recordedFeaturesChanged(quint64 features);
void newEngine(int engineId); void newEngine(int engineId);

View File

@@ -25,7 +25,6 @@
#include "qmlprofilertracefile.h" #include "qmlprofilertracefile.h"
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QIODevice> #include <QIODevice>
@@ -657,12 +656,12 @@ void QmlProfilerFileWriter::save(QIODevice *device)
if (isCanceled()) if (isCanceled())
return; return;
const QmlNote &notes = m_notes[noteIndex]; const QmlNote &note = m_notes[noteIndex];
stream.writeStartElement(_("note")); stream.writeStartElement(_("note"));
stream.writeAttribute(_("startTime"), QString::number(notes.startTime)); stream.writeAttribute(_("startTime"), QString::number(note.startTime));
stream.writeAttribute(_("duration"), QString::number(notes.duration)); stream.writeAttribute(_("duration"), QString::number(note.duration));
stream.writeAttribute(_("eventIndex"), QString::number(notes.typeIndex)); stream.writeAttribute(_("eventIndex"), QString::number(note.typeIndex));
stream.writeCharacters(notes.text); stream.writeCharacters(note.text);
stream.writeEndElement(); // note stream.writeEndElement(); // note
incrementProgress(); incrementProgress();
} }
@@ -692,6 +691,5 @@ bool QmlProfilerFileWriter::isCanceled() const
return m_future && m_future->isCanceled(); return m_future && m_future->isCanceled();
} }
} // namespace Internal } // namespace Internal
} // namespace QmlProfiler } // namespace QmlProfiler