From: Ricardo Markiewicz Date: Wed, 23 Nov 2005 17:13:47 +0000 (+0000) Subject: Fix al abrir el arbol. X-Git-Tag: 1_0~1 X-Git-Url: https://git.llucax.com/z.facultad/75.52/treemulator.git/commitdiff_plain/8e23e15f255365a35ebcf3a5cec7a4c356fc78b5 Fix al abrir el arbol. --- diff --git a/src/btree.cpp b/src/btree.cpp index ae68316..cce0759 100644 --- a/src/btree.cpp +++ b/src/btree.cpp @@ -70,6 +70,7 @@ BTree::BTree (const std::string &name) /* TODO : mandar una exception ? */ return; } + filename = name; ReadFileHeader (); } diff --git a/viewer/main.cpp b/viewer/main.cpp index 144cdda..59f34f7 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -129,6 +129,9 @@ void abrir_arbol () tree = Glib::RefPtr(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); } } } diff --git a/viewer/view_btree.cpp b/viewer/view_btree.cpp index dab5404..7604293 100644 --- a/viewer/view_btree.cpp +++ b/viewer/view_btree.cpp @@ -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; }