diff -r ac4be290c750 -r 84ae10f6e3a3 mapeditor.cpp --- a/mapeditor.cpp Thu Jan 15 00:52:35 2009 +0000 +++ b/mapeditor.cpp Tue Jan 20 15:23:16 2009 +0000 @@ -271,7 +271,7 @@ QString("%1 (\"%2\")").arg(r).arg(f), QString("Toggling standard flag \"%1\" of %2").arg(f).arg(model->getObjectName(bo))); bo->toggleStandardFlag (f,mainWindow->useFlagGroups()); - model->updateSelection(); + model->updateSelection(); // geometry has changed } } @@ -391,7 +391,7 @@ if (lmo) { // MapObj was found - if (model->getSelection() != lmo) + if (model->getSelectedLMO() != lmo) { // select the MapObj model->select(lmo); @@ -550,19 +550,6 @@ //QModelIndex ix=model->index( ti->row(), ti->column(), model->index (0,0,QModelIndex()) ); QModelIndex ix=model->index(ti); model->getSelectionModel()->select (ix,QItemSelectionModel::ClearAndSelect ); - /* - if (model->getSelectionModel()->hasSelection() ) - { - QModelIndex ixsel=model->getSelectionModel()->selectedIndexes().first(); - TreeItem *tisel= static_cast(ixsel.internalPointer()); - ; - cout << " ti="<button() == Qt::LeftButton ) @@ -585,14 +572,14 @@ if (bo) { copyingObj=true; - bo->addBranch ((BranchObj*)model->getSelection()); + bo->addBranch (model->getSelectedBranch()); model->unselect(); model->select(bo->getLastBranch()); model->reposition(); } } - movingObj=model->getSelection(); + movingObj=model->getSelectedLMO(); } else // Middle Button Toggle Scroll // (On Mac OS X this won't work, but we still have @@ -620,7 +607,7 @@ void MapEditor::mouseMoveEvent(QMouseEvent* e) { QPointF p = mapToScene(e->pos()); - LinkableMapObj *lmosel=model->getSelection(); + LinkableMapObj *lmosel=model->getSelectedLMO(); // Move the selected MapObj if ( lmosel && movingObj) @@ -649,7 +636,7 @@ fio->move (p.x() -movingObj_start.x(), p.y()-movingObj_start.y() ); fio->setRelPos(); fio->updateLink(); //no need for reposition, if we update link here - model->updateSelection(); + model->updateSelection(); // position has changed // Relink float to new mapcenter or branch, if shift is pressed // Only relink, if selection really has a new parent @@ -736,7 +723,7 @@ } // depth>0 QItemSelection sel=model->getSelectionModel()->selection(); - updateSelection(sel,sel); + updateSelection(sel,sel); // position has changed } // no FloatImageObj @@ -767,7 +754,7 @@ { QPointF p = mapToScene(e->pos()); LinkableMapObj *dst; - LinkableMapObj *lmosel=model->getSelection(); + LinkableMapObj *lmosel=model->getSelectedLMO(); // Have we been picking color? if (pickingColor) { @@ -1094,6 +1081,7 @@ index=newsel.indexes().at(i); ti= static_cast(index.internalPointer()); lmo=ti->getLMO(); + cout << " ME::updateSelection of "<<((BranchObj*)lmo)->getHeading().toStdString()<<"\n"; bbox=lmo->getBBox(); sb->setRect ( bbox.x(),bbox.y(), @@ -1104,7 +1092,7 @@ } } -void MapEditor::updateCurrent (const QModelIndex &newsel,const QModelIndex &) +void MapEditor::updateCurrent (const QModelIndex &,const QModelIndex &) //FIXME not used? { /* FIXME testing