diff -r 7f43b93242aa -r 96402b172173 mainwindow.cpp --- a/mainwindow.cpp Mon Oct 06 11:10:20 2008 +0000 +++ b/mainwindow.cpp Wed Oct 29 17:42:34 2008 +0000 @@ -1721,30 +1721,6 @@ { VymView *vm=new VymView (model); -/* - // Create TreeView - QTreeView *tv=new QTreeView; - tv->setModel (model); - tv->setMinimumWidth (350); - tv->setColumnWidth (0,350); - - // Create good old MapEditor - MapEditor* me=model->getMapEditor(); - if (!me) me=new MapEditor (model); - //me->viewport()->setFocus(); - me->setAntiAlias (actionViewToggleAntiAlias->isOn()); - me->setSmoothPixmap(actionViewToggleSmoothPixmapTransform->isOn()); - - vm->addWidget (tv); - vm->addWidget (me); - - // Set geometry - QList sizes; - sizes.append (150); - sizes.append (600); - vm->setSizes (sizes); - -*/ return vm; } @@ -1752,8 +1728,8 @@ { VymModel *m=new VymModel; tabModel.append (m); - MapEditor* me = new MapEditor (m); - me->setObjectName ("MapEditor"); + //MapEditor* me = new MapEditor (m); + //me->setObjectName ("MapEditor"); VymView *view=createView (m); tabWidget->addTab (view,tr("unnamed","MainWindow: name for new and empty file")); @@ -1787,7 +1763,7 @@ // Make fn absolute (needed for unzip) fn=QDir (fn).absPath(); - MapEditor *me; + VymModel *vm; if (lmode==NewMap) { @@ -1830,15 +1806,15 @@ // Try to load map if ( !fn.isEmpty() ) { - me = currentMapEditor(); + vm = currentModel(); // Check first, if mapeditor exists // If it is not default AND we want a new map, // create a new mapeditor in a new tab - if ( lmode==NewMap && (!me || !me->getModel()->isDefault() ) ) + if ( lmode==NewMap && (!vm || !vm->isDefault() ) ) { - VymModel *m=new VymModel; - tabModel.append (m); - VymView *view=createView (m); + vm=new VymModel; + tabModel.append (vm); + VymView *view=createView (vm); tabWidget->addTab (view,fn); tabIndex=tabWidget->count()-1; tabWidget->setCurrentPage (tabIndex); @@ -1878,20 +1854,20 @@ //tabWidget->currentPage() won't be NULL here, because of above... tabWidget->setCurrentIndex (tabIndex); - me->viewport()->setFocus(); + //FIXME no me anymore... me->viewport()->setFocus(); if (err!=aborted) { // Save existing filename in case we import - QString fn_org=me->getModel()->getFilePath(); + QString fn_org=vm->getFilePath(); // Finally load map into mapEditor - me->getModel()->setFilePath (fn); - err=me->getModel()->load(fn,lmode,ftype); + vm->setFilePath (fn); + err=vm->load(fn,lmode,ftype); // Restore old (maybe empty) filepath, if this is an import if (lmode!=NewMap) - me->getModel()->setFilePath (fn_org); + vm->setFilePath (fn_org); } // Finally check for errors and go home @@ -1903,13 +1879,13 @@ { if (lmode==NewMap) { - me->getModel()->setFilePath (fn); - tabWidget->setTabText (tabIndex, me->getModel()->getFileName()); + vm->setFilePath (fn); + tabWidget->setTabText (tabIndex, vm->getFileName()); if (!isInTmpDir (fn)) { // Only append to lastMaps if not loaded from a tmpDir // e.g. imported bookmarks are in a tmpDir - addRecentMap(me->getModel()->getFilePath() ); + addRecentMap(vm->getFilePath() ); } actionFilePrint->setEnabled (true); }