@ -73,18 +73,18 @@ LogLine* LogLineTree::synchronizeAddedLines(View* view) {
* This code wasn ' t able to find Parent Log Lines in the addedList object
*/
/*
//We first add the new tq parent items
//We first add the new parent items
TQPtrListIterator < LogLine > it ( addedList ) ;
LogLine * line = it . current ( ) ;
kdDebug ( ) < < " Inserting " < < parents . count ( ) < < " tq parent log item" < < endl ;
kdDebug ( ) < < " Inserting " < < parents . count ( ) < < " parent log item" < < endl ;
int i = 0 ;
while ( line ! = NULL ) {
if ( line - > isParentLogLine ( ) = = true ) {
ParentLogLine * tq parent= ( ParentLogLine * ) ( line ) ;
tq parent- > insertItem ( view - > getLogList ( ) ) ;
ParentLogLine * parent= ( ParentLogLine * ) ( line ) ;
parent- > insertItem ( view - > getLogList ( ) ) ;
addedList . remove ( it . current ( ) ) ;
+ + i ;
@ -95,18 +95,18 @@ LogLine* LogLineTree::synchronizeAddedLines(View* view) {
line = it . current ( ) ;
}
kdDebug ( ) < < " Insertion of " < < i < < " tq parent log items" < < endl ;
kdDebug ( ) < < " Insertion of " < < i < < " parent log items" < < endl ;
*/
kdDebug ( ) < < " Adding tq parent items to the tree..." < < endl ;
kdDebug ( ) < < " Adding parent items to the tree..." < < endl ;
//We first add the new tq parent items
//We first add the new parent items
TQPtrListIterator < ParentLogLine > it ( parents ) ;
LogLine * line = it . current ( ) ;
while ( line ! = NULL ) {
//Even if the tq parent has already been added, it will automatically be added once time
//Even if the parent has already been added, it will automatically be added once time
line - > insertItem ( view - > getLogList ( ) ) ;
addedList . remove ( it . current ( ) ) ;
@ -126,29 +126,29 @@ bool LogLineTree::remove(LogLine* line) {
* - Only remove this line is it does not have any tqchildren left
*/
if ( line - > isParentLogLine ( ) = = true ) {
ParentLogLine * tq parent= ( ParentLogLine * ) line ;
ParentLogLine * parent= ( ParentLogLine * ) line ;
if ( tq parent- > hasChildren ( ) = = false ) {
parents . remove ( tq parent) ;
if ( parent- > hasChildren ( ) = = false ) {
parents . remove ( parent) ;
return ( LogLineList : : remove ( line ) ) ;
}
}
/**
* Child log line actions :
* - First remove the dependency from the tq parent
* - Remove tq parent if it does not have child left
* - First remove the dependency from the parent
* - Remove parent if it does not have child left
* - Finally remove child
*/
else if ( line - > isChildLogLine ( ) = = true ) {
ChildLogLine * child = ( ChildLogLine * ) line ;
ParentLogLine * tq parent= child - > getParent ( ) ;
tq parent- > removeChild ( child ) ;
ParentLogLine * parent= child - > getParent ( ) ;
parent- > removeChild ( child ) ;
//Remove tq parent if it does not have longer tqchildren
if ( tq parent- > hasChildren ( ) = = false ) {
parents . remove ( tq parent) ;
LogLineList : : remove ( tq parent) ;
//Remove parent if it does not have longer tqchildren
if ( parent- > hasChildren ( ) = = false ) {
parents . remove ( parent) ;
LogLineList : : remove ( parent) ;
}
//Remove the tqchildren
@ -164,12 +164,12 @@ bool LogLineTree::remove(LogLine* line) {
void LogLineTree : : insert ( LogLine * line ) {
TQPtrListIterator < ParentLogLine > it ( parents ) ;
ParentLogLine * tq parent= it . current ( ) ;
ParentLogLine * parent= it . current ( ) ;
bool insertion = false ;
while ( tq parent! = NULL ) {
insertion = tq parent- > isChild ( line ) ;
while ( parent! = NULL ) {
insertion = parent- > isChild ( line ) ;
if ( insertion = = true ) {
TQDate date = line - > getTime ( ) . date ( ) ;
@ -177,8 +177,8 @@ void LogLineTree::insert(LogLine* line) {
ChildLogLine * newChild = new ChildLogLine ( date , time , line - > getItemList ( ) , line - > getOriginalFile ( ) , line - > getLogLevel ( ) , line - > getType ( ) ) ;
tq parent- > addChild ( newChild ) ;
newChild - > setParent ( tq parent) ;
parent- > addChild ( newChild ) ;
newChild - > setParent ( parent) ;
//Insert this child by the classical way
LogLineList : : insert ( newChild ) ;
@ -189,14 +189,14 @@ void LogLineTree::insert(LogLine* line) {
}
+ + it ;
tq parent= it . current ( ) ;
parent= it . current ( ) ;
}
TQDate date = line - > getTime ( ) . date ( ) ;
TQTime time = line - > getTime ( ) . time ( ) ;
ParentLogLine * newParent = new ParentLogLine ( date , time , line - > getItemList ( ) , line - > getOriginalFile ( ) , line - > getLogLevel ( ) , line - > getType ( ) , this - > groupBy , this - > groupByColumn , this - > columns ) ;
//Insert this tq parent by the classical way
//Insert this parent by the classical way
LogLineList : : insert ( newParent ) ;
parents . append ( newParent ) ;