treemodel.cpp
changeset 750 ff3b01ce0960
parent 746 ee6b0f3a4c2f
child 754 db0ec4bcf416
     1.1 --- a/treemodel.cpp	Wed Apr 01 15:06:57 2009 +0000
     1.2 +++ b/treemodel.cpp	Thu Apr 02 09:46:29 2009 +0000
     1.3 @@ -3,6 +3,7 @@
     1.4  #include <iostream>
     1.5  using namespace std;
     1.6  
     1.7 +#include "branchitem.h"
     1.8  #include "treeitem.h"
     1.9  #include "treemodel.h"
    1.10  
    1.11 @@ -108,11 +109,11 @@
    1.12          return rootItem->columnCount();
    1.13  }
    1.14  
    1.15 -TreeItem* TreeModel::next(TreeItem* &current, TreeItem* &previous, int &d0)
    1.16 +BranchItem* TreeModel::next(BranchItem* &current, BranchItem* &previous, int &d0)
    1.17  {
    1.18  	// Walk through map beginning at current with previous==0
    1.19  	// Start at root, if current==NULL
    1.20 -	if (!current) current=rootItem;
    1.21 +	if (!current) current=(BranchItem*)rootItem;
    1.22  
    1.23  	// Are we just beginning to walk the map?
    1.24  	if (!previous)
    1.25 @@ -143,7 +144,7 @@
    1.26  	// Coming from below,
    1.27  	// Trying to go down again to siblings
    1.28  
    1.29 -	TreeItem *sibling=current->getBranchNum (previous->num()+1);
    1.30 +	BranchItem *sibling=current->getBranchNum (previous->num()+1);
    1.31  
    1.32  	if (sibling)
    1.33  	{	
    1.34 @@ -155,7 +156,7 @@
    1.35  
    1.36  	// Go up and try to find siblings of current
    1.37  	previous=current;
    1.38 -	current=current->parent();
    1.39 +	current=(BranchItem*)current->parent();
    1.40  
    1.41  	// Check if we still can go somewhere
    1.42  	if (!current) return current;