1.1 --- a/treeitem.cpp Tue Apr 07 16:15:53 2009 +0000
1.2 +++ b/treeitem.cpp Mon Apr 20 10:42:05 2009 +0000
1.3 @@ -26,6 +26,11 @@
1.4 // isNoteInEditor=false;
1.5
1.6 hidden=false;
1.7 +
1.8 + // Reset ID
1.9 + objID="";
1.10 +
1.11 +
1.12 }
1.13
1.14 TreeItem::~TreeItem()
1.15 @@ -46,7 +51,8 @@
1.16 {
1.17 note.copy (other->note);
1.18 model=other->model;
1.19 - hideExport=other->hideExport;
1.20 + hideExport=officially
1.21 + other->hideExport;
1.22 }
1.23 */
1.24
1.25 @@ -269,6 +275,17 @@
1.26 }
1.27 }
1.28
1.29 +void TreeItem::setID (const QString &s)
1.30 +{
1.31 + objID=s;
1.32 +}
1.33 +
1.34 +QString TreeItem::getID()
1.35 +{
1.36 + return objID;
1.37 +}
1.38 +
1.39 +
1.40 TreeItem* TreeItem::getChildNum(const int &n)
1.41 {
1.42 if (n>=0 && n<childItems.count() )
1.43 @@ -317,6 +334,46 @@
1.44 parentItem->lastSelectedBranchNum=parentItem->childItems.indexOf(this);
1.45 }
1.46
1.47 +TreeItem* TreeItem::findBySelectString (const QString &s) //FIXME-1
1.48 +{
1.49 +/*
1.50 + LinkableMapObj *lmo=this;
1.51 + QString part;
1.52 + QString typ;
1.53 + QString num;
1.54 + while (!s.isEmpty() )
1.55 + {
1.56 + part=s.section(",",0,0);
1.57 + typ=part.left (3);
1.58 + num=part.right(part.length() - 3);
1.59 + if (typ=="mc:")
1.60 + {
1.61 + if (depth>0)
1.62 + return false; // in a subtree there is no center
1.63 + else
1.64 + break;
1.65 + } else
1.66 + if (typ=="bo:")
1.67 + lmo=lmo->getTreeItem()->getBranchObjNum (num.toInt());
1.68 + else
1.69 + if (typ=="fi:")
1.70 + lmo=((BranchObj*)lmo)->getFloatImageNum (num.toUInt());
1.71 + if (!lmo) break;
1.72 +
1.73 + if (s.contains(","))
1.74 + s=s.right(s.length() - part.length() -1 );
1.75 + else
1.76 + break;
1.77 + }
1.78 + */
1.79 + return NULL;
1.80 +}
1.81 +
1.82 +void TreeItem::setLastSelectedBranch(int i)
1.83 +{
1.84 + lastSelectedBranchNum=i;
1.85 +}
1.86 +
1.87 TreeItem* TreeItem::getLastSelectedBranch()
1.88 {
1.89 return getBranchNum (lastSelectedBranchNum);