diff options
Diffstat (limited to 'kmail/kmfoldertree.cpp')
-rw-r--r-- | kmail/kmfoldertree.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kmail/kmfoldertree.cpp b/kmail/kmfoldertree.cpp index 6a280856f..aef19abe4 100644 --- a/kmail/kmfoldertree.cpp +++ b/kmail/kmfoldertree.cpp @@ -51,10 +51,10 @@ using namespace KPIM; //============================================================================= -KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, KFolderTreeItem::Protocol protocol ) - : TQObject( tqparent, name.latin1() ), - KFolderTreeItem( tqparent, name, protocol, Root ), + : TQObject( parent, name.latin1() ), + KFolderTreeItem( parent, name, protocol, Root ), mFolder( 0 ), mNeedsRepaint( true ) { init(); @@ -62,10 +62,10 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name } //----------------------------------------------------------------------------- -KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, KMFolder* folder ) - : TQObject( tqparent, name.latin1() ), - KFolderTreeItem( tqparent, name ), + : TQObject( parent, name.latin1() ), + KFolderTreeItem( parent, name ), mFolder( folder ), mNeedsRepaint( true ) { init(); @@ -73,10 +73,10 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name } //----------------------------------------------------------------------------- -KMFolderTreeItem::KMFolderTreeItem( KFolderTreeItem *tqparent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTreeItem *parent, const TQString & name, KMFolder* folder ) : TQObject( 0, name.latin1() ), - KFolderTreeItem( tqparent, name ), + KFolderTreeItem( parent, name ), mFolder( folder ), mNeedsRepaint( true ) { init(); @@ -373,9 +373,9 @@ void KMFolderTreeItem::updateCount() //============================================================================= -KMFolderTree::KMFolderTree( KMMainWidget *mainWidget, TQWidget *tqparent, +KMFolderTree::KMFolderTree( KMMainWidget *mainWidget, TQWidget *parent, const char *name ) - : KMail::FolderTreeBase( mainWidget, tqparent, name ) + : KMail::FolderTreeBase( mainWidget, parent, name ) , mUpdateTimer( 0, "mUpdateTimer" ) , autoopen_timer( 0, "autoopen_timer" ) { @@ -712,7 +712,7 @@ void KMFolderTree::slotUpdateOneCount() //----------------------------------------------------------------------------- // Recursively add a directory of folders to the tree of folders -void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* tqparent ) +void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* parent ) { for ( KMFolderNode * node = fdir->first() ; node ; node = fdir->next() ) { if ( node->isDir() ) @@ -720,7 +720,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* tqparent ) KMFolder * folder = static_cast<KMFolder*>(node); KMFolderTreeItem * fti = 0; - if (!tqparent) + if (!parent) { // create new root-item, but only if this is not the root of a // "groupware folders only" account @@ -742,7 +742,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* tqparent ) } // create new child - fti = new KMFolderTreeItem( tqparent, folder->label(), folder ); + fti = new KMFolderTreeItem( parent, folder->label(), folder ); // set folders explicitely to exandable when they have tqchildren // this way we can do a listing for IMAP folders when the user expands them // even when the child folders are not created yet @@ -757,7 +757,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* tqparent ) addDirectory( folder->child(), fti ); } - // Check if this is an IMAP resource folder or a no-content tqparent only + // Check if this is an IMAP resource folder or a no-content parent only // containing groupware folders if ( (kmkernel->iCalIface().hideResourceFolder( folder ) || folder->noContent()) && fti->childCount() == 0 ) { @@ -858,8 +858,8 @@ void KMFolderTree::slotFolderRemoved(KMFolder *aFolder) // Methods for navigating folders with the keyboard void KMFolderTree::prepareItem( KMFolderTreeItem* fti ) { - for ( TQListViewItem * tqparent = fti->tqparent() ; tqparent ; tqparent = tqparent->tqparent() ) - tqparent->setOpen( true ); + for ( TQListViewItem * parent = fti->parent() ; parent ; parent = parent->parent() ) + parent->setOpen( true ); ensureItemVisible( fti ); } @@ -1086,7 +1086,7 @@ void KMFolderTree::slotContextMenuRequested( TQListViewItem *lvi, /* Treat the special case of the root and account folders */ if ((!fti->folder() || (fti->folder()->noContent() - && !fti->tqparent()))) + && !fti->parent()))) { TQString createChild = i18n("&New Subfolder..."); if (!fti->folder()) createChild = i18n("&New Folder..."); @@ -1184,7 +1184,7 @@ void KMFolderTree::slotContextMenuRequested( TQListViewItem *lvi, mMainWidget->action("post_message")->plug(folderMenu); } - if (fti->folder() && fti->tqparent() && !multiFolder) + if (fti->folder() && fti->parent() && !multiFolder) { folderMenu->insertItem(SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), @@ -1264,7 +1264,7 @@ static bool folderHasCreateRights( const KMFolder *folder ) //----------------------------------------------------------------------------- // Create a subfolder. // Requires creating the appropriate subdirectory and show a dialog -void KMFolderTree::addChildFolder( KMFolder *folder, TQWidget * tqparent ) +void KMFolderTree::addChildFolder( KMFolder *folder, TQWidget * parent ) { KMFolder *aFolder = folder; if ( !aFolder ) { @@ -1286,8 +1286,8 @@ void KMFolderTree::addChildFolder( KMFolder *folder, TQWidget * tqparent ) } } - if ( tqparent ) - ( new KMail::NewFolderDialog( tqparent, aFolder ) )->exec(); + if ( parent ) + ( new KMail::NewFolderDialog( parent, aFolder ) )->exec(); else ( new KMail::NewFolderDialog( this, aFolder ) )->show(); return; @@ -1522,8 +1522,8 @@ void KMFolderTree::contentsDropEvent( TQDropEvent *e ) if (fti && mCopySourceFolders.count() == 1) { KMFolder *source = mCopySourceFolders.first(); - // if we are dragging to ourselves or to our tqparent, set fti to 0 so nothing is done - if (source == fti->folder() || source->tqparent()->owner() == fti->folder()) fti = 0; + // if we are dragging to ourselves or to our parent, set fti to 0 so nothing is done + if (source == fti->folder() || source->parent()->owner() == fti->folder()) fti = 0; } if (fti && acceptDrag(e) && ( fti != oldSelected || e->source() != mMainWidget->headers()->viewport() ) ) { @@ -1583,22 +1583,22 @@ void KMFolderTree::slotFolderExpanded( TQListViewItem * item ) KMFolderImap *folder = static_cast<KMFolderImap*>( fti->folder()->storage() ); // if we should list all folders we limit this to the root folder if ( !folder->account() || ( !folder->account()->listOnlyOpenFolders() && - fti->tqparent() ) ) + fti->parent() ) ) return; if ( folder->getSubfolderState() == KMFolderImap::imapNoInformation ) { // check if all parents are expanded - TQListViewItem *tqparent = item->tqparent(); - while ( tqparent ) + TQListViewItem *parent = item->parent(); + while ( parent ) { - if ( !tqparent->isOpen() ) + if ( !parent->isOpen() ) return; - tqparent = tqparent->tqparent(); + parent = parent->parent(); } // the tree will be reloaded after that bool success = folder->listDirectory(); if (!success) fti->setOpen( false ); - if ( fti->childCount() == 0 && fti->tqparent() ) + if ( fti->childCount() == 0 && fti->parent() ) fti->setExpandable( false ); } } @@ -1970,9 +1970,9 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source // Disable drag during copy operation since it prevents from many crashes setDragEnabled( false ); - KMFolderDir* tqparent = &(kmkernel->folderMgr()->dir()); + KMFolderDir* parent = &(kmkernel->folderMgr()->dir()); if ( destination ) - tqparent = destination->createChildFolder(); + parent = destination->createChildFolder(); TQStringList sourceFolderNames; @@ -1985,7 +1985,7 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source if ( source ) sourceFolderName = source->label(); - if ( tqparent->hasNamedFolder( sourceFolderName ) || sourceFolderNames.contains( sourceFolderName ) ) { + if ( parent->hasNamedFolder( sourceFolderName ) || sourceFolderNames.contains( sourceFolderName ) ) { KMessageBox::error( this, i18n("<qt>Cannot move or copy folder <b>%1</b> here because a folder with the same name already exists.</qt>") .tqarg( sourceFolderName ) ); setDragEnabled( true ); @@ -2002,19 +2002,19 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source setDragEnabled( true ); return; } - if ( f->tqparent() ) - f = f->tqparent()->owner(); + if ( f->parent() ) + f = f->parent()->owner(); } TQString message = i18n( "<qt>Cannot move or copy folder <b>%1</b> into a subfolder below itself.</qt>" ). arg( sourceFolderName ); - KMFolderDir* folderDir = tqparent; + KMFolderDir* folderDir = parent; // check that the folder can be moved if ( source && source->child() ) { while ( folderDir && ( folderDir != &kmkernel->folderMgr()->dir() ) && - ( folderDir != source->tqparent() ) ) + ( folderDir != source->parent() ) ) { if ( folderDir->findRef( source ) != -1 ) { @@ -2022,19 +2022,19 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source setDragEnabled( true ); return; } - folderDir = folderDir->tqparent(); + folderDir = folderDir->parent(); } } - if( source && source->child() && tqparent && - ( tqparent->path().find( source->child()->path() + "/" ) == 0 ) ) { + if( source && source->child() && parent && + ( parent->path().find( source->child()->path() + "/" ) == 0 ) ) { KMessageBox::error( this, message ); setDragEnabled( true ); return; } if( source && source->child() - && ( tqparent == source->child() ) ) { + && ( parent == source->child() ) ) { KMessageBox::error( this, message ); setDragEnabled( true ); return; @@ -2049,14 +2049,14 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source for ( TQValueList<TQGuardedPtr<KMFolder> >::ConstIterator it2 = sources.constBegin(); it2 != sources.constEnd(); ++it2 ) { if ( *it == *it2 ) continue; - KMFolderDir *childDir = (*it2)->tqparent(); + KMFolderDir *childDir = (*it2)->parent(); do { if ( parentDir == childDir || parentDir->findRef( childDir->owner() ) != -1 ) { KMessageBox::error( this, i18n("Moving the selected folders is not possible") ); setDragEnabled( true ); return; } - childDir = childDir->tqparent(); + childDir = childDir->parent(); } while ( childDir && childDir != &kmkernel->folderMgr()->dir() ); } @@ -2074,9 +2074,9 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source if ( move ) { kdDebug(5006) << "move folder " << (source ? source->label(): "Unknown") << " to " << ( destination ? destination->label() : "Local Folders" ) << endl; - kmkernel->folderMgr()->moveFolder( source, tqparent ); + kmkernel->folderMgr()->moveFolder( source, parent ); } else { - kmkernel->folderMgr()->copyFolder( source, tqparent ); + kmkernel->folderMgr()->copyFolder( source, parent ); } } } @@ -2085,7 +2085,7 @@ TQDragObject * KMFolderTree::dragObject() { KMFolderTreeItem *item = static_cast<KMFolderTreeItem*> (itemAt(viewport()->mapFromGlobal(TQCursor::pos()))); - if ( !item || !item->tqparent() || !item->folder() ) // top-level items or something invalid + if ( !item || !item->parent() || !item->folder() ) // top-level items or something invalid return 0; mCopySourceFolders = selectedFolders(); |