[MassifVisualizer] [Bug 256273] massif-visualizer crashes due to bad kgraphviewerpart library

Milian Wolff mail at milianw.de
Sun Nov 7 13:33:26 CET 2010


https://bugs.kde.org/show_bug.cgi?id=256273


Milian Wolff <mail at milianw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Milian Wolff <mail milianw de>  2010-11-07 13:33:25 ---
commit 840d06969169d4f8cdfc7886b6468ccf4eeb2a90
branch master
Author: Milian Wolff <mail at milianw.de>
Date:   Sun Nov 7 13:33:50 2010 +0100

    guard against badly loaded kgraphviewer libs

    BUG: 256273

diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp
index 78c1e9b..7c73c23 100644
--- a/app/mainwindow.cpp
+++ b/app/mainwindow.cpp
@@ -438,7 +438,9 @@ void MainWindow::treeSelectionChanged(const QModelIndex&
now, const QModelIndex&

     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif

     m_changingSelections = false;
@@ -468,7 +470,9 @@ void MainWindow::detailedItemClicked(const QModelIndex&
idx)

     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif

     m_changingSelections = false;
@@ -498,7 +502,9 @@ void MainWindow::totalItemClicked(const QModelIndex& idx_)

     m_chart->update();
 #ifdef HAVE_KGRAPHVIEWER
-    getDotGraph(item);
+    if (m_graphViewer) {
+        getDotGraph(item);
+    }
 #endif

     m_changingSelections = false;
@@ -601,6 +607,8 @@ void MainWindow::slotTabChanged(int index)

 void MainWindow::getDotGraph(QPair<TreeLeafItem*, SnapshotItem*> item)
 {
+    Q_ASSERT(m_graphViewer);
+
     kDebug() << "new dot graph requested" << item;
     if (m_dotGenerator) {
         kDebug() << "existing generator is running:" <<
m_dotGenerator->isRunning();
@@ -639,6 +647,8 @@ void MainWindow::showDotGraph()

 void MainWindow::slotGraphLoaded()
 {
+    Q_ASSERT(m_graphViewer);
+
     if (!m_dotGenerator) {
         return;
     }
@@ -650,16 +660,22 @@ void MainWindow::slotGraphLoaded()

 void MainWindow::zoomIn()
 {
+    Q_ASSERT(m_graphViewer);
+
     m_graphViewer->zoomIn();
 }

 void MainWindow::zoomOut()
 {
+    Q_ASSERT(m_graphViewer);
+
     m_graphViewer->zoomOut();
 }

 void MainWindow::focusExpensiveGraphNode()
 {
+    Q_ASSERT(m_graphViewer);
+
    
m_graphViewer->centerOnNode(m_dotGenerator->mostCostIntensiveGraphvizId());
 }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Massif-visualizer mailing list