]> git.llucax.com Git - z.facultad/75.52/treemulator.git/commitdiff
Fix al abrir el arbol.
authorRicardo Markiewicz <rmarkie@fi.uba.ar>
Wed, 23 Nov 2005 17:13:47 +0000 (17:13 +0000)
committerRicardo Markiewicz <rmarkie@fi.uba.ar>
Wed, 23 Nov 2005 17:13:47 +0000 (17:13 +0000)
src/btree.cpp
viewer/main.cpp
viewer/view_btree.cpp

index ae68316e256a790dee91e9a888856b044310fe51..cce07595dbae924ffd7fdd431c014c031e350758 100644 (file)
@@ -70,6 +70,7 @@ BTree::BTree (const std::string &name)
                /* TODO : mandar una exception ? */
                return;
        }
+       filename = name;
        ReadFileHeader ();
 }
 
index 144cddaf16097fcb4d5192c6e71dd2dfd75ab550..59f34f77bc20179fcfbee67da22d2e890583f496 100644 (file)
@@ -129,6 +129,9 @@ void abrir_arbol ()
                        tree = Glib::RefPtr<ViewBTree>(ptree);
                        tree->signal_selected ().connect ( sigc::mem_fun (*real_frame, &ViewProperties::ShowItem) );
                        tree->AddNode (0);
+                       double x1, x2, y1, y2;
+                       tree->get_bounds (x1, y1, x2, y2);
+                       real_canvas->scroll_to (0, 0);
                }
        }
 }
index dab540422032b5e6a037e57604914202d8a1cc0b..760429323e512325ed47b7312c30ebd2f8e23506 100644 (file)
@@ -40,6 +40,11 @@ ViewBTree* ViewBTree::Open (Canvas::Group *parent, const std::string &filename)
                return NULL;
        }
 
+       /* El magic no coincide!! */
+       if (strcmp (tree->header.magic, "DILUMA")) {
+               delete tree;
+               return NULL;
+       }
        return tree;
 }