diff -r b8bb7beec278 -r 3368b54c7946 mainwindow.cpp --- a/mainwindow.cpp Thu Jul 03 14:42:18 2008 +0000 +++ b/mainwindow.cpp Fri Jul 11 12:36:38 2008 +0000 @@ -79,6 +79,8 @@ { mainWindow=this; + setObjectName ("MainWindow"); + setCaption ("VYM - View Your Mind"); // Load window settings @@ -1702,11 +1704,11 @@ MapEditor *me; for (int i=0;i<=tabWidget->count() -1;i++) { - me=(MapEditor*)tabWidget->page(i); me->unselect(); } - currentMapEditor()->reselect(); + me=currentMapEditor(); + if (me) me->reselect(); // Update actions to in menus and toolbars according to editor updateActions(); @@ -1819,6 +1821,8 @@ // Check, if file exists (important for creating new files // from command line + /* + */ if (!QFile(fn).exists() ) { QMessageBox mb( vymName, @@ -1848,7 +1852,6 @@ } } - //tabWidget->currentPage() won't be NULL here, because of above... tabWidget->showPage(me); me->viewport()->setFocus(); @@ -2319,11 +2322,13 @@ return; } } - me->closeMap(); + //me->closeMap(); tabWidget->removePage(me); if (tabWidget->count()==0) actionFilePrint->setEnabled (false); - delete me; + + //delete me; + me->clear(); } }