branchitem.cpp
changeset 753 25a77484ec72
parent 750 ff3b01ce0960
child 754 db0ec4bcf416
     1.1 --- a/branchitem.cpp	Thu Apr 02 09:57:47 2009 +0000
     1.2 +++ b/branchitem.cpp	Tue Apr 07 16:15:53 2009 +0000
     1.3 @@ -1,7 +1,10 @@
     1.4  #include "branchitem.h"
     1.5  #include "branchobj.h"
     1.6 +#include "vymmodel.h"
     1.7  
     1.8  #include <iostream>
     1.9 +#include <QDir>
    1.10 +
    1.11  using namespace std;
    1.12  
    1.13  BranchItem::BranchItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
    1.14 @@ -122,6 +125,47 @@
    1.15      return s;
    1.16  }
    1.17  
    1.18 +void BranchItem::updateVisibility()	// FIXME-1
    1.19 +{
    1.20 +}
    1.21 +
    1.22 +void BranchItem::setVymLink(QString s)
    1.23 +{
    1.24 +	if (!s.isEmpty())
    1.25 +	{
    1.26 +		// We need the relative (from loading) 
    1.27 +		// or absolute path (from User event)
    1.28 +		// and build the absolute path.
    1.29 +		// Note: If we have relative, use path of
    1.30 +		// current map to build absolute path
    1.31 +		QDir d(s);
    1.32 +		if (!d.path().startsWith ("/"))
    1.33 +		{
    1.34 +			QString p=model->getDestPath();
    1.35 +			int i=p.findRev("/",-1);
    1.36 +			d.setPath(p.left(i)+"/"+s);
    1.37 +			d.convertToAbs();
    1.38 +		}
    1.39 +		vymLink=d.path();
    1.40 +		//FIXME-2 systemFlags->activate("vymLink");
    1.41 +	}	
    1.42 +	else	
    1.43 +	{
    1.44 +		//FIXME-2 systemFlags->deactivate("vymLink");
    1.45 +		vymLink="";
    1.46 +	}	
    1.47 +	/* FIXME-2
    1.48 +	calcBBoxSize();			// recalculate bbox
    1.49 +    positionBBox();			// rearrange contents
    1.50 +	forceReposition();
    1.51 +	*/
    1.52 +}
    1.53 +
    1.54 +QString BranchItem::getVymLink()
    1.55 +{
    1.56 +	return vymLink;
    1.57 +}
    1.58 +
    1.59  void BranchItem::unScroll()
    1.60  {
    1.61  	if (tmpUnscrolled) resetTmpUnscroll();
    1.62 @@ -147,7 +191,7 @@
    1.63  			branch.at(i)->setVisibility(false);
    1.64  		*/	
    1.65  	}
    1.66 -	/*
    1.67 +	/*	
    1.68  	calcBBoxSize();
    1.69  	positionBBox();	
    1.70  	move (absPos.x(), absPos.y() );