1.1 --- a/xml-vym.cpp Tue Jul 07 11:21:27 2009 +0000
1.2 +++ b/xml-vym.cpp Mon Jul 27 12:53:17 2009 +0000
1.3 @@ -145,7 +145,7 @@
1.4 {
1.5 // Treat the found mapcenter as a branch
1.6 // in an existing map
1.7 - BranchItem *bi=model->getSelectedBranchItem();
1.8 + BranchItem *bi=model->getSelectedBranchItem(); //FIXME-3 selection is no longer used here...
1.9 if (bi)
1.10 {
1.11 lastBranch=bi;
1.12 @@ -191,7 +191,7 @@
1.13 {
1.14 // This is used in vymparts, which have no mapcenter!
1.15 isVymPart=true;
1.16 - TreeItem *ti=model->getSelectedItem();
1.17 + TreeItem *ti=model->getSelectedItem(); //FIXME-3 selection is no longer used here...
1.18 if (!ti)
1.19 {
1.20 // If a vym part is _loaded_ (not imported),
1.21 @@ -269,8 +269,9 @@
1.22 /* Testing
1.23 cout << "endElement </" <<qPrintable(eName)
1.24 <<"> state=" <<state
1.25 - <<" laststate=" <<laststate
1.26 - <<" stateStack="<<stateStack.last()
1.27 + // <<" laststate=" <<laststate
1.28 + // <<" stateStack="<<stateStack.last()
1.29 + <<" selString="<<model->getSelectString().toStdString()
1.30 <<endl;
1.31 */
1.32 switch ( state )
1.33 @@ -279,14 +280,17 @@
1.34 mainWindow->removeProgressBar();
1.35 break;
1.36 case StateMapCenter:
1.37 - model->selectParent(); // FIXME-3 really needed to "select"? Maybe optimize...
1.38 model->emitDataHasChanged (lastBranch);
1.39 lastBranch=(BranchItem*)(lastBranch->parent());
1.40 lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch
1.41 break;
1.42 case StateBranch:
1.43 - model->selectParent();// FIXME-3 really needed to "select"? Maybe optimize...
1.44 + // Empty branches may not be scrolled
1.45 + // (happens if bookmarks are imported)
1.46 + if (lastBranch->isScrolled() && lastBranch->branchCount()==0)
1.47 + lastBranch->unScroll();
1.48 model->emitDataHasChanged (lastBranch);
1.49 +
1.50 lastBranch=(BranchItem*)(lastBranch->parent());
1.51 lastBranch->setLastSelectedBranch (0); // Reset last selected to first child branch
1.52 break;