gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog gui/gtk.cpp


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog gui/gtk.cpp
Date: Fri, 04 Apr 2008 10:39:09 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/04/04 10:39:09

Modified files:
        .              : ChangeLog 
        gui            : gtk.cpp 

Log message:
        (makeTreeModel): fix model constructor when
        jumping back to ancestor nodes at depth !+ current-1.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6176&r2=1.6177
http://cvs.savannah.gnu.org/viewcvs/gnash/gui/gtk.cpp?cvsroot=gnash&r1=1.160&r2=1.161

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6176
retrieving revision 1.6177
diff -u -b -r1.6176 -r1.6177
--- ChangeLog   4 Apr 2008 09:11:58 -0000       1.6176
+++ ChangeLog   4 Apr 2008 10:39:08 -0000       1.6177
@@ -1,3 +1,8 @@
+2008-04-04 Sandro Santilli <address@hidden>
+
+       * gui/gtk.cpp (makeTreeModel): fix model constructor when
+         jumping back to ancestor nodes at depth !+ current-1.
+
 2008-04-04 Udo Giacomozzi <address@hidden>
 
        * gui/Player.cpp: avoid bogus "Unhandled FSCommand quit"

Index: gui/gtk.cpp
===================================================================
RCS file: /sources/gnash/gnash/gui/gtk.cpp,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -b -r1.160 -r1.161
--- gui/gtk.cpp 29 Mar 2008 03:16:55 -0000      1.160
+++ gui/gtk.cpp 4 Apr 2008 10:39:09 -0000       1.161
@@ -664,6 +664,7 @@
     // Depth within the *GTK* tree.
     int depth = 0;    
 
+    assert(info.depth(info.begin()) == 0); // seems assumed in the code below
     for (InfoTree::iterator i=info.begin(), e=info.end(); i!=e; ++i)
     {
         StringPair& p = *i;
@@ -671,16 +672,23 @@
         std::ostringstream os;
         os << info.depth(i);  
 
-        if (info.depth(i) > depth) {
+        int newdepth = info.depth(i);
+
+        if (newdepth > depth) {
+            assert(newdepth == depth+1);
             depth++;                   
             iter=child_iter;                  
         }
 
-        if (info.depth(i) < depth) {
-            depth = info.depth(i);
+        if (newdepth < depth) {
+            int gap = depth-newdepth;
+            depth = newdepth;
+            while(gap--)
+            {
             gtk_tree_model_iter_parent (GTK_TREE_MODEL(model), &parent_iter, 
&iter);  
             iter = parent_iter;
         }
+        }
 
         //Read in data from present node
         if (depth == 0) gtk_tree_store_append (model, &child_iter, NULL);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]