diff --git a/src/libs/qmljsdebugclient/qmljsdebugclient.pro b/src/libs/qmljsdebugclient/qmljsdebugclient.pro index 6e829222358..c1462ecd5e7 100644 --- a/src/libs/qmljsdebugclient/qmljsdebugclient.pro +++ b/src/libs/qmljsdebugclient/qmljsdebugclient.pro @@ -10,3 +10,7 @@ include(qmljsdebugclient-lib.pri) OTHER_FILES += \ qmljsdebugclient.pri \ qmljsdebugclient-lib.pri + +HEADERS += \ + qmlprofilereventlocation.h + diff --git a/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp b/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp index b8d0f6065c8..f60d54a005c 100644 --- a/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp +++ b/src/libs/qmljsdebugclient/qmlprofilereventlist.cpp @@ -61,7 +61,6 @@ const char *const PROFILER_FILE_VERSION = "1.01"; QmlEventData::QmlEventData() { - line = -1; eventType = MaximumQmlEventType; eventId = -1; duration = 0; @@ -87,10 +86,9 @@ QmlEventData &QmlEventData::operator=(const QmlEventData &ref) return *this; displayname = ref.displayname; - filename = ref.filename; + location = ref.location; eventHashStr = ref.eventHashStr; details = ref.details; - line = ref.line; eventType = ref.eventType; duration = ref.duration; calls = ref.calls; @@ -381,7 +379,7 @@ const QV8EventDescriptions& QmlProfilerEventList::getV8Events() const } void QmlProfilerEventList::addRangedEvent(int type, qint64 startTime, qint64 length, - const QStringList &data, const QString &fileName, int line) + const QStringList &data, const QmlJsDebugClient::QmlEventLocation &location) { const QChar colon = QLatin1Char(':'); QString displayName, eventHashStr, details; @@ -403,13 +401,13 @@ void QmlProfilerEventList::addRangedEvent(int type, qint64 startTime, qint64 len } // generate hash - if (fileName.isEmpty()) { + if (location.filename.isEmpty()) { displayName = tr(""); eventHashStr = QString("--:%1:%2").arg(QString::number(type), details); } else { - const QString filePath = QUrl(fileName).path(); - displayName = filePath.mid(filePath.lastIndexOf(QChar('/')) + 1) + colon + QString::number(line); - eventHashStr = QString("%1:%2:%3:%4").arg(fileName, QString::number(line), QString::number(type), details); + const QString filePath = QUrl(location.filename).path(); + displayName = filePath.mid(filePath.lastIndexOf(QChar('/')) + 1) + colon + QString::number(location.line); + eventHashStr = QString("%1:%2:%3:%4").arg(location.filename, QString::number(location.line), QString::number(location.column), QString::number(type)); } QmlEventData *newEvent; @@ -418,9 +416,8 @@ void QmlProfilerEventList::addRangedEvent(int type, qint64 startTime, qint64 len } else { newEvent = new QmlEventData; newEvent->displayname = displayName; - newEvent->filename = fileName; + newEvent->location = location; newEvent->eventHashStr = eventHashStr; - newEvent->line = line; newEvent->eventType = (QmlJsDebugClient::QmlEventType)type; newEvent->details = details; d->m_eventDescriptions.insert(eventHashStr, newEvent); @@ -525,9 +522,7 @@ void QmlProfilerEventList::addFrameEvent(qint64 time, int framerate, int animati } else { newEvent = new QmlEventData; newEvent->displayname = displayName; - newEvent->filename = QString(); newEvent->eventHashStr = eventHashStr; - newEvent->line = -1; newEvent->eventType = QmlJsDebugClient::Painting; newEvent->details = details; d->m_eventDescriptions.insert(eventHashStr, newEvent); @@ -630,10 +625,9 @@ void QmlProfilerEventList::complete() void QmlProfilerEventList::QmlProfilerEventListPrivate::clearQmlRootEvent() { m_qmlRootEvent.displayname = m_rootEventName; - m_qmlRootEvent.filename = QString(); + m_qmlRootEvent.location = QmlEventLocation(); m_qmlRootEvent.eventHashStr = m_rootEventName; m_qmlRootEvent.details = m_rootEventDesc; - m_qmlRootEvent.line = 01; m_qmlRootEvent.eventType = QmlJsDebugClient::Binding; m_qmlRootEvent.duration = 0; m_qmlRootEvent.calls = 0; @@ -1198,9 +1192,10 @@ bool QmlProfilerEventList::save(const QString &filename) stream.writeAttribute("index", QString::number(d->m_eventDescriptions.keys().indexOf(eventData->eventHashStr))); stream.writeTextElement("displayname", eventData->displayname); stream.writeTextElement("type", qmlEventType(eventData->eventType)); - if (!eventData->filename.isEmpty()) { - stream.writeTextElement("filename", eventData->filename); - stream.writeTextElement("line", QString::number(eventData->line)); + if (!eventData->location.filename.isEmpty()) { + stream.writeTextElement("filename", eventData->location.filename); + stream.writeTextElement("line", QString::number(eventData->location.line)); + stream.writeTextElement("column", QString::number(eventData->location.column)); } stream.writeTextElement("details", eventData->details); stream.writeEndElement(); @@ -1415,13 +1410,16 @@ void QmlProfilerEventList::load() break; } if (elementName == "filename") { - currentEvent->filename = readData; + currentEvent->location.filename = readData; break; } if (elementName == "line") { - currentEvent->line = readData.toInt(); + currentEvent->location.line = readData.toInt(); break; } + if (elementName == "column") { + currentEvent->location.column = readData.toInt(); + } if (elementName == "details") { currentEvent->details = readData; break; @@ -1620,12 +1618,17 @@ int QmlProfilerEventList::getNestingDepth(int index) const QString QmlProfilerEventList::getFilename(int index) const { - return d->m_startTimeSortedList[index].description->filename; + return d->m_startTimeSortedList[index].description->location.filename; } int QmlProfilerEventList::getLine(int index) const { - return d->m_startTimeSortedList[index].description->line; + return d->m_startTimeSortedList[index].description->location.line; +} + +int QmlProfilerEventList::getColumn(int index) const +{ + return d->m_startTimeSortedList[index].description->location.column; } QString QmlProfilerEventList::getDetails(int index) const diff --git a/src/libs/qmljsdebugclient/qmlprofilereventlist.h b/src/libs/qmljsdebugclient/qmlprofilereventlist.h index a9fc0454b9c..0856a72414a 100644 --- a/src/libs/qmljsdebugclient/qmlprofilereventlist.h +++ b/src/libs/qmljsdebugclient/qmlprofilereventlist.h @@ -34,6 +34,7 @@ #define QMLPROFILEREVENTLIST_H #include "qmlprofilereventtypes.h" +#include "qmlprofilereventlocation.h" #include "qmljsdebugclient_global.h" #include @@ -50,10 +51,9 @@ struct QMLJSDEBUGCLIENT_EXPORT QmlEventData ~QmlEventData(); QString displayname; - QString filename; QString eventHashStr; QString details; - int line; + QmlEventLocation location; QmlJsDebugClient::QmlEventType eventType; QHash parentHash; QHash childrenHash; @@ -139,6 +139,7 @@ public: Q_INVOKABLE int getNestingDepth(int index) const; Q_INVOKABLE QString getFilename(int index) const; Q_INVOKABLE int getLine(int index) const; + Q_INVOKABLE int getColumn(int index) const; Q_INVOKABLE QString getDetails(int index) const; Q_INVOKABLE int getEventId(int index) const; Q_INVOKABLE int getFramerate(int index) const; @@ -173,7 +174,7 @@ signals: public slots: void clear(); void addRangedEvent(int type, qint64 startTime, qint64 length, - const QStringList &data, const QString &fileName, int line); + const QStringList &data, const QmlJsDebugClient::QmlEventLocation &location); void complete(); void addV8Event(int depth,const QString &function,const QString &filename, int lineNumber, double totalTime, double selfTime); diff --git a/src/libs/qmljsdebugclient/qmlprofilereventlocation.h b/src/libs/qmljsdebugclient/qmlprofilereventlocation.h new file mode 100644 index 00000000000..e54077304d7 --- /dev/null +++ b/src/libs/qmljsdebugclient/qmlprofilereventlocation.h @@ -0,0 +1,19 @@ +#ifndef QMLPROFILEREVENTLOCATION_H +#define QMLPROFILEREVENTLOCATION_H + +#include "qmljsdebugclient_global.h" + +namespace QmlJsDebugClient { + +struct QMLJSDEBUGCLIENT_EXPORT QmlEventLocation +{ + QmlEventLocation() : line(-1),column(-1) {} + QmlEventLocation(const QString &file, int lineNumber, int columnNumber) : filename(file), line(lineNumber), column(columnNumber) {} + QString filename; + int line; + int column; +}; + +} + +#endif // QMLPROFILEREVENTLOCATION_H diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp index 675a14ab64f..5928f2b7a79 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp @@ -51,7 +51,7 @@ public: qint64 inProgressRanges; QStack rangeStartTimes[MaximumQmlEventType]; QStack rangeDatas[MaximumQmlEventType]; - QStack rangeLocations[MaximumQmlEventType]; + QStack rangeLocations[MaximumQmlEventType]; int rangeCount[MaximumQmlEventType]; qint64 maximumTime; bool recording; @@ -191,10 +191,14 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) } else if (messageType == RangeLocation) { QString fileName; int line; + int column = -1; stream >> fileName >> line; + if (!stream.atEnd()) + stream >> column; + if (d->rangeCount[range] > 0) { - d->rangeLocations[range].push(Location(fileName, line)); + d->rangeLocations[range].push(QmlEventLocation(fileName, line, column)); } } else { if (d->rangeCount[range] > 0) { @@ -204,10 +208,10 @@ void QmlProfilerTraceClient::messageReceived(const QByteArray &data) d->maximumTime = qMax(time, d->maximumTime); QStringList data = d->rangeDatas[range].count() ? d->rangeDatas[range].pop() : QStringList(); - Location location = d->rangeLocations[range].count() ? d->rangeLocations[range].pop() : Location(); + QmlEventLocation location = d->rangeLocations[range].count() ? d->rangeLocations[range].pop() : QmlEventLocation(); qint64 startTime = d->rangeStartTimes[range].pop(); - emit this->range((QmlEventType)range, startTime, time - startTime, data, location.fileName, location.line); + emit this->range((QmlEventType)range, startTime, time - startTime, data, location); if (d->rangeCount[range] == 0) { int count = d->rangeDatas[range].count() + d->rangeStartTimes[range].count() + diff --git a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h index 56b80606b0d..a05300822c1 100644 --- a/src/libs/qmljsdebugclient/qmlprofilertraceclient.h +++ b/src/libs/qmljsdebugclient/qmlprofilertraceclient.h @@ -35,6 +35,7 @@ #include "qdeclarativedebugclient.h" #include "qmlprofilereventtypes.h" +#include "qmlprofilereventlocation.h" #include "qmljsdebugclient_global.h" #include @@ -42,14 +43,6 @@ namespace QmlJsDebugClient { -struct QMLJSDEBUGCLIENT_EXPORT Location -{ - Location() : line(-1) {} - Location(const QString &file, int lineNumber) : fileName(file), line(lineNumber) {} - QString fileName; - int line; -}; - class QMLJSDEBUGCLIENT_EXPORT QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient { Q_OBJECT @@ -100,7 +93,7 @@ signals: void traceFinished( qint64 time ); void traceStarted( qint64 time ); void range(int type, qint64 startTime, qint64 length, - const QStringList &data, const QString &fileName, int line); + const QStringList &data, const QmlJsDebugClient::QmlEventLocation &location); void frame(qint64 time, int frameRate, int animationCount); void recordingChanged(bool arg); diff --git a/src/plugins/qmlprofiler/qml/MainView.qml b/src/plugins/qmlprofiler/qml/MainView.qml index 06e60ccde99..38ba82bef4b 100644 --- a/src/plugins/qmlprofiler/qml/MainView.qml +++ b/src/plugins/qmlprofiler/qml/MainView.qml @@ -62,6 +62,7 @@ Rectangle { signal updateCursorPosition property string fileName: "" property int lineNumber: -1 + property int columnNumber: 0 property real elapsedTime signal updateTimer @@ -131,9 +132,10 @@ Rectangle { } // ***** functions - function gotoSourceLocation(file,line) { + function gotoSourceLocation(file,line,column) { root.fileName = file; root.lineNumber = line; + root.columnNumber = column; root.updateCursorPosition(); } @@ -265,6 +267,7 @@ Rectangle { rangeDetails.type = ""; rangeDetails.file = ""; rangeDetails.line = -1; + rangeDetails.column = 0; } function selectNextWithId( eventId ) @@ -418,6 +421,7 @@ Rectangle { rangeDetails.label = qmlEventList.getDetails(selectedItem); rangeDetails.file = qmlEventList.getFilename(selectedItem); rangeDetails.line = qmlEventList.getLine(selectedItem); + rangeDetails.column = qmlEventList.getColumn(selectedItem); rangeDetails.type = root.names[qmlEventList.getType(selectedItem)]; rangeDetails.visible = true; @@ -441,7 +445,7 @@ Rectangle { onItemPressed: { if (pressedItem !== -1) { - root.gotoSourceLocation(qmlEventList.getFilename(pressedItem), qmlEventList.getLine(pressedItem)); + root.gotoSourceLocation(qmlEventList.getFilename(pressedItem), qmlEventList.getLine(pressedItem), qmlEventList.getColumn(pressedItem)); } } diff --git a/src/plugins/qmlprofiler/qml/RangeDetails.qml b/src/plugins/qmlprofiler/qml/RangeDetails.qml index 9e3d574a789..655e243c336 100644 --- a/src/plugins/qmlprofiler/qml/RangeDetails.qml +++ b/src/plugins/qmlprofiler/qml/RangeDetails.qml @@ -41,6 +41,7 @@ Item { property string type property string file property int line + property int column property bool locked: view.selectionLocked @@ -155,7 +156,7 @@ Item { height: col.height + 30 drag.target: parent onClicked: { - root.gotoSourceLocation(file, line); + root.gotoSourceLocation(file, line, column); root.recenterOnItem(view.selectedItem); } } diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.cpp b/src/plugins/qmlprofiler/qmlprofilereventview.cpp index 491b6b62a89..abd1ab65f6a 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventview.cpp +++ b/src/plugins/qmlprofiler/qmlprofilereventview.cpp @@ -86,7 +86,7 @@ QmlProfilerEventsWidget::QmlProfilerEventsWidget(QmlJsDebugClient::QmlProfilerEv m_eventTree = new QmlProfilerEventsMainView(model, this); m_eventTree->setViewType(QmlProfilerEventsMainView::EventsView); - connect(m_eventTree, SIGNAL(gotoSourceLocation(QString,int)), this, SIGNAL(gotoSourceLocation(QString,int))); + connect(m_eventTree, SIGNAL(gotoSourceLocation(QString,int,int)), this, SIGNAL(gotoSourceLocation(QString,int,int))); connect(m_eventTree, SIGNAL(showEventInTimeline(int)), this, SIGNAL(showEventInTimeline(int))); m_eventChildren = new QmlProfilerEventsParentsAndChildrenView(model, QmlProfilerEventsParentsAndChildrenView::ChildrenView, this); @@ -181,8 +181,12 @@ void QmlProfilerEventsWidget::updateSelectedEvent(int eventId) const m_eventTree->selectEvent(eventId); } -void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line) +void QmlProfilerEventsWidget::selectBySourceLocation(const QString &filename, int line, int column) { + // This slot is used to connect the javascript pane with the qml events pane + // Our javascript trace data does not store column information + // thus we ignore it here + Q_UNUSED(column); m_eventTree->selectEventByLocation(filename, line); } @@ -453,8 +457,9 @@ void QmlProfilerEventsMainView::QmlProfilerEventsMainViewPrivate::buildModelFrom // metadata newRow.at(0)->setData(QVariant(binding->eventHashStr),EventHashStrRole); - newRow.at(0)->setData(QVariant(binding->filename),FilenameRole); - newRow.at(0)->setData(QVariant(binding->line),LineRole); + newRow.at(0)->setData(QVariant(binding->location.filename),FilenameRole); + newRow.at(0)->setData(QVariant(binding->location.line),LineRole); + newRow.at(0)->setData(QVariant(binding->location.column),ColumnRole); newRow.at(0)->setData(QVariant(binding->eventId),EventIdRole); // append @@ -507,6 +512,7 @@ void QmlProfilerEventsMainView::QmlProfilerEventsMainViewPrivate::buildV8ModelFr newRow.at(0)->setData(QString("%1:%2").arg(v8event->filename, QString::number(v8event->line)), EventHashStrRole); newRow.at(0)->setData(QVariant(v8event->filename), FilenameRole); newRow.at(0)->setData(QVariant(v8event->line), LineRole); + newRow.at(0)->setData(QVariant(0),ColumnRole); // v8 events have no column info newRow.at(0)->setData(QVariant(v8event->eventId), EventIdRole); // append @@ -569,9 +575,10 @@ void QmlProfilerEventsMainView::jumpToItem(const QModelIndex &index) // show in editor int line = infoItem->data(LineRole).toInt(); + int column = infoItem->data(ColumnRole).toInt(); QString fileName = infoItem->data(FilenameRole).toString(); if (line!=-1 && !fileName.isEmpty()) - emit gotoSourceLocation(fileName, line); + emit gotoSourceLocation(fileName, line, column); // show in callers/callees subwindow emit eventSelected(infoItem->data(EventIdRole).toInt()); diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.h b/src/plugins/qmlprofiler/qmlprofilereventview.h index 93ae9479fb5..ccecfe776f8 100644 --- a/src/plugins/qmlprofiler/qmlprofilereventview.h +++ b/src/plugins/qmlprofiler/qmlprofilereventview.h @@ -51,7 +51,8 @@ enum ItemRole { EventHashStrRole = Qt::UserRole+1, FilenameRole = Qt::UserRole+2, LineRole = Qt::UserRole+3, - EventIdRole = Qt::UserRole+4 + ColumnRole = Qt::UserRole+4, + EventIdRole = Qt::UserRole+5 }; class QmlProfilerEventsWidget : public QWidget @@ -73,13 +74,13 @@ public: bool hasGlobalStats() const; signals: - void gotoSourceLocation(const QString &fileName, int lineNumber); + void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void contextMenuRequested(const QPoint &position); void showEventInTimeline(int eventId); public slots: void updateSelectedEvent(int eventId) const; - void selectBySourceLocation(const QString &filename, int line); + void selectBySourceLocation(const QString &filename, int line, int column); protected: void contextMenuEvent(QContextMenuEvent *ev); @@ -142,7 +143,7 @@ public: int selectedEventId() const; signals: - void gotoSourceLocation(const QString &fileName, int lineNumber); + void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber); void eventSelected(int eventId); void showEventInTimeline(int eventId); diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 5f22e8765eb..614d26ced0d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -443,7 +443,7 @@ QWidget *QmlProfilerTool::createWidgets() d->m_traceWindow = new TraceWindow(mw); d->m_traceWindow->reset(d->m_client); - connect(d->m_traceWindow, SIGNAL(gotoSourceLocation(QString,int)),this, SLOT(gotoSourceLocation(QString,int))); + connect(d->m_traceWindow, SIGNAL(gotoSourceLocation(QString,int,int)),this, SLOT(gotoSourceLocation(QString,int,int))); connect(d->m_traceWindow, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(d->m_traceWindow->getEventList(), SIGNAL(error(QString)), this, SLOT(showErrorDialog(QString))); connect(d->m_traceWindow->getEventList(), SIGNAL(dataReady()), this, SLOT(showSaveOption())); @@ -451,18 +451,18 @@ QWidget *QmlProfilerTool::createWidgets() connect(d->m_traceWindow, SIGNAL(profilerStateChanged(bool,bool)), this, SLOT(profilerStateChanged(bool,bool))); d->m_eventsView = new QmlProfilerEventsWidget(d->m_traceWindow->getEventList(), mw); - connect(d->m_eventsView, SIGNAL(gotoSourceLocation(QString,int)), this, SLOT(gotoSourceLocation(QString,int))); + connect(d->m_eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SLOT(gotoSourceLocation(QString,int,int))); connect(d->m_eventsView, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(d->m_eventsView, SIGNAL(showEventInTimeline(int)), d->m_traceWindow, SLOT(selectNextEvent(int))); connect(d->m_traceWindow, SIGNAL(selectedEventIdChanged(int)), d->m_eventsView, SLOT(updateSelectedEvent(int))); d->m_v8profilerView = new QmlProfilerEventsWidget(d->m_traceWindow->getEventList(), mw); d->m_v8profilerView->switchToV8View(); - connect(d->m_v8profilerView, SIGNAL(gotoSourceLocation(QString,int)), this, SLOT(gotoSourceLocation(QString,int))); + connect(d->m_v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), this, SLOT(gotoSourceLocation(QString,int,int))); connect(d->m_v8profilerView, SIGNAL(contextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); - connect(d->m_v8profilerView, SIGNAL(gotoSourceLocation(QString,int)), d->m_eventsView, SLOT(selectBySourceLocation(QString,int))); - connect(d->m_eventsView, SIGNAL(gotoSourceLocation(QString,int)), d->m_v8profilerView, SLOT(selectBySourceLocation(QString,int))); + connect(d->m_v8profilerView, SIGNAL(gotoSourceLocation(QString,int,int)), d->m_eventsView, SLOT(selectBySourceLocation(QString,int,int))); + connect(d->m_eventsView, SIGNAL(gotoSourceLocation(QString,int,int)), d->m_v8profilerView, SLOT(selectBySourceLocation(QString,int,int))); QDockWidget *eventsDock = AnalyzerManager::createDockWidget (this, tr("Events"), d->m_eventsView, Qt::BottomDockWidgetArea); @@ -602,7 +602,7 @@ void QmlProfilerTool::setAppIsStopped() updateTimers(); } -void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber) +void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber) { if (lineNumber < 0 || fileUrl.isEmpty()) return; @@ -619,7 +619,7 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber) if (textEditor) { editorManager->addCurrentPositionToNavigationHistory(); - textEditor->gotoLine(lineNumber); + textEditor->gotoLine(lineNumber, columnNumber); textEditor->widget()->setFocus(); } } diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index 552c0b0e782..88560e04fa1 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -83,7 +83,7 @@ public slots: void setAppIsRunning(); void setAppIsStopped(); - void gotoSourceLocation(const QString &fileUrl, int lineNumber); + void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber); void updateTimers(); void profilerStateChanged(bool qmlActive, bool v8active); diff --git a/src/plugins/qmlprofiler/tracewindow.cpp b/src/plugins/qmlprofiler/tracewindow.cpp index d114cb9ca8f..b62a4634ab6 100644 --- a/src/plugins/qmlprofiler/tracewindow.cpp +++ b/src/plugins/qmlprofiler/tracewindow.cpp @@ -134,7 +134,7 @@ TraceWindow::TraceWindow(QWidget *parent) setLayout(groupLayout); m_eventList = new QmlProfilerEventList(this); - connect(this,SIGNAL(range(int,qint64,qint64,QStringList,QString,int)), m_eventList, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QString,int))); + connect(this,SIGNAL(range(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation)), m_eventList, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation))); connect(this, SIGNAL(traceFinished(qint64)), m_eventList, SLOT(setTraceEndTime(qint64))); connect(this, SIGNAL(traceStarted(qint64)), m_eventList, SLOT(setTraceStartTime(qint64))); connect(this, SIGNAL(frameEvent(qint64,int,int)), m_eventList, SLOT(addFrameEvent(qint64,int,int))); @@ -309,8 +309,8 @@ void TraceWindow::connectClientSignals() { if (m_plugin) { connect(m_plugin.data(), SIGNAL(complete()), this, SLOT(qmlComplete())); - connect(m_plugin.data(), SIGNAL(range(int,qint64,qint64,QStringList,QString,int)), - this, SIGNAL(range(int,qint64,qint64,QStringList,QString,int))); + connect(m_plugin.data(), SIGNAL(range(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation)), + this, SIGNAL(range(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation))); connect(m_plugin.data(), SIGNAL(traceFinished(qint64)), this, SIGNAL(traceFinished(qint64))); connect(m_plugin.data(), SIGNAL(traceStarted(qint64)), this, SIGNAL(traceStarted(qint64))); connect(m_plugin.data(), SIGNAL(frame(qint64,int,int)), this, SIGNAL(frameEvent(qint64,int,int))); @@ -329,8 +329,8 @@ void TraceWindow::disconnectClientSignals() { if (m_plugin) { disconnect(m_plugin.data(), SIGNAL(complete()), this, SLOT(qmlComplete())); - disconnect(m_plugin.data(), SIGNAL(range(int,qint64,qint64,QStringList,QString,int)), - this, SIGNAL(range(int,qint64,qint64,QStringList,QString,int))); + disconnect(m_plugin.data(), SIGNAL(range(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation)), + this, SIGNAL(range(int,qint64,qint64,QStringList,QmlJsDebugClient::QmlEventLocation))); disconnect(m_plugin.data(), SIGNAL(traceFinished(qint64)), this, SIGNAL(traceFinished(qint64))); disconnect(m_plugin.data(), SIGNAL(traceStarted(qint64)), this, SIGNAL(traceStarted(qint64))); disconnect(m_plugin.data(), SIGNAL(enabledChanged()), this, SLOT(updateProfilerState())); @@ -362,7 +362,8 @@ void TraceWindow::contextMenuEvent(QContextMenuEvent *ev) void TraceWindow::updateCursorPosition() { emit gotoSourceLocation(m_mainView->rootObject()->property("fileName").toString(), - m_mainView->rootObject()->property("lineNumber").toInt()); + m_mainView->rootObject()->property("lineNumber").toInt(), + m_mainView->rootObject()->property("columnNumber").toInt()); } void TraceWindow::updateTimer() diff --git a/src/plugins/qmlprofiler/tracewindow.h b/src/plugins/qmlprofiler/tracewindow.h index ac3b8d6a073..4d1311998fa 100644 --- a/src/plugins/qmlprofiler/tracewindow.h +++ b/src/plugins/qmlprofiler/tracewindow.h @@ -131,8 +131,8 @@ public slots: signals: void viewUpdated(); void profilerStateChanged(bool qmlActive, bool v8active); - void gotoSourceLocation(const QString &fileUrl, int lineNumber); - void range(int type, qint64 startTime, qint64 length, const QStringList &data, const QString &fileName, int line); + void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columNumber); + void range(int type, qint64 startTime, qint64 length, const QStringList &data, const QmlJsDebugClient::QmlEventLocation &location); void v8range(int depth,const QString &function,const QString &filename, int lineNumber, double totalTime, double selfTime); void traceFinished(qint64); diff --git a/src/tools/qmlprofilertool/qmlprofilerapplication.cpp b/src/tools/qmlprofilertool/qmlprofilerapplication.cpp index 96b1c095964..d25b3c1e29a 100644 --- a/src/tools/qmlprofilertool/qmlprofilerapplication.cpp +++ b/src/tools/qmlprofilertool/qmlprofilerapplication.cpp @@ -96,7 +96,7 @@ QmlProfilerApplication::QmlProfilerApplication(int &argc, char **argv) : connect(&m_qmlProfilerClient, SIGNAL(enabled()), this, SLOT(traceClientEnabled())); connect(&m_qmlProfilerClient, SIGNAL(recordingChanged(bool)), this, SLOT(recordingChanged())); - connect(&m_qmlProfilerClient, SIGNAL(range(int,qint64,qint64,QStringList,QString,int)), &m_eventList, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QString,int))); + connect(&m_qmlProfilerClient, SIGNAL(range(int,qint64,qint64,QStringList,QString,int,int)), &m_eventList, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QString,int,int))); connect(&m_qmlProfilerClient, SIGNAL(complete()), this, SLOT(qmlComplete())); connect(&m_v8profilerClient, SIGNAL(enabled()), this, SLOT(profilerClientEnabled()));