insilmaril@746
|
1 |
#include <iostream>
|
insilmaril@746
|
2 |
using namespace std;
|
insilmaril@746
|
3 |
|
insilmaril@725
|
4 |
#include <QStringList>
|
insilmaril@725
|
5 |
|
insilmaril@750
|
6 |
#include "treeitem.h"
|
insilmaril@750
|
7 |
|
insilmaril@741
|
8 |
#include "branchobj.h"
|
insilmaril@750
|
9 |
#include "branchitem.h"
|
insilmaril@746
|
10 |
#include "vymmodel.h"
|
insilmaril@725
|
11 |
|
insilmaril@725
|
12 |
TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent)
|
insilmaril@725
|
13 |
{
|
insilmaril@746
|
14 |
model=NULL;
|
insilmaril@746
|
15 |
|
insilmaril@725
|
16 |
parentItem = parent;
|
insilmaril@725
|
17 |
itemData = data;
|
insilmaril@726
|
18 |
lmo=NULL;
|
insilmaril@738
|
19 |
|
insilmaril@738
|
20 |
branchOffset=0;
|
insilmaril@741
|
21 |
branchCounter=0;
|
insilmaril@738
|
22 |
lastSelectedBranchNum=-1;
|
insilmaril@746
|
23 |
|
insilmaril@746
|
24 |
note.setNote("");
|
insilmaril@746
|
25 |
// note.setFontHint (textEditor->getFontHintDefault() ); //FIXME-2
|
insilmaril@746
|
26 |
// isNoteInEditor=false;
|
insilmaril@753
|
27 |
|
insilmaril@753
|
28 |
hidden=false;
|
insilmaril@754
|
29 |
|
insilmaril@754
|
30 |
// Reset ID
|
insilmaril@754
|
31 |
objID="";
|
insilmaril@754
|
32 |
|
insilmaril@754
|
33 |
|
insilmaril@725
|
34 |
}
|
insilmaril@725
|
35 |
|
insilmaril@725
|
36 |
TreeItem::~TreeItem()
|
insilmaril@725
|
37 |
{
|
insilmaril@755
|
38 |
cout << "Destructor TreeItem\n";
|
insilmaril@755
|
39 |
//if (lmo) delete (lmo);
|
insilmaril@725
|
40 |
qDeleteAll(childItems);
|
insilmaril@725
|
41 |
}
|
insilmaril@725
|
42 |
|
insilmaril@746
|
43 |
QString TreeItem::saveToDir (const QString &tmpdir,const QString &prefix, const QPointF& offset)
|
insilmaril@746
|
44 |
{
|
insilmaril@755
|
45 |
cout << "TreeItem::saveToDir called directly for ("<<getHeadingStd()<<"), instead of inherited type...\n"; //FIXME-1 triggered on save
|
insilmaril@746
|
46 |
return QString();
|
insilmaril@746
|
47 |
}
|
insilmaril@746
|
48 |
|
insilmaril@746
|
49 |
|
insilmaril@746
|
50 |
/*
|
insilmaril@753
|
51 |
void TreeItem::copy (OrnamentedObj* other) //FIXME-2 probably need deep copy of branches and data!
|
insilmaril@746
|
52 |
|
insilmaril@746
|
53 |
{
|
insilmaril@746
|
54 |
note.copy (other->note);
|
insilmaril@746
|
55 |
model=other->model;
|
insilmaril@754
|
56 |
hideExport=officially
|
insilmaril@754
|
57 |
other->hideExport;
|
insilmaril@746
|
58 |
}
|
insilmaril@746
|
59 |
*/
|
insilmaril@746
|
60 |
|
insilmaril@746
|
61 |
void TreeItem::setModel (VymModel *m)
|
insilmaril@746
|
62 |
{
|
insilmaril@746
|
63 |
model=m;
|
insilmaril@746
|
64 |
}
|
insilmaril@746
|
65 |
|
insilmaril@746
|
66 |
VymModel* TreeItem::getModel ()
|
insilmaril@746
|
67 |
{
|
insilmaril@746
|
68 |
return model;
|
insilmaril@746
|
69 |
}
|
insilmaril@741
|
70 |
|
insilmaril@725
|
71 |
void TreeItem::appendChild(TreeItem *item)
|
insilmaril@725
|
72 |
{
|
insilmaril@725
|
73 |
childItems.append(item);
|
insilmaril@746
|
74 |
item->setModel (model);
|
insilmaril@741
|
75 |
|
insilmaril@741
|
76 |
if (item->type == Branch || item->type ==MapCenter)
|
insilmaril@738
|
77 |
{
|
insilmaril@741
|
78 |
if (branchCounter==0)
|
insilmaril@738
|
79 |
branchOffset=childItems.count()-1;
|
insilmaril@741
|
80 |
branchCounter++;
|
insilmaril@738
|
81 |
}
|
insilmaril@725
|
82 |
}
|
insilmaril@725
|
83 |
|
insilmaril@727
|
84 |
void TreeItem::removeChild(int row)
|
insilmaril@727
|
85 |
{
|
insilmaril@745
|
86 |
if (row<0 || row > childItems.size()-1)
|
insilmaril@745
|
87 |
qWarning ("TreeItem::removeChild tried to remove non existing item?!\n");
|
insilmaril@745
|
88 |
else
|
insilmaril@727
|
89 |
{
|
insilmaril@745
|
90 |
cout << "TI::removeChild this="<<this<<" row="<<row<<endl;
|
insilmaril@755
|
91 |
if (childItems.at(row)->isBranchLikeType())
|
insilmaril@755
|
92 |
branchCounter--;
|
insilmaril@755
|
93 |
childItems.removeAt (row);
|
insilmaril@745
|
94 |
}
|
insilmaril@727
|
95 |
}
|
insilmaril@727
|
96 |
|
insilmaril@725
|
97 |
TreeItem *TreeItem::child(int row)
|
insilmaril@725
|
98 |
{
|
insilmaril@725
|
99 |
return childItems.value(row);
|
insilmaril@725
|
100 |
}
|
insilmaril@725
|
101 |
|
insilmaril@725
|
102 |
int TreeItem::childCount() const
|
insilmaril@725
|
103 |
{
|
insilmaril@725
|
104 |
return childItems.count();
|
insilmaril@725
|
105 |
}
|
insilmaril@725
|
106 |
|
insilmaril@745
|
107 |
int TreeItem::childNumber() const
|
insilmaril@745
|
108 |
{
|
insilmaril@745
|
109 |
if (parentItem)
|
insilmaril@745
|
110 |
return parentItem->childItems.indexOf(const_cast<TreeItem*>(this));
|
insilmaril@745
|
111 |
|
insilmaril@745
|
112 |
return 0;
|
insilmaril@745
|
113 |
}
|
insilmaril@745
|
114 |
|
insilmaril@725
|
115 |
int TreeItem::columnCount() const
|
insilmaril@725
|
116 |
{
|
insilmaril@725
|
117 |
return itemData.count();
|
insilmaril@725
|
118 |
}
|
insilmaril@741
|
119 |
|
insilmaril@741
|
120 |
int TreeItem::branchCount() const
|
insilmaril@741
|
121 |
{
|
insilmaril@741
|
122 |
return branchCounter;
|
insilmaril@741
|
123 |
}
|
insilmaril@749
|
124 |
|
insilmaril@749
|
125 |
int TreeItem::imageCount() const
|
insilmaril@749
|
126 |
{
|
insilmaril@749
|
127 |
int imageCounter=0;
|
insilmaril@749
|
128 |
return imageCounter; // FIXME-1 imageCounter needs to be calculated...
|
insilmaril@749
|
129 |
}
|
insilmaril@749
|
130 |
|
insilmaril@749
|
131 |
int TreeItem::xlinkCount() const // FIXME-2 check if xlinks are stored in a different way (global to model?)
|
insilmaril@749
|
132 |
{
|
insilmaril@749
|
133 |
int xlinkCounter=0;
|
insilmaril@749
|
134 |
return xlinkCounter; // FIXME-1 xlinkCounter needs to be calculated...
|
insilmaril@749
|
135 |
}
|
insilmaril@749
|
136 |
|
insilmaril@727
|
137 |
int TreeItem::row() const
|
insilmaril@727
|
138 |
{
|
insilmaril@727
|
139 |
if (parentItem)
|
insilmaril@727
|
140 |
return parentItem->childItems.indexOf(const_cast<TreeItem*>(this));
|
insilmaril@727
|
141 |
|
insilmaril@727
|
142 |
return 0;
|
insilmaril@727
|
143 |
}
|
insilmaril@727
|
144 |
|
insilmaril@727
|
145 |
int TreeItem::column() const
|
insilmaril@727
|
146 |
{
|
insilmaril@727
|
147 |
return 0;
|
insilmaril@727
|
148 |
}
|
insilmaril@727
|
149 |
|
insilmaril@740
|
150 |
int TreeItem::depth()
|
insilmaril@740
|
151 |
{
|
insilmaril@755
|
152 |
int d=-2;
|
insilmaril@740
|
153 |
TreeItem *ti=this;
|
insilmaril@740
|
154 |
while (ti!=NULL)
|
insilmaril@740
|
155 |
{
|
insilmaril@740
|
156 |
ti=ti->parent();
|
insilmaril@740
|
157 |
d++;
|
insilmaril@740
|
158 |
}
|
insilmaril@740
|
159 |
return d;
|
insilmaril@740
|
160 |
}
|
insilmaril@740
|
161 |
|
insilmaril@727
|
162 |
TreeItem *TreeItem::parent()
|
insilmaril@727
|
163 |
{
|
insilmaril@727
|
164 |
return parentItem;
|
insilmaril@727
|
165 |
}
|
insilmaril@727
|
166 |
|
insilmaril@755
|
167 |
int TreeItem::childNum()
|
insilmaril@755
|
168 |
{
|
insilmaril@755
|
169 |
return parentItem->childItems.indexOf (this);
|
insilmaril@755
|
170 |
}
|
insilmaril@755
|
171 |
|
insilmaril@741
|
172 |
int TreeItem::num()
|
insilmaril@741
|
173 |
{
|
insilmaril@741
|
174 |
switch (type)
|
insilmaril@741
|
175 |
{
|
insilmaril@741
|
176 |
case Undefined: return -1;
|
insilmaril@741
|
177 |
case MapCenter: return parentItem->childItems.indexOf (this) - branchOffset;
|
insilmaril@741
|
178 |
case Branch: return parentItem->childItems.indexOf (this) - branchOffset;
|
insilmaril@746
|
179 |
case Image: return -1; // FIXME-2
|
insilmaril@741
|
180 |
default: return -1;
|
insilmaril@741
|
181 |
}
|
insilmaril@749
|
182 |
}
|
insilmaril@749
|
183 |
|
insilmaril@749
|
184 |
int TreeItem::num (TreeItem *item)
|
insilmaril@749
|
185 |
{
|
insilmaril@749
|
186 |
if (!item) return -1;
|
insilmaril@749
|
187 |
switch (item->getType())
|
insilmaril@749
|
188 |
{
|
insilmaril@749
|
189 |
case Undefined: return -1;
|
insilmaril@749
|
190 |
case MapCenter: return childItems.indexOf (this) - branchOffset;
|
insilmaril@749
|
191 |
case Branch: return childItems.indexOf (this) - branchOffset;
|
insilmaril@749
|
192 |
case Image: return -1; // FIXME-2
|
insilmaril@749
|
193 |
default: return -1;
|
insilmaril@749
|
194 |
}
|
insilmaril@741
|
195 |
}
|
insilmaril@725
|
196 |
|
insilmaril@725
|
197 |
QVariant TreeItem::data(int column) const
|
insilmaril@725
|
198 |
{
|
insilmaril@725
|
199 |
return itemData.value(column);
|
insilmaril@725
|
200 |
}
|
insilmaril@725
|
201 |
|
insilmaril@726
|
202 |
void TreeItem::setHeading (const QString s)
|
insilmaril@725
|
203 |
{
|
insilmaril@726
|
204 |
itemData[0]=s;
|
insilmaril@726
|
205 |
}
|
insilmaril@726
|
206 |
|
insilmaril@753
|
207 |
QString TreeItem::getHeading () const
|
insilmaril@726
|
208 |
{
|
insilmaril@726
|
209 |
return itemData[0].toString();
|
insilmaril@726
|
210 |
}
|
insilmaril@726
|
211 |
|
insilmaril@755
|
212 |
std::string TreeItem::getHeadingStd () const
|
insilmaril@753
|
213 |
{
|
insilmaril@753
|
214 |
return itemData[0].toString().toStdString();
|
insilmaril@753
|
215 |
}
|
insilmaril@753
|
216 |
|
insilmaril@741
|
217 |
void TreeItem::setNote(const QString s)
|
insilmaril@741
|
218 |
{
|
insilmaril@746
|
219 |
note.setNote(s);
|
insilmaril@746
|
220 |
// updateNoteFlag(); FIXME-2 needed?
|
insilmaril@746
|
221 |
if (model)
|
insilmaril@753
|
222 |
model->emitNoteHasChanged (this);
|
insilmaril@746
|
223 |
}
|
insilmaril@746
|
224 |
|
insilmaril@746
|
225 |
void TreeItem::setNoteObj(const NoteObj &n, bool updateNoteEditor)
|
insilmaril@746
|
226 |
{
|
insilmaril@746
|
227 |
note=n;
|
insilmaril@746
|
228 |
// updateNoteFlag(); FIXME-2 needed?
|
insilmaril@746
|
229 |
if (model && updateNoteEditor)
|
insilmaril@753
|
230 |
model->emitNoteHasChanged (this);
|
insilmaril@741
|
231 |
}
|
insilmaril@741
|
232 |
|
insilmaril@741
|
233 |
QString TreeItem::getNote()
|
insilmaril@741
|
234 |
{
|
insilmaril@746
|
235 |
return note.getNote();
|
insilmaril@746
|
236 |
}
|
insilmaril@746
|
237 |
|
insilmaril@746
|
238 |
NoteObj TreeItem::getNoteObj()
|
insilmaril@746
|
239 |
{
|
insilmaril@746
|
240 |
return note;
|
insilmaril@746
|
241 |
}
|
insilmaril@746
|
242 |
|
insilmaril@746
|
243 |
QString TreeItem::getNoteASCII(const QString &indent, const int &width)
|
insilmaril@746
|
244 |
{
|
insilmaril@746
|
245 |
return note.getNoteASCII(indent,width);
|
insilmaril@746
|
246 |
}
|
insilmaril@746
|
247 |
|
insilmaril@746
|
248 |
QString TreeItem::getNoteASCII()
|
insilmaril@746
|
249 |
{
|
insilmaril@746
|
250 |
return note.getNoteASCII();
|
insilmaril@746
|
251 |
}
|
insilmaril@746
|
252 |
|
insilmaril@746
|
253 |
QString TreeItem::getNoteOpenDoc()
|
insilmaril@746
|
254 |
{
|
insilmaril@746
|
255 |
return note.getNoteOpenDoc();
|
insilmaril@741
|
256 |
}
|
insilmaril@741
|
257 |
|
insilmaril@726
|
258 |
void TreeItem::setType(const Type t)
|
insilmaril@726
|
259 |
{
|
insilmaril@726
|
260 |
type=t;
|
insilmaril@726
|
261 |
itemData[1]=getTypeName();
|
insilmaril@726
|
262 |
}
|
insilmaril@726
|
263 |
|
insilmaril@726
|
264 |
TreeItem::Type TreeItem::getType()
|
insilmaril@726
|
265 |
{
|
insilmaril@726
|
266 |
return type;
|
insilmaril@726
|
267 |
}
|
insilmaril@726
|
268 |
|
insilmaril@753
|
269 |
bool TreeItem::isBranchLikeType() const
|
insilmaril@753
|
270 |
{
|
insilmaril@753
|
271 |
if (type==Branch ||type==MapCenter) return true;
|
insilmaril@753
|
272 |
return false;
|
insilmaril@753
|
273 |
}
|
insilmaril@753
|
274 |
|
insilmaril@726
|
275 |
QString TreeItem::getTypeName()
|
insilmaril@726
|
276 |
{
|
insilmaril@726
|
277 |
switch (type)
|
insilmaril@726
|
278 |
{
|
insilmaril@726
|
279 |
case Undefined: return QString ("Undefined");
|
insilmaril@726
|
280 |
case MapCenter: return QString ("MapCenter");
|
insilmaril@726
|
281 |
case Branch: return QString ("Branch");
|
insilmaril@739
|
282 |
case Image: return QString ("Image");
|
insilmaril@726
|
283 |
default: return QString ("TreeItem::getTypeName no typename defined?!");
|
insilmaril@726
|
284 |
}
|
insilmaril@725
|
285 |
}
|
insilmaril@725
|
286 |
|
insilmaril@754
|
287 |
void TreeItem::setID (const QString &s)
|
insilmaril@754
|
288 |
{
|
insilmaril@754
|
289 |
objID=s;
|
insilmaril@754
|
290 |
}
|
insilmaril@754
|
291 |
|
insilmaril@754
|
292 |
QString TreeItem::getID()
|
insilmaril@754
|
293 |
{
|
insilmaril@754
|
294 |
return objID;
|
insilmaril@754
|
295 |
}
|
insilmaril@754
|
296 |
|
insilmaril@754
|
297 |
|
insilmaril@738
|
298 |
TreeItem* TreeItem::getChildNum(const int &n)
|
insilmaril@738
|
299 |
{
|
insilmaril@738
|
300 |
if (n>=0 && n<childItems.count() )
|
insilmaril@738
|
301 |
return childItems.at(n);
|
insilmaril@738
|
302 |
else
|
insilmaril@738
|
303 |
return NULL;
|
insilmaril@738
|
304 |
}
|
insilmaril@738
|
305 |
|
insilmaril@750
|
306 |
BranchItem* TreeItem::getFirstBranch()
|
insilmaril@738
|
307 |
{
|
insilmaril@741
|
308 |
if (branchCounter>0)
|
insilmaril@738
|
309 |
return getBranchNum (branchOffset);
|
insilmaril@738
|
310 |
else
|
insilmaril@738
|
311 |
return NULL;
|
insilmaril@738
|
312 |
}
|
insilmaril@738
|
313 |
|
insilmaril@750
|
314 |
BranchItem* TreeItem::getLastBranch()
|
insilmaril@738
|
315 |
{
|
insilmaril@741
|
316 |
if (branchCounter>0)
|
insilmaril@741
|
317 |
return getBranchNum (branchOffset + branchCounter-1);
|
insilmaril@738
|
318 |
else
|
insilmaril@738
|
319 |
return NULL;
|
insilmaril@738
|
320 |
}
|
insilmaril@738
|
321 |
|
insilmaril@738
|
322 |
|
insilmaril@750
|
323 |
BranchItem* TreeItem::getBranchNum(const int &n)
|
insilmaril@738
|
324 |
{
|
insilmaril@741
|
325 |
if (branchCounter>0)
|
insilmaril@750
|
326 |
return (BranchItem*)getChildNum (branchOffset + n);
|
insilmaril@738
|
327 |
else
|
insilmaril@738
|
328 |
return NULL;
|
insilmaril@738
|
329 |
}
|
insilmaril@738
|
330 |
|
insilmaril@750
|
331 |
BranchObj* TreeItem::getBranchObjNum(const int &n)
|
insilmaril@750
|
332 |
{
|
insilmaril@750
|
333 |
if (branchCounter>0)
|
insilmaril@750
|
334 |
{
|
insilmaril@750
|
335 |
return (BranchObj*)(getChildNum (branchOffset+n)->lmo);
|
insilmaril@750
|
336 |
} else
|
insilmaril@750
|
337 |
return NULL;
|
insilmaril@750
|
338 |
}
|
insilmaril@750
|
339 |
|
insilmaril@738
|
340 |
void TreeItem::setLastSelectedBranch()
|
insilmaril@738
|
341 |
{
|
insilmaril@738
|
342 |
if (parentItem)
|
insilmaril@738
|
343 |
parentItem->lastSelectedBranchNum=parentItem->childItems.indexOf(this);
|
insilmaril@738
|
344 |
}
|
insilmaril@738
|
345 |
|
insilmaril@754
|
346 |
TreeItem* TreeItem::findBySelectString (const QString &s) //FIXME-1
|
insilmaril@754
|
347 |
{
|
insilmaril@754
|
348 |
/*
|
insilmaril@754
|
349 |
LinkableMapObj *lmo=this;
|
insilmaril@754
|
350 |
QString part;
|
insilmaril@754
|
351 |
QString typ;
|
insilmaril@754
|
352 |
QString num;
|
insilmaril@754
|
353 |
while (!s.isEmpty() )
|
insilmaril@754
|
354 |
{
|
insilmaril@754
|
355 |
part=s.section(",",0,0);
|
insilmaril@754
|
356 |
typ=part.left (3);
|
insilmaril@754
|
357 |
num=part.right(part.length() - 3);
|
insilmaril@754
|
358 |
if (typ=="mc:")
|
insilmaril@754
|
359 |
{
|
insilmaril@754
|
360 |
if (depth>0)
|
insilmaril@754
|
361 |
return false; // in a subtree there is no center
|
insilmaril@754
|
362 |
else
|
insilmaril@754
|
363 |
break;
|
insilmaril@754
|
364 |
} else
|
insilmaril@754
|
365 |
if (typ=="bo:")
|
insilmaril@754
|
366 |
lmo=lmo->getTreeItem()->getBranchObjNum (num.toInt());
|
insilmaril@754
|
367 |
else
|
insilmaril@754
|
368 |
if (typ=="fi:")
|
insilmaril@754
|
369 |
lmo=((BranchObj*)lmo)->getFloatImageNum (num.toUInt());
|
insilmaril@754
|
370 |
if (!lmo) break;
|
insilmaril@754
|
371 |
|
insilmaril@754
|
372 |
if (s.contains(","))
|
insilmaril@754
|
373 |
s=s.right(s.length() - part.length() -1 );
|
insilmaril@754
|
374 |
else
|
insilmaril@754
|
375 |
break;
|
insilmaril@754
|
376 |
}
|
insilmaril@754
|
377 |
*/
|
insilmaril@754
|
378 |
return NULL;
|
insilmaril@754
|
379 |
}
|
insilmaril@754
|
380 |
|
insilmaril@754
|
381 |
void TreeItem::setLastSelectedBranch(int i)
|
insilmaril@754
|
382 |
{
|
insilmaril@754
|
383 |
lastSelectedBranchNum=i;
|
insilmaril@754
|
384 |
}
|
insilmaril@754
|
385 |
|
insilmaril@738
|
386 |
TreeItem* TreeItem::getLastSelectedBranch()
|
insilmaril@738
|
387 |
{
|
insilmaril@738
|
388 |
return getBranchNum (lastSelectedBranchNum);
|
insilmaril@738
|
389 |
}
|
insilmaril@738
|
390 |
|
insilmaril@753
|
391 |
|
insilmaril@753
|
392 |
void TreeItem::setHideTmp (HideTmpMode mode)
|
insilmaril@753
|
393 |
{
|
insilmaril@753
|
394 |
if (isBranchLikeType() )
|
insilmaril@753
|
395 |
((BranchItem*)this)->updateVisibility();
|
insilmaril@753
|
396 |
/*
|
insilmaril@753
|
397 |
if (type==Image)
|
insilmaril@753
|
398 |
//updateVisibility();
|
insilmaril@753
|
399 |
*/
|
insilmaril@753
|
400 |
|
insilmaril@753
|
401 |
/*
|
insilmaril@753
|
402 |
|
insilmaril@753
|
403 |
if (mode==HideExport && (hideExport || hasHiddenExportParent() ) )
|
insilmaril@753
|
404 |
{
|
insilmaril@753
|
405 |
// Hide stuff according to hideExport flag and parents
|
insilmaril@753
|
406 |
//setVisibility (false);
|
insilmaril@753
|
407 |
updateVisibility();
|
insilmaril@753
|
408 |
//FIXME-2 hidden=true;
|
insilmaril@753
|
409 |
}else
|
insilmaril@753
|
410 |
{
|
insilmaril@753
|
411 |
// Do not hide, but still take care of scrolled status
|
insilmaril@753
|
412 |
|
insilmaril@753
|
413 |
|
insilmaril@753
|
414 |
XXXXXXXX treeItem should be THIS
|
insilmaril@753
|
415 |
|
insilmaril@753
|
416 |
move visible to TreeItem???
|
insilmaril@753
|
417 |
|
insilmaril@753
|
418 |
BranchObj now has updateContents
|
insilmaril@753
|
419 |
|
insilmaril@753
|
420 |
maybe also start "bool TreeItem::branchlikeType"
|
insilmaril@753
|
421 |
|
insilmaril@753
|
422 |
|
insilmaril@753
|
423 |
|
insilmaril@753
|
424 |
if ( ((BranchItem*)treeItem)->hasScrolledParent((BranchItem*)treeItem))
|
insilmaril@753
|
425 |
setVisibility (false);
|
insilmaril@753
|
426 |
else
|
insilmaril@753
|
427 |
setVisibility (true);
|
insilmaril@753
|
428 |
//FIXME-2 hidden=false;
|
insilmaril@753
|
429 |
}
|
insilmaril@753
|
430 |
|
insilmaril@753
|
431 |
*/
|
insilmaril@753
|
432 |
// And take care of my children
|
insilmaril@753
|
433 |
for (int i=0; i<branchCount(); ++i)
|
insilmaril@753
|
434 |
getBranchNum(i)->setHideTmp (mode);
|
insilmaril@753
|
435 |
}
|
insilmaril@753
|
436 |
|
insilmaril@753
|
437 |
bool TreeItem::hasHiddenExportParent()
|
insilmaril@753
|
438 |
{
|
insilmaril@753
|
439 |
// Calls parents recursivly to
|
insilmaril@753
|
440 |
// find out, if we or parents are temp. hidden
|
insilmaril@753
|
441 |
|
insilmaril@753
|
442 |
if (hidden || hideExport) return true;
|
insilmaril@753
|
443 |
|
insilmaril@753
|
444 |
if (parentItem)
|
insilmaril@753
|
445 |
return parentItem->hasHiddenExportParent();
|
insilmaril@753
|
446 |
else
|
insilmaril@753
|
447 |
return false;
|
insilmaril@753
|
448 |
}
|
insilmaril@753
|
449 |
|
insilmaril@753
|
450 |
|
insilmaril@753
|
451 |
void TreeItem::setHideInExport(bool b)
|
insilmaril@753
|
452 |
{
|
insilmaril@753
|
453 |
if (isBranchLikeType() )
|
insilmaril@753
|
454 |
{
|
insilmaril@753
|
455 |
hideExport=b;
|
insilmaril@753
|
456 |
/* FIXME-1 call setVis and updateContentsSize...
|
insilmaril@753
|
457 |
if (b)
|
insilmaril@753
|
458 |
systemFlags->activate("hideInExport");
|
insilmaril@753
|
459 |
else
|
insilmaril@753
|
460 |
systemFlags->deactivate("hideInExport");
|
insilmaril@753
|
461 |
calcBBoxSize();
|
insilmaril@753
|
462 |
positionBBox();
|
insilmaril@753
|
463 |
requestReposition();
|
insilmaril@753
|
464 |
*/
|
insilmaril@753
|
465 |
}
|
insilmaril@753
|
466 |
}
|
insilmaril@753
|
467 |
|
insilmaril@753
|
468 |
bool TreeItem::hideInExport()
|
insilmaril@753
|
469 |
{
|
insilmaril@753
|
470 |
return hideExport;
|
insilmaril@753
|
471 |
}
|
insilmaril@753
|
472 |
|
insilmaril@753
|
473 |
bool TreeItem::isHidden()
|
insilmaril@753
|
474 |
{
|
insilmaril@753
|
475 |
return hidden;
|
insilmaril@753
|
476 |
}
|
insilmaril@753
|
477 |
|
insilmaril@753
|
478 |
|
insilmaril@746
|
479 |
LinkableMapObj* TreeItem::getLMO() // FIXME-3 VM should be unnecessary in the end
|
insilmaril@726
|
480 |
{
|
insilmaril@726
|
481 |
return lmo;
|
insilmaril@726
|
482 |
}
|
insilmaril@726
|
483 |
|
insilmaril@726
|
484 |
void TreeItem::setLMO(LinkableMapObj *l)
|
insilmaril@726
|
485 |
{
|
insilmaril@726
|
486 |
lmo=l;
|
insilmaril@726
|
487 |
}
|
insilmaril@726
|
488 |
|