]> git.cworth.org Git - apitrace/commitdiff
Go to the selected error.
authorZack Rusin <zack@kde.org>
Wed, 20 Apr 2011 03:43:06 +0000 (23:43 -0400)
committerZack Rusin <zack@kde.org>
Wed, 20 Apr 2011 03:43:06 +0000 (23:43 -0400)
gui/mainwindow.cpp
gui/mainwindow.h
gui/ui/mainwindow.ui

index c9489f8bcd074d4bb3861380f5308a326bd08194..4360f19fa34a8c00ffd54e484e2a49ae1a23ea8b 100644 (file)
@@ -734,6 +734,8 @@ void MainWindow::initConnections()
             m_ui.actionShowErrorsDock, SLOT(setChecked(bool)));
     connect(m_ui.actionShowErrorsDock, SIGNAL(triggered(bool)),
             m_ui.errorsDock, SLOT(setVisible(bool)));
+    connect(m_ui.errorsTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
+            this, SLOT(slotErrorSelected(QTreeWidgetItem*)));
 }
 
 void MainWindow::replayStateFound(const ApiTraceState &state)
@@ -1041,4 +1043,19 @@ void MainWindow::slotRetraceErrors(const QList<RetraceError> &errors)
     }
 }
 
+void MainWindow::slotErrorSelected(QTreeWidgetItem *current)
+{
+    if (current) {
+        ApiTraceCall *call =
+            current->data(0, Qt::UserRole).value<ApiTraceCall*>();
+        Q_ASSERT(call);
+        QModelIndex index = m_proxyModel->indexForCall(call);
+        if (index.isValid()) {
+            m_ui.callView->setCurrentIndex(index);
+        } else {
+            statusBar()->showMessage(tr("Call has been filtered out."));
+        }
+    }
+}
+
 #include "mainwindow.moc"
index 400f7a31504dd9b79a7b2d3bfabc62be7c8664c4..74ffeb3e3b26fdbbdff67ffee1e2c12c7fd6fe29 100644 (file)
@@ -18,6 +18,7 @@ class ImageViewer;
 class JumpWidget;
 class QModelIndex;
 class QProgressBar;
+class QTreeWidgetItem;
 class QUrl;
 class RetraceError;
 class Retracer;
@@ -68,6 +69,7 @@ private slots:
     void slotGoFrameEnd();
     void slotTraceChanged(ApiTraceCall *call);
     void slotRetraceErrors(const QList<RetraceError> &errors);
+    void slotErrorSelected(QTreeWidgetItem *current);
 
 private:
     void initObjects();
index 544097e955946002b625143196a1e594260cdbfb..1bda2bd7d0a28cdde205ad8b6e8b0d9972141db3 100644 (file)
        </column>
        <column>
         <property name="text">
-         <string>Name</string>
+         <string>Type</string>
         </property>
        </column>
        <column>