diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kmail/kmfoldertree.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmfoldertree.cpp')
-rw-r--r-- | kmail/kmfoldertree.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/kmail/kmfoldertree.cpp b/kmail/kmfoldertree.cpp index 86dab4126..edd641cc9 100644 --- a/kmail/kmfoldertree.cpp +++ b/kmail/kmfoldertree.cpp @@ -51,10 +51,10 @@ using namespace KPIM; //============================================================================= -KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name, KFolderTreeItem::Protocol protocol ) - : TQObject( parent, name.latin1() ), - KFolderTreeItem( parent, name, protocol, Root ), + : TQObject( tqparent, name.latin1() ), + KFolderTreeItem( tqparent, name, protocol, Root ), mFolder( 0 ), mNeedsRepaint( true ) { init(); @@ -62,10 +62,10 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, } //----------------------------------------------------------------------------- -KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTree *tqparent, const TQString & name, KMFolder* folder ) - : TQObject( parent, name.latin1() ), - KFolderTreeItem( parent, name ), + : TQObject( tqparent, name.latin1() ), + KFolderTreeItem( tqparent, name ), mFolder( folder ), mNeedsRepaint( true ) { init(); @@ -73,10 +73,10 @@ KMFolderTreeItem::KMFolderTreeItem( KFolderTree *parent, const TQString & name, } //----------------------------------------------------------------------------- -KMFolderTreeItem::KMFolderTreeItem( KFolderTreeItem *parent, const TQString & name, +KMFolderTreeItem::KMFolderTreeItem( KFolderTreeItem *tqparent, const TQString & name, KMFolder* folder ) : TQObject( 0, name.latin1() ), - KFolderTreeItem( parent, name ), + KFolderTreeItem( tqparent, name ), mFolder( folder ), mNeedsRepaint( true ) { init(); @@ -136,7 +136,7 @@ TQPixmap KMFolderTreeItem::normalIcon(int size) const } // non-root search folders if ( protocol() == KMFolderTreeItem::Search ) { - icon = "mail_find"; + icon = "mail_tqfind"; } if ( mFolder && mFolder->noContent() ) { icon = "folder_grey"; @@ -373,9 +373,9 @@ void KMFolderTreeItem::updateCount() //============================================================================= -KMFolderTree::KMFolderTree( KMMainWidget *mainWidget, TQWidget *parent, +KMFolderTree::KMFolderTree( KMMainWidget *mainWidget, TQWidget *tqparent, const char *name ) - : KMail::FolderTreeBase( mainWidget, parent, name ) + : KMail::FolderTreeBase( mainWidget, tqparent, 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* parent ) +void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* tqparent ) { for ( KMFolderNode * node = fdir->first() ; node ; node = fdir->next() ) { if ( node->isDir() ) @@ -720,7 +720,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* parent ) KMFolder * folder = static_cast<KMFolder*>(node); KMFolderTreeItem * fti = 0; - if (!parent) + if (!tqparent) { // create new root-item, but only if this is not the root of a // "groupware folders only" account @@ -742,8 +742,8 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* parent ) } // create new child - fti = new KMFolderTreeItem( parent, folder->label(), folder ); - // set folders explicitely to exandable when they have children + fti = new KMFolderTreeItem( tqparent, 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 if ( folder->storage()->hasChildren() == FolderStorage::HasChildren ) { @@ -757,7 +757,7 @@ void KMFolderTree::addDirectory( KMFolderDir *fdir, KMFolderTreeItem* parent ) addDirectory( folder->child(), fti ); } - // Check if this is an IMAP resource folder or a no-content parent only + // Check if this is an IMAP resource folder or a no-content tqparent 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 * parent = fti->parent() ; parent ; parent = parent->parent() ) - parent->setOpen( true ); + for ( TQListViewItem * tqparent = fti->tqparent() ; tqparent ; tqparent = tqparent->tqparent() ) + tqparent->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->parent()))) + && !fti->tqparent()))) { 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->parent() && !multiFolder) + if (fti->folder() && fti->tqparent() && !multiFolder) { folderMenu->insertItem(SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), @@ -1230,7 +1230,7 @@ void KMFolderTree::contentsMouseReleaseEvent(TQMouseEvent* me) } // react on middle-button only - if (btn != Qt::MidButton) { + if (btn != TQt::MidButton) { KFolderTree::contentsMouseReleaseEvent(me); return; } @@ -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 * parent ) +void KMFolderTree::addChildFolder( KMFolder *folder, TQWidget * tqparent ) { KMFolder *aFolder = folder; if ( !aFolder ) { @@ -1286,8 +1286,8 @@ void KMFolderTree::addChildFolder( KMFolder *folder, TQWidget * parent ) } } - if ( parent ) - ( new KMail::NewFolderDialog( parent, aFolder ) )->exec(); + if ( tqparent ) + ( new KMail::NewFolderDialog( tqparent, aFolder ) )->exec(); else ( new KMail::NewFolderDialog( this, aFolder ) )->show(); return; @@ -1392,7 +1392,7 @@ void KMFolderTree::cleanupConfigFile() { if ((*grpIt).left(7) != "Folder-") continue; name = (*grpIt).mid(7); - if (folderMap.find(name) == folderMap.end()) + if (folderMap.tqfind(name) == folderMap.end()) { KMFolder* folder = kmkernel->findFolderById( name ); if ( folder ) { @@ -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 parent, set fti to 0 so nothing is done - if (source == fti->folder() || source->parent()->owner() == fti->folder()) fti = 0; + // 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 (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->parent() ) ) + fti->tqparent() ) ) return; if ( folder->getSubfolderState() == KMFolderImap::imapNoInformation ) { - // check if all parents are expanded - TQListViewItem *parent = item->parent(); - while ( parent ) + // check if all tqparents are expanded + TQListViewItem *tqparent = item->tqparent(); + while ( tqparent ) { - if ( !parent->isOpen() ) + if ( !tqparent->isOpen() ) return; - parent = parent->parent(); + tqparent = tqparent->tqparent(); } // the tree will be reloaded after that bool success = folder->listDirectory(); if (!success) fti->setOpen( false ); - if ( fti->childCount() == 0 && fti->parent() ) + if ( fti->childCount() == 0 && fti->tqparent() ) 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* parent = &(kmkernel->folderMgr()->dir()); + KMFolderDir* tqparent = &(kmkernel->folderMgr()->dir()); if ( destination ) - parent = destination->createChildFolder(); + tqparent = destination->createChildFolder(); TQStringList sourceFolderNames; @@ -1985,7 +1985,7 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source if ( source ) sourceFolderName = source->label(); - if ( parent->hasNamedFolder( sourceFolderName ) || sourceFolderNames.tqcontains( sourceFolderName ) ) { + if ( tqparent->hasNamedFolder( sourceFolderName ) || sourceFolderNames.tqcontains( 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>") .arg( sourceFolderName ) ); setDragEnabled( true ); @@ -2002,19 +2002,19 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source setDragEnabled( true ); return; } - if ( f->parent() ) - f = f->parent()->owner(); + if ( f->tqparent() ) + f = f->tqparent()->owner(); } TQString message = i18n( "<qt>Cannot move or copy folder <b>%1</b> into a subfolder below itself.</qt>" ). arg( sourceFolderName ); - KMFolderDir* folderDir = parent; + KMFolderDir* folderDir = tqparent; // check that the folder can be moved if ( source && source->child() ) { while ( folderDir && ( folderDir != &kmkernel->folderMgr()->dir() ) && - ( folderDir != source->parent() ) ) + ( folderDir != source->tqparent() ) ) { if ( folderDir->findRef( source ) != -1 ) { @@ -2022,19 +2022,19 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source setDragEnabled( true ); return; } - folderDir = folderDir->parent(); + folderDir = folderDir->tqparent(); } } - if( source && source->child() && parent && - ( parent->path().find( source->child()->path() + "/" ) == 0 ) ) { + if( source && source->child() && tqparent && + ( tqparent->path().tqfind( source->child()->path() + "/" ) == 0 ) ) { KMessageBox::error( this, message ); setDragEnabled( true ); return; } if( source && source->child() - && ( parent == source->child() ) ) { + && ( tqparent == source->child() ) ) { KMessageBox::error( this, message ); setDragEnabled( true ); return; @@ -2043,20 +2043,20 @@ void KMFolderTree::moveOrCopyFolder( TQValueList<TQGuardedPtr<KMFolder> > source // check if the source folders are independent of each other for ( TQValueList<TQGuardedPtr<KMFolder> >::ConstIterator it = sources.constBegin(); move && it != sources.constEnd(); ++it ) { - KMFolderDir *parentDir = (*it)->child(); - if ( !parentDir ) + KMFolderDir *tqparentDir = (*it)->child(); + if ( !tqparentDir ) continue; for ( TQValueList<TQGuardedPtr<KMFolder> >::ConstIterator it2 = sources.constBegin(); it2 != sources.constEnd(); ++it2 ) { if ( *it == *it2 ) continue; - KMFolderDir *childDir = (*it2)->parent(); + KMFolderDir *childDir = (*it2)->tqparent(); do { - if ( parentDir == childDir || parentDir->findRef( childDir->owner() ) != -1 ) { + if ( tqparentDir == childDir || tqparentDir->findRef( childDir->owner() ) != -1 ) { KMessageBox::error( this, i18n("Moving the selected folders is not possible") ); setDragEnabled( true ); return; } - childDir = childDir->parent(); + childDir = childDir->tqparent(); } 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, parent ); + kmkernel->folderMgr()->moveFolder( source, tqparent ); } else { - kmkernel->folderMgr()->copyFolder( source, parent ); + kmkernel->folderMgr()->copyFolder( source, tqparent ); } } } @@ -2085,7 +2085,7 @@ TQDragObject * KMFolderTree::dragObject() { KMFolderTreeItem *item = static_cast<KMFolderTreeItem*> (itemAt(viewport()->mapFromGlobal(TQCursor::pos()))); - if ( !item || !item->parent() || !item->folder() ) // top-level items or something invalid + if ( !item || !item->tqparent() || !item->folder() ) // top-level items or something invalid return 0; mCopySourceFolders = selectedFolders(); |