summaryrefslogtreecommitdiffstats
path: root/kdat/Node.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 20:34:22 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-18 20:34:22 +0000
commitb09bffed6b43262948018dfb0f11890850ddf7c1 (patch)
tree138696bfcc7ac01070d0e8ecaa1cdf94611a2bd8 /kdat/Node.cpp
parent6d43944a7130b9d1b4ae3fba37b774aced8612cf (diff)
downloadtdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.tar.gz
tdeadmin-b09bffed6b43262948018dfb0f11890850ddf7c1.zip
TQt4 port kdeadmin
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeadmin@1237416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdat/Node.cpp')
-rw-r--r--kdat/Node.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/kdat/Node.cpp b/kdat/Node.cpp
index 7e42855..7999c9d 100644
--- a/kdat/Node.cpp
+++ b/kdat/Node.cpp
@@ -58,7 +58,7 @@ void Node::insertNode( Node* child )
if ( lastParent != this ) {
// Recompute lastDirIndex.
for ( lastDirIndex = 0;
- ( lastDirIndex < childCount() ) && ( ((Node*)childAt( lastDirIndex ))->getType() == TapeDirectoryNodeType );
+ ( lastDirIndex < childCount() ) && ( ((Node*)tqchildAt( 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( childAt( mid )->getText() ) < 0 ) {
+ if ( child->getText().compare( tqchildAt( 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*)childAt( mid ))->getType() != child->getType() ) mid++;
- for ( ; ( mid <= smax ) && ( child->getText().compare( childAt( mid )->getText() ) > 0 ); mid++ );
+ if ( ((Node*)tqchildAt( mid ))->getType() != child->getType() ) mid++;
+ for ( ; ( mid <= smax ) && ( child->getText().compare( tqchildAt( 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*)childAt( j ))->getArchive();
+ a = ((ArchiveNode*)tqchildAt( j ))->getArchive();
for ( i.toFirst(); i.current(); ++i ) {
if ( i.current() == a ) {
break;
}
}
if ( !i.current() ) {
- removeChild( childAt( j ) );
+ removeChild( tqchildAt( j ) );
} else {
j++;
}
@@ -211,7 +211,7 @@ void TapeNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added
+ // We already have the tqchildren added
return;
}
@@ -235,8 +235,8 @@ ArchiveNode* TapeNode::findArchiveNode( Archive* archive )
{
ArchiveNode* n = 0;
for ( uint i = 0; i < childCount(); i++ ) {
- if ( ((ArchiveNode*)childAt( i ))->getArchive() == archive ) {
- n = (ArchiveNode*)childAt( i );
+ if ( ((ArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
+ n = (ArchiveNode*)tqchildAt( i );
break;
}
}
@@ -280,7 +280,7 @@ void ArchiveNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added.
+ // We already have the tqchildren added.
return;
}
@@ -311,7 +311,7 @@ TapeDirectoryNode::TapeDirectoryNode( File* file )
setDelayedExpanding( TRUE );
int len = _file->getName().length();
- int idx1 = _file->getName().findRev( '/', len - 2 );
+ int idx1 = _file->getName().tqfindRev( '/', len - 2 );
if ( idx1 < 0 ) {
setText( _file->getName().left( len - 1 ) );
} else {
@@ -338,7 +338,7 @@ void TapeDirectoryNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added.
+ // We already have the tqchildren added.
return;
}
@@ -372,7 +372,7 @@ TapeFileNode::TapeFileNode( File* file )
_file( file )
{
int len = _file->getName().length();
- int idx1 = _file->getName().findRev( '/', len - 1 );
+ int idx1 = _file->getName().tqfindRev( '/', len - 1 );
if ( idx1 < 0 ) {
setText( _file->getName().left( len ) );
} else {
@@ -411,7 +411,7 @@ void SelectableNode::doUpdateState()
bool hasSelected = FALSE;
bool allSelected = TRUE;
for ( uint i = 0; i < childCount(); i++ ) {
- switch ( ((SelectableNode*)childAt( i ))->_state ) {
+ switch ( ((SelectableNode*)tqchildAt( i ))->_state ) {
case SelAll:
oneSelected = TRUE;
hasSelected = TRUE;
@@ -443,15 +443,15 @@ void SelectableNode::doUpdateState()
void SelectableNode::doSetSelected( bool select )
{
- // All my children get the same selection state.
+ // All my tqchildren get the same selection state.
for ( uint i = 0; i < childCount(); i++ ) {
if ( select ) {
- if ( !((SelectableNode*)childAt( i ))->isSelected() ) {
- ((SelectableNode*)childAt( i ))->doSetSelected( TRUE );
+ if ( !((SelectableNode*)tqchildAt( i ))->isSelected() ) {
+ ((SelectableNode*)tqchildAt( i ))->doSetSelected( TRUE );
}
} else {
- if ( ((SelectableNode*)childAt( i ))->isSelected() || ((SelectableNode*)childAt( i ))->hasSelectedChildren() ) {
- ((SelectableNode*)childAt( i ))->doSetSelected( FALSE );
+ if ( ((SelectableNode*)tqchildAt( i ))->isSelected() || ((SelectableNode*)tqchildAt( i ))->hasSelectedChildren() ) {
+ ((SelectableNode*)tqchildAt( i ))->doSetSelected( FALSE );
}
}
}
@@ -482,7 +482,7 @@ const TQPixmap* SelectableNode::getSelectPixmap() const
bool SelectableNode::mousePressEvent( const TQPoint& point )
{
- if ( _selectRect.contains( point ) ) {
+ if ( _selectRect.tqcontains( point ) ) {
switch ( _state ) {
case SelAll:
setSelected( 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(),
- (Qt::GUIStyle)owner->style().styleHint(TQStyle::SH_GUIStyle)); // Qt3 doesn't make this easy ;)
+ (TQt::GUIStyle)owner->tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
p->setPen(cg.base());
p->setBackgroundColor(cg.text());
}
@@ -605,7 +605,7 @@ void SelectableNode::setSelected( bool select )
((SelectableNode*)getParent())->doUpdateState();
}
- owner->repaint();
+ owner->tqrepaint();
KDatMainWindow::getInstance()->configureUI( TapeManager::instance()->getMountedTape() );
}
@@ -655,10 +655,10 @@ void MountedArchiveNode::setSelected( bool select )
{
if ( select ) {
// Deselect all other archives.
- Node* parent = (Node*)getParent();
- for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
- if ( parent->childAt( i ) != this ) {
- ((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
+ Node* tqparent = (Node*)getParent();
+ for ( int i = tqparent->childCount() - 1; i >= 0; i-- ) {
+ if ( tqparent->tqchildAt( i ) != this ) {
+ ((SelectableNode*)tqparent->tqchildAt( i ))->setSelected( FALSE );
}
}
}
@@ -680,7 +680,7 @@ void MountedArchiveNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added.
+ // We already have the tqchildren added.
return;
}
@@ -713,7 +713,7 @@ MountedTapeDirectoryNode::MountedTapeDirectoryNode( File* file, int state )
setDelayedExpanding( TRUE );
int len = _file->getName().length();
- int idx1 = _file->getName().findRev( '/', len - 2 );
+ int idx1 = _file->getName().tqfindRev( '/', len - 2 );
if ( idx1 < 0 ) {
setText( _file->getName().left( len - 1 ) );
} else {
@@ -730,9 +730,9 @@ TQString MountedTapeDirectoryNode::getFullPath()
{
if ( _fullPath.length() == 0 ) {
_fullPath = getText() + "/";
- for ( Node* parent = (Node*)getParent(); !parent->isType( MountedArchiveNodeType ); parent = (Node*)parent->getParent() ) {
+ for ( Node* tqparent = (Node*)getParent(); !tqparent->isType( MountedArchiveNodeType ); tqparent = (Node*)tqparent->getParent() ) {
_fullPath.prepend( "/" );
- _fullPath.prepend( parent->getText() );
+ _fullPath.prepend( tqparent->getText() );
}
}
@@ -748,17 +748,17 @@ void MountedTapeDirectoryNode::setSelected( bool select )
{
if ( select ) {
// Deselect all other archives.
- Node* parent = (Node*)getParent();
+ Node* tqparent = (Node*)getParent();
Node* arcNode = 0;
- while ( !parent->isType( TapeDriveNodeType ) ) {
- if ( parent->isType( MountedArchiveNodeType ) ) {
- arcNode = parent;
+ while ( !tqparent->isType( TapeDriveNodeType ) ) {
+ if ( tqparent->isType( MountedArchiveNodeType ) ) {
+ arcNode = tqparent;
}
- parent = (Node*)parent->getParent();
+ tqparent = (Node*)tqparent->getParent();
}
- for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
- if ( parent->childAt( i ) != arcNode ) {
- ((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
+ for ( int i = tqparent->childCount() - 1; i >= 0; i-- ) {
+ if ( tqparent->tqchildAt( i ) != arcNode ) {
+ ((SelectableNode*)tqparent->tqchildAt( i ))->setSelected( FALSE );
}
}
}
@@ -780,7 +780,7 @@ void MountedTapeDirectoryNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added.
+ // We already have the tqchildren added.
return;
}
@@ -819,7 +819,7 @@ MountedTapeFileNode::MountedTapeFileNode( File* file, int state )
_file( file )
{
int len = _file->getName().length();
- int idx1 = _file->getName().findRev( '/', len - 1 );
+ int idx1 = _file->getName().tqfindRev( '/', len - 1 );
if ( idx1 < 0 ) {
setText( _file->getName().left( len ) );
} else {
@@ -836,9 +836,9 @@ TQString MountedTapeFileNode::getFullPath()
{
if ( _fullPath.length() == 0 ) {
_fullPath = getText();
- for ( Node* parent = (Node*)getParent(); !parent->isType( MountedArchiveNodeType ); parent = (Node*)parent->getParent() ) {
+ for ( Node* tqparent = (Node*)getParent(); !tqparent->isType( MountedArchiveNodeType ); tqparent = (Node*)tqparent->getParent() ) {
_fullPath.prepend( "/" );
- _fullPath.prepend( parent->getText() );
+ _fullPath.prepend( tqparent->getText() );
}
}
@@ -854,17 +854,17 @@ void MountedTapeFileNode::setSelected( bool select )
{
if ( select ) {
// Deselect all other archives.
- Node* parent = (Node*)getParent();
+ Node* tqparent = (Node*)getParent();
Node* arcNode = 0;
- while ( !parent->isType( TapeDriveNodeType ) ) {
- if ( parent->isType( MountedArchiveNodeType ) ) {
- arcNode = parent;
+ while ( !tqparent->isType( TapeDriveNodeType ) ) {
+ if ( tqparent->isType( MountedArchiveNodeType ) ) {
+ arcNode = tqparent;
}
- parent = (Node*)parent->getParent();
+ tqparent = (Node*)tqparent->getParent();
}
- for ( int i = parent->childCount() - 1; i >= 0; i-- ) {
- if ( parent->childAt( i ) != arcNode ) {
- ((SelectableNode*)parent->childAt( i ))->setSelected( FALSE );
+ for ( int i = tqparent->childCount() - 1; i >= 0; i-- ) {
+ if ( tqparent->tqchildAt( i ) != arcNode ) {
+ ((SelectableNode*)tqparent->tqchildAt( i ))->setSelected( FALSE );
}
}
}
@@ -934,7 +934,7 @@ void RootNode::expanding( bool expand )
{
expand = TRUE;
- // If we already have some children, check to see if the directory has been modified.
+ // If we already have some tqchildren, check to see if the directory has been modified.
if ( childCount() > 0 ) {
struct stat statinfo;
if ( stat( "/", &statinfo ) < 0 ) {
@@ -950,7 +950,7 @@ void RootNode::expanding( bool expand )
_mtime = statinfo.st_mtime;
- // Remove all the children.
+ // Remove all the tqchildren.
Node* n;
while ( ( n = (Node*)getChild() ) ) {
removeChild( n );
@@ -975,10 +975,10 @@ void RootNode::expanding( bool expand )
return;
}
- // Fill in the child's children.
- const QFileInfoList* list = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, TQDir::Name | TQDir::DirsFirst );
+ // Fill in the child's tqchildren.
+ const TQFileInfoList* list = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, TQDir::Name | TQDir::DirsFirst );
if ( list ) {
- QFileInfoListIterator it( *list );
+ TQFileInfoListIterator it( *list );
for ( ; it.current(); ++it ) {
if ( ( it.current()->fileName() != "." ) && ( it.current()->fileName() != ".." ) ) {
if ( it.current()->isDir() ) {
@@ -1050,7 +1050,7 @@ void DirectoryNode::expanding( bool expand )
}
path.prepend( "/" );
- // If we already have some children, check to see if the directory has been modified.
+ // If we already have some tqchildren, check to see if the directory has been modified.
if ( childCount() > 0 ) {
struct stat statinfo;
if ( stat( TQFile::encodeName(path), &statinfo ) < 0 ) {
@@ -1066,7 +1066,7 @@ void DirectoryNode::expanding( bool expand )
_mtime = statinfo.st_mtime;
- // Remove all the children.
+ // Remove all the tqchildren.
Node* n;
while ( ( n = (Node*)getChild() ) ) {
removeChild( n );
@@ -1091,10 +1091,10 @@ void DirectoryNode::expanding( bool expand )
return;
}
- // Fill in the child's children.
- const QFileInfoList* list = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, TQDir::Name | TQDir::DirsFirst );
+ // Fill in the child's tqchildren.
+ const TQFileInfoList* list = dir.entryInfoList( TQDir::Hidden | TQDir::Files | TQDir::Dirs, TQDir::Name | TQDir::DirsFirst );
if ( list ) {
- QFileInfoListIterator it( *list );
+ TQFileInfoListIterator it( *list );
for ( ; it.current(); ++it ) {
if ( ( it.current()->fileName() != "." ) && ( it.current()->fileName() != ".." ) ) {
if ( it.current()->isDir() ) {
@@ -1210,7 +1210,7 @@ void TapeDriveNode::expanding( bool expand )
expand = TRUE;
if ( childCount() > 0 ) {
- // We already have the children added
+ // We already have the tqchildren added
return;
}
@@ -1254,7 +1254,7 @@ void TapeDriveNode::slotTapeUnmounted()
setPixmap( *ImageCache::instance()->getTapeUnmounted() );
setText( i18n( "<no tape>" ) );
- // Remove all the children.
+ // Remove all the tqchildren.
Node* n;
while ( ( n = (Node*)getChild() ) ) {
Node::removeChild( n );
@@ -1304,14 +1304,14 @@ void TapeDriveNode::slotTapeModified( Tape* tape )
// Remove deleted archives.
Archive* a;
for ( uint j = 0; j < childCount(); ) {
- a = ((MountedArchiveNode*)childAt( j ))->getArchive();
+ a = ((MountedArchiveNode*)tqchildAt( j ))->getArchive();
for ( i.toFirst(); i.current(); ++i ) {
if ( i.current() == a ) {
break;
}
}
if ( !i.current() ) {
- Node::removeChild( childAt( j ) );
+ Node::removeChild( tqchildAt( j ) );
} else {
j++;
}
@@ -1322,8 +1322,8 @@ MountedArchiveNode* TapeDriveNode::findArchiveNode( Archive* archive )
{
MountedArchiveNode* n = 0;
for ( uint i = 0; i < childCount(); i++ ) {
- if ( ((MountedArchiveNode*)childAt( i ))->getArchive() == archive ) {
- n = (MountedArchiveNode*)childAt( i );
+ if ( ((MountedArchiveNode*)tqchildAt( i ))->getArchive() == archive ) {
+ n = (MountedArchiveNode*)tqchildAt( i );
break;
}
}
@@ -1417,7 +1417,7 @@ TapeNode* TapeIndexRootNode::findTapeNode( Tape* tape )
{
TapeNode* n = 0;
for ( uint i = 0; i < childCount(); i++ ) {
- n = (TapeNode*)childAt( i );
+ n = (TapeNode*)tqchildAt( 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*)childAt( i );
+ n = (BackupProfileNode*)tqchildAt( i );
if ( n->getBackupProfile() == backupProfile ) {
return n;
}