glvdebug: Misc clean up.
authorPeter Lohrmann <peterl@valvesoftware.com>
Tue, 13 Jan 2015 23:16:01 +0000 (15:16 -0800)
committerJon Ashburn <jon@lunarg.com>
Thu, 12 Feb 2015 15:08:25 +0000 (08:08 -0700)
* Change the way the item is selected from the tree view to a use a pre-existing method.
* Change the way the wait cursor is displayed when opening a trace file.

tools/glave/src/glvdebug/glvdebug.cpp

index e118a16..a04776c 100755 (executable)
@@ -192,8 +192,7 @@ void glvdebug::select_call_at_packet_index(unsigned long long packetIndex)
         QModelIndexList matches = m_pTraceFileModel->match(start, Qt::DisplayRole, QVariant(packetIndex), 1);\r
         if (matches.count() > 0)\r
         {\r
-            ui->treeView->setCurrentIndex(matches[0]);\r
-            ui->treeView->setFocus();\r
+            selectApicallModelIndex(matches[0], true, true);\r
         }\r
 \r
         if (m_pTimeline != NULL)\r
@@ -453,8 +452,7 @@ bool glvdebug::open_trace_file(const std::string &filename)
     glvdebug_output_message("Opening trace file...");\r
     glvdebug_output_message(filename.c_str());\r
 \r
-    QCursor origCursor = this->cursor();\r
-    this->setCursor(Qt::WaitCursor);\r
+    QApplication::setOverrideCursor(Qt::WaitCursor);\r
 \r
     // open trace file and read in header\r
     memset(&m_traceFileInfo, 0, sizeof(glvdebug_trace_file_info));\r
@@ -566,7 +564,7 @@ bool glvdebug::open_trace_file(const std::string &filename)
         glvdebug_settings_updated();\r
     }\r
 \r
-    this->setCursor(origCursor);\r
+    QApplication::restoreOverrideCursor();\r
 \r
     return bOpened;\r
 }\r
@@ -670,7 +668,7 @@ void glvdebug::selectApicallModelIndex(QModelIndex index, bool scrollTo, bool se
     if (select)\r
     {\r
         ui->treeView->setCurrentIndex(index);\r
-    }\r
+    }   \r
 }\r
 \r
 float glvdebug::u64ToFloat(uint64_t value)\r