Various patches: Better windows support, branch sorting, Freedesktop support
authorinsilmaril
Mon, 22 Oct 2007 09:50:03 +0000
changeset 604f2aab2a9b6cb
parent 603 c73bb30448db
child 605 12e4596e7bb7
Various patches: Better windows support, branch sorting, Freedesktop support
branchobj.cpp
branchobj.h
     1.1 --- a/branchobj.cpp	Tue Oct 16 11:42:21 2007 +0000
     1.2 +++ b/branchobj.cpp	Mon Oct 22 09:50:03 2007 +0000
     1.3 @@ -1238,6 +1238,27 @@
     1.4  		return NULL;
     1.5  }
     1.6  
     1.7 +void BranchObj::sortChildren()
     1.8 +{
     1.9 +	int childCount=branch.count();
    1.10 +	int curChildIndex;
    1.11 +	bool madeChanges=false;
    1.12 +	do
    1.13 +	{
    1.14 +		madeChanges=false;
    1.15 +		for(curChildIndex=1;curChildIndex<childCount;curChildIndex++){
    1.16 +			BranchObj* curChild=(BranchObj*)branch.at(curChildIndex);
    1.17 +			BranchObj* prevChild=(BranchObj*)branch.at(curChildIndex-1);
    1.18 +			if(prevChild->heading->text().compare(curChild->heading->text())>0)
    1.19 +			{
    1.20 +				this->moveBranchUp(curChild);
    1.21 +				madeChanges=true;
    1.22 +			}
    1.23 +		}
    1.24 +	}while(madeChanges);
    1.25 +}
    1.26 +
    1.27 +
    1.28  BranchObj* BranchObj::linkTo (BranchObj* dst, int pos)
    1.29  {
    1.30  	// Find current parent and 
     2.1 --- a/branchobj.h	Tue Oct 16 11:42:21 2007 +0000
     2.2 +++ b/branchobj.h	Mon Oct 22 09:50:03 2007 +0000
     2.3 @@ -112,6 +112,7 @@
     2.4      virtual BranchObj* moveBranchUp(BranchObj*);
     2.5      virtual bool canMoveBranchDown();
     2.6      virtual BranchObj* moveBranchDown(BranchObj*);
     2.7 +    virtual void sortChildren();
     2.8      virtual BranchObj* linkTo (BranchObj*, int);
     2.9      virtual void alignRelativeTo(const QPointF );
    2.10  	virtual void reposition();