From: mkr Date: Wed, 20 Jun 2007 13:14:04 +0000 (+0000) Subject: Porting to Qt4. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15b936f3a09ff544cba21db6f15775a8fe258a1c;p=modules%2Fgui.git Porting to Qt4. --- diff --git a/src/SUIT/SUIT_TreeSync.h b/src/SUIT/SUIT_TreeSync.h index 61d8fde06..929255b36 100644 --- a/src/SUIT/SUIT_TreeSync.h +++ b/src/SUIT/SUIT_TreeSync.h @@ -20,8 +20,7 @@ #ifndef SUIT_TREE_SYNC_HEADER #define SUIT_TREE_SYNC_HEADER -#include -#include +#include /*! \struct DiffItem @@ -54,7 +53,7 @@ TrgItem synchronize( const SrcItem&, const TrgItem&, const TreeData& ); */ template void diffSiblings( const SrcItem&, const TrgItem&, - QValueList < DiffItem < SrcItem,TrgItem > >&, + QList < DiffItem < SrcItem,TrgItem > >&, const TreeData& ); /*! @@ -67,10 +66,10 @@ TrgItem createSubTree( const SrcItem&, const TrgItem&, const TrgItem&, const boo \brief find equal element in list */ template -const typename QValueList::const_iterator findEqual( const QValueList& l, - const typename QValueList::const_iterator& first, - const SrcItem& it, - const TreeData& td ); +const typename QList::const_iterator findEqual( const QList& l, + const typename QList::const_iterator& first, + const SrcItem& it, + const TreeData& td ); @@ -94,8 +93,8 @@ const typename QValueList::const_iterator findEqual( const QValueList void updateItem( const TrgItem& ) const - updates TrgItem without recreation
  • void deleteItemWithChildren( const TrgItem& ) const - deletes TrgItem with all children -
  • void children( const SrcItem&, QValueList& ) const - fills list with children -
  • void children( const TrgItem&, QValueList& ) const - fills list with children +
  • void children( const SrcItem&, QList& ) const - fills list with children +
  • void children( const TrgItem&, QList& ) const - fills list with children
  • SrcItem parent( const SrcItem& ) const - return parent SrcItem
  • TrgItem parent( const TrgItem& ) const - return parent SrcItem @@ -109,10 +108,10 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) td.updateItem( r1, r2 ); // iterate 'siblings' (direct children) - QValueList< DiffItem< SrcItem, TrgItem > > d; + QList< DiffItem< SrcItem, TrgItem > > d; diffSiblings( r1, r2, d, td ); - typename QValueList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end(); + typename QList< DiffItem< SrcItem, TrgItem > >::const_iterator anIt = d.begin(), aLast = d.end(); TrgItem lastItem = td.nullTrg(); // TrgItem tail = td.nullTrg(); for( ; anIt!=aLast; anIt++ ) @@ -162,12 +161,12 @@ TrgItem synchronize( const SrcItem& r1, const TrgItem& r2, const TreeData& td ) \param td - tree data object (provides auxiliary methods) */ template -const typename QValueList::const_iterator findEqual( const QValueList& l, - const typename QValueList::const_iterator& first, - const SrcItem& it, - const TreeData& td ) +const typename QList::const_iterator findEqual( const QList& l, + const typename QList::const_iterator& first, + const SrcItem& it, + const TreeData& td ) { - typename QValueList::const_iterator cur = first, last = l.end(); + typename QList::const_iterator cur = first, last = l.end(); for( ; cur!=last; cur++ ) if( td.isEqual( it, *cur ) ) return cur; @@ -183,28 +182,28 @@ const typename QValueList::const_iterator findEqual( const QValueList void diffSiblings( const SrcItem& src, const TrgItem& trg, - QValueList < DiffItem < SrcItem,TrgItem > >& d, + QList < DiffItem < SrcItem,TrgItem > >& d, const TreeData& td ) { //if( src==td.nullSrc() || trg==td.nullTrg() ) // return; - QValueList src_ch; - QValueList trg_ch; + QList src_ch; + QList trg_ch; td.children( src, src_ch ); td.children( trg, trg_ch ); - typename QValueList::const_iterator src_it = src_ch.begin(), src_last = src_ch.end(); - typename QValueList::const_iterator cur = trg_ch.begin(), trg_last = trg_ch.end(); + typename QList::const_iterator src_it = src_ch.begin(), src_last = src_ch.end(); + typename QList::const_iterator cur = trg_ch.begin(), trg_last = trg_ch.end(); for( ; src_it!=src_last; src_it++ ) { - typename QValueList::const_iterator f = + typename QList::const_iterator f = findEqual( trg_ch, cur, *src_it, td ); if( f!=trg_last ) //is found { //mark all items before found as "to be deleted" - for( typename QValueList::const_iterator it = cur; it!=f; it++ ) + for( typename QList::const_iterator it = cur; it!=f; it++ ) { DiffItem ndiff; ndiff.mySrc = td.nullSrc(); @@ -256,9 +255,9 @@ TrgItem createSubTree( const SrcItem& src, const TrgItem& parent, if( nitem==td.nullTrg() ) return nitem; - QValueList ch; + QList ch; td.children( src, ch ); - typename QValueList::const_iterator anIt = ch.begin(), aLast = ch.end(); + typename QList::const_iterator anIt = ch.begin(), aLast = ch.end(); for( ; anIt!=aLast; anIt++ ) createSubTree( *anIt, nitem, td.nullTrg(), false, td );