diff -r 5987f9f15bac -r 6269016c9905 vymmodel.cpp --- a/vymmodel.cpp Mon Aug 03 10:42:12 2009 +0000 +++ b/vymmodel.cpp Thu Aug 06 10:42:17 2009 +0000 @@ -3,6 +3,7 @@ #include "vymmodel.h" +#include "attributeitem.h" #include "treeitem.h" #include "branchitem.h" #include "editxlinkdialog.h" @@ -126,8 +127,8 @@ findPrevious=NULL; EOFind=false; - // animations - animationUse=settings.readBoolEntry("/animation/use",false); + // animations // FIXME-3 switch to new animation system + animationUse=settings.readBoolEntry("/animation/use",false); // FIXME-3 add options to control _what_ is animated animationTicks=settings.readNumEntry("/animation/ticks",10); animationInterval=settings.readNumEntry("/animation/interval",50); animObjList.clear(); @@ -1982,6 +1983,33 @@ return NULL; } +AttributeItem* VymModel::addAttribute() +{ + cout << "VM::addAttribute\n"; + + TreeItem *selti=getSelectedItem(); + if (selti) + { + QList cData; + cData << "new attribute" << "undef"<<"undef"; + AttributeItem *a=new AttributeItem (cData); + + emit (layoutAboutToBeChanged() ); + + QModelIndex parix=index(selti); + int n=selti->getRowNumAppend (a); + beginInsertRows (parix,n,n+1); + selti->appendChild (a); + endInsertRows (); + + emit (layoutChanged() ); + + reposition(); + return a; + } + return NULL; +} + BranchItem* VymModel::addMapCenter () { BranchItem *bi=addMapCenter (contextPos); @@ -4056,7 +4084,7 @@ while (cur) { bo=(BranchObj*)(cur->getLMO() ); - bo->setLinkStyle(bo->getDefLinkStyle()); + bo->setLinkStyle(bo->getDefLinkStyle(cur->parent() )); //FIXME-3 better emit dataCHanged and leave the changes to View cur=next(cur,prev); } reposition();