]> git.cworth.org Git - apitrace/blobdiff - gui/mainwindow.cpp
Implement jump to.
[apitrace] / gui / mainwindow.cpp
index 7d4cab8f7e064b5d9d6baa4476b2cdb19a345782..7644e0017f3abaf7ef438cae75d1ebd82006f589 100644 (file)
@@ -698,6 +698,8 @@ void MainWindow::initConnections()
             this, SLOT(slotFoundFrameStart(ApiTraceFrame*)));
     connect(m_trace, SIGNAL(foundFrameEnd(ApiTraceFrame*)),
             this, SLOT(slotFoundFrameEnd(ApiTraceFrame*)));
+    connect(m_trace, SIGNAL(foundCallIndex(ApiTraceCall*)),
+            this, SLOT(slotJumpToResult(ApiTraceCall*)));
 
     connect(m_retracer, SIGNAL(finished(const QString&)),
             this, SLOT(replayFinished(const QString&)));
@@ -808,10 +810,7 @@ void MainWindow::slotGoTo()
 
 void MainWindow::slotJumpTo(int callNum)
 {
-    QModelIndex index = m_proxyModel->callIndex(callNum);
-    if (index.isValid()) {
-        m_ui.callView->setCurrentIndex(index);
-    }
+    m_trace->findCallIndex(callNum);
 }
 
 void MainWindow::createdTrace(const QString &path)
@@ -1197,4 +1196,12 @@ void MainWindow::slotFoundFrameEnd(ApiTraceFrame *frame)
     } while (itr != calls.constBegin());
 }
 
+void MainWindow::slotJumpToResult(ApiTraceCall *call)
+{
+    QModelIndex index = m_proxyModel->indexForCall(call);
+    if (index.isValid()) {
+        m_ui.callView->setCurrentIndex(index);
+    }
+}
+
 #include "mainwindow.moc"