|
|
|
@ -58,7 +58,7 @@ void Node::insertNode( Node* child )
|
|
|
|
|
if ( lastParent != this ) {
|
|
|
|
|
// Recompute lastDirIndex.
|
|
|
|
|
for ( lastDirIndex = 0;
|
|
|
|
|
( lastDirIndex < childCount() ) && ( ((Node*)tqchildAt( lastDirIndex ))->getType() == TapeDirectoryNodeType );
|
|
|
|
|
( lastDirIndex < childCount() ) && ( ((Node*)childAt( lastDirIndex ))->getType() == TapeDirectoryNodeType );
|
|
|
|
|
lastDirIndex++ );
|
|
|
|
|
lastParent = this;
|
|
|
|
|
}
|
|
|
|
@ -83,7 +83,7 @@ void Node::insertNode( Node* child )
|
|
|
|
|
while ( min < max ) {
|
|
|
|
|
mid = ( max - min ) / 2 + min;
|
|
|
|
|
//mid = ( min + max ) / 2;
|
|
|
|
|
if ( child->getText().compare( tqchildAt( mid )->getText() ) < 0 ) {
|
|
|
|
|
if ( child->getText().compare( childAt( mid )->getText() ) < 0 ) {
|
|
|
|
|
max = mid - 1;
|
|
|
|
|
} else {
|
|
|
|
|
min = mid + 1;
|
|
|
|
@ -94,8 +94,8 @@ void Node::insertNode( Node* child )
|
|
|
|
|
// KLUDGE!
|
|
|
|
|
mid -= 5;
|
|
|
|
|
if ( mid < smin ) mid = smin;
|
|
|
|
|
if ( ((Node*)tqchildAt( mid ))->getType() != child->getType() ) mid++;
|
|
|
|
|
for ( ; ( mid <= smax ) && ( child->getText().compare( tqchildAt( mid )->getText() ) > 0 ); mid++ );
|
|
|
|
|
if ( ((Node*)childAt( mid ))->getType() != child->getType() ) mid++;
|
|
|
|
|
for ( ; ( mid <= smax ) && ( child->getText().compare( childAt( mid )->getText() ) > 0 ); mid++ );
|
|
|
|
|
//printf( "index = %d, text = '%s'\n", mid, child->getText().data() );
|
|
|
|
|
insertChild( mid, child );
|
|
|
|
|
} else {
|
|
|
|
@ -181,14 +181,14 @@ bool TapeNode::validate()
|
|
|
|
|
// Remove deleted archives.
|
|
|
|
|
Archive* a;
|
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
|
a = ((ArchiveNode*)tqchildAt( j ))->getArchive();
|
|
|
|
|
a = ((ArchiveNode*)childAt( j ))->getArchive();
|
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( !i.current() ) {
|
|
|
|
|
removeChild( tqchildAt( j ) );
|
|
|
|
|
removeChild( childAt( j ) );
|
|
|
|
|
} else {
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
@ -235,8 +235,8 @@ ArchiveNode* TapeNode::findArchiveNode( Archive* archive )
|
|
|
|
|
{
|
|
|
|
|
ArchiveNode* n = 0;
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
if ( ((ArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
|
|
|
|
|
n = (ArchiveNode*)tqchildAt( i );
|
|
|
|
|
if ( ((ArchiveNode*)childAt( i ))->getArchive() == archive ) {
|
|
|
|
|
n = (ArchiveNode*)childAt( i );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -411,7 +411,7 @@ void SelectableNode::doUpdateState()
|
|
|
|
|
bool hasSelected = FALSE;
|
|
|
|
|
bool allSelected = TRUE;
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
switch ( ((SelectableNode*)tqchildAt( i ))->_state ) {
|
|
|
|
|
switch ( ((SelectableNode*)childAt( i ))->_state ) {
|
|
|
|
|
case SelAll:
|
|
|
|
|
oneSelected = TRUE;
|
|
|
|
|
hasSelected = TRUE;
|
|
|
|
@ -446,12 +446,12 @@ void SelectableNode::doSetSelected( bool select )
|
|
|
|
|
// All my tqchildren get the same selection state.
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
if ( select ) {
|
|
|
|
|
if ( !((SelectableNode*)tqchildAt( i ))->isSelected() ) {
|
|
|
|
|
((SelectableNode*)tqchildAt( i ))->doSetSelected( TRUE );
|
|
|
|
|
if ( !((SelectableNode*)childAt( i ))->isSelected() ) {
|
|
|
|
|
((SelectableNode*)childAt( i ))->doSetSelected( TRUE );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if ( ((SelectableNode*)tqchildAt( i ))->isSelected() || ((SelectableNode*)tqchildAt( i ))->hasSelectedChildren() ) {
|
|
|
|
|
((SelectableNode*)tqchildAt( i ))->doSetSelected( FALSE );
|
|
|
|
|
if ( ((SelectableNode*)childAt( i ))->isSelected() || ((SelectableNode*)childAt( i ))->hasSelectedChildren() ) {
|
|
|
|
|
((SelectableNode*)childAt( i ))->doSetSelected( FALSE );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -549,7 +549,7 @@ void SelectableNode::paintText( TQPainter* p, int indent, int cellHeight,
|
|
|
|
|
p->fontMetrics().leading()) / 2);
|
|
|
|
|
if (highlighted) {
|
|
|
|
|
paintHighlight(p, indent, cg, owner->hasFocus(),
|
|
|
|
|
(TQt::GUIStyle)owner->tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
|
|
|
|
|
(TQt::GUIStyle)owner->tqstyle().styleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
|
|
|
|
|
p->setPen(cg.base());
|
|
|
|
|
p->setBackgroundColor(cg.text());
|
|
|
|
|
}
|
|
|
|
@ -657,8 +657,8 @@ void MountedArchiveNode::setSelected( bool select )
|
|
|
|
|
// Deselect all other archives.
|
|
|
|
|
Node* parent = (Node*)getParent();
|
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
|
if ( parent->tqchildAt( i ) != this ) {
|
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
|
if ( parent->childAt( i ) != this ) {
|
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -757,8 +757,8 @@ void MountedTapeDirectoryNode::setSelected( bool select )
|
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
|
}
|
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
|
if ( parent->tqchildAt( i ) != arcNode ) {
|
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
|
if ( parent->childAt( i ) != arcNode ) {
|
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -863,8 +863,8 @@ void MountedTapeFileNode::setSelected( bool select )
|
|
|
|
|
parent = (Node*)parent->getParent();
|
|
|
|
|
}
|
|
|
|
|
for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
|
|
|
|
|
if ( parent->tqchildAt( i ) != arcNode ) {
|
|
|
|
|
((SelectableNode*)parent->tqchildAt( i ))->setSelected( FALSE );
|
|
|
|
|
if ( parent->childAt( i ) != arcNode ) {
|
|
|
|
|
((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1304,14 +1304,14 @@ void TapeDriveNode::slotTapeModified( Tape* tape )
|
|
|
|
|
// Remove deleted archives.
|
|
|
|
|
Archive* a;
|
|
|
|
|
for ( uint j = 0; j < childCount(); ) {
|
|
|
|
|
a = ((MountedArchiveNode*)tqchildAt( j ))->getArchive();
|
|
|
|
|
a = ((MountedArchiveNode*)childAt( j ))->getArchive();
|
|
|
|
|
for ( i.toFirst(); i.current(); ++i ) {
|
|
|
|
|
if ( i.current() == a ) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( !i.current() ) {
|
|
|
|
|
Node::removeChild( tqchildAt( j ) );
|
|
|
|
|
Node::removeChild( childAt( j ) );
|
|
|
|
|
} else {
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
@ -1322,8 +1322,8 @@ MountedArchiveNode* TapeDriveNode::findArchiveNode( Archive* archive )
|
|
|
|
|
{
|
|
|
|
|
MountedArchiveNode* n = 0;
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
if ( ((MountedArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
|
|
|
|
|
n = (MountedArchiveNode*)tqchildAt( i );
|
|
|
|
|
if ( ((MountedArchiveNode*)childAt( i ))->getArchive() == archive ) {
|
|
|
|
|
n = (MountedArchiveNode*)childAt( i );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1417,7 +1417,7 @@ TapeNode* TapeIndexRootNode::findTapeNode( Tape* tape )
|
|
|
|
|
{
|
|
|
|
|
TapeNode* n = 0;
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
n = (TapeNode*)tqchildAt( i );
|
|
|
|
|
n = (TapeNode*)childAt( i );
|
|
|
|
|
if ( n->getTape() == tape ) {
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
@ -1575,7 +1575,7 @@ BackupProfileNode* BackupProfileRootNode::findBackupProfileNode( BackupProfile*
|
|
|
|
|
{
|
|
|
|
|
BackupProfileNode* n = 0;
|
|
|
|
|
for ( uint i = 0; i < childCount(); i++ ) {
|
|
|
|
|
n = (BackupProfileNode*)tqchildAt( i );
|
|
|
|
|
n = (BackupProfileNode*)childAt( i );
|
|
|
|
|
if ( n->getBackupProfile() == backupProfile ) {
|
|
|
|
|
return n;
|
|
|
|
|
}
|
|
|
|
|