[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdereview/rocs/src/Interface
From:       Tomaz Martins dos Santos Canabrava <tomaz.canabrava () gmail ! com>
Date:       2009-11-07 2:38:01
Message-ID: 1257561481.936735.25520.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1045998 by tcanabrava:

fix for a crash triggered by my updateGraph algorithm. the code that's crashing is \
commented out. call for help.

 M  +8 -2      GraphScene.cpp  
 M  +1 -1      MainWindow.cpp  


--- trunk/kdereview/rocs/src/Interface/GraphScene.cpp #1045997:1045998
@@ -215,6 +215,10 @@
 }
 
 void GraphScene::updateGraph(Graph *g) {
+/* This updates a particular graph by removing all nodes and edges associated to it
+   and redrawn it on screen. now updateDocument is calling clearGraph() that will do \
the same thing, but for *all* graphs at the same time, but actually working. */ +
+/*
     QList<QGraphicsItem*> items = _hashGraphs.values(g);
     kDebug() << "Quantity of items to be removed." << items.size();
     foreach(QGraphicsItem *i, items) {
@@ -223,7 +227,8 @@
     }
     kDebug() << "Items removed";
 
-    _hashGraphs.remove(g);
+    _hashGraphs.remove(g); */
+
     kDebug() << "Removed Graph from the hash";
 
     kDebug() << "Creating" << g->nodes().size() << "nodes";
@@ -244,7 +249,8 @@
         kDebug() << "Graph Document is null. Please hit the developer.";
         return;
     }
-
+    
+    clearGraph();
     kDebug() << "Graph Document Size: " << _graphDocument->size();
     int size = _graphDocument->size();
 
--- trunk/kdereview/rocs/src/Interface/MainWindow.cpp #1045997:1045998
@@ -287,7 +287,7 @@
   _graphVisualEditor->scene()->setActiveGraphDocument(0);
   delete _activeGraphDocument;
   setActiveGraphDocument(new GraphDocument("Untitled", 800,600));
-  if (name == QString()){
+  if (name.isEmpty()){
     _activeGraphDocument->addGraph(i18n("Untitled0"));
   }
   else{


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic