diff options
Diffstat (limited to 'kmail/favoritefolderview.cpp')
-rw-r--r-- | kmail/favoritefolderview.cpp | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/kmail/favoritefolderview.cpp b/kmail/favoritefolderview.cpp index abe223d8d..35b2e3ee4 100644 --- a/kmail/favoritefolderview.cpp +++ b/kmail/favoritefolderview.cpp @@ -42,28 +42,28 @@ #include <kpopupmenu.h> #include <kio/global.h> -#include <qheader.h> -#include <qtimer.h> +#include <tqheader.h> +#include <tqtimer.h> #include <cassert> using namespace KMail; -FavoriteFolderViewItem::FavoriteFolderViewItem(FavoriteFolderView * parent, const QString & name, KMFolder * folder) +FavoriteFolderViewItem::FavoriteFolderViewItem(FavoriteFolderView * parent, const TQString & name, KMFolder * folder) : KMFolderTreeItem( parent, name, folder ), mOldName( folder->label() ) { // same stuff as in KMFolderTreeItem again, this time even with virtual methods working init(); - connect( folder, SIGNAL(nameChanged()), SLOT(nameChanged()) ); - connect( folder, SIGNAL(iconsChanged()), SLOT(slotIconsChanged()) ); + connect( folder, TQT_SIGNAL(nameChanged()), TQT_SLOT(nameChanged()) ); + connect( folder, TQT_SIGNAL(iconsChanged()), TQT_SLOT(slotIconsChanged()) ); - connect( folder, SIGNAL(msgAdded(KMFolder*,Q_UINT32)), SLOT(updateCount()) ); - connect( folder, SIGNAL(numUnreadMsgsChanged(KMFolder*)), SLOT(updateCount()) ); - connect( folder, SIGNAL(msgRemoved(KMFolder*)), SLOT(updateCount()) ); - connect( folder, SIGNAL(folderSizeChanged( KMFolder* )), SLOT(updateCount()) ); + connect( folder, TQT_SIGNAL(msgAdded(KMFolder*,Q_UINT32)), TQT_SLOT(updateCount()) ); + connect( folder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)), TQT_SLOT(updateCount()) ); + connect( folder, TQT_SIGNAL(msgRemoved(KMFolder*)), TQT_SLOT(updateCount()) ); + connect( folder, TQT_SIGNAL(folderSizeChanged( KMFolder* )), TQT_SLOT(updateCount()) ); - QTimer::singleShot( 0, this, SLOT(updateCount()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(updateCount()) ); if ( unreadCount() > 0 ) setPixmap( 0, unreadIcon( iconSize() ) ); @@ -73,15 +73,15 @@ FavoriteFolderViewItem::FavoriteFolderViewItem(FavoriteFolderView * parent, cons void FavoriteFolderViewItem::nameChanged() { - QString txt = text( 0 ); + TQString txt = text( 0 ); txt.replace( mOldName, folder()->label() ); setText( 0, txt ); mOldName = folder()->label(); } -QValueList<FavoriteFolderView*> FavoriteFolderView::mInstances; +TQValueList<FavoriteFolderView*> FavoriteFolderView::mInstances; -FavoriteFolderView::FavoriteFolderView( KMMainWidget *mainWidget, QWidget * parent) : +FavoriteFolderView::FavoriteFolderView( KMMainWidget *mainWidget, TQWidget * parent) : FolderTreeBase( mainWidget, parent ), mContextMenuItem( 0 ), mReadingConfig( false ) @@ -97,25 +97,25 @@ FavoriteFolderView::FavoriteFolderView( KMMainWidget *mainWidget, QWidget * pare setSorting( -1 ); setShowSortIndicator( false ); - connect( this, SIGNAL(selectionChanged()), SLOT(selectionChanged()) ); - connect( this, SIGNAL(clicked(QListViewItem*)), SLOT(itemClicked(QListViewItem*)) ); - connect( this, SIGNAL(dropped(QDropEvent*,QListViewItem*)), SLOT(dropped(QDropEvent*,QListViewItem*)) ); - connect( this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint &, int)), - SLOT(contextMenu(QListViewItem*,const QPoint&)) ); - connect( this, SIGNAL(moved()), SLOT(notifyInstancesOnChange()) ); - connect( this, SIGNAL(triggerRefresh()), SLOT(refresh()) ); - - connect( kmkernel->folderMgr(), SIGNAL(changed()), SLOT(initializeFavorites()) ); - connect( kmkernel->dimapFolderMgr(), SIGNAL(changed()), SLOT(initializeFavorites()) ); - connect( kmkernel->imapFolderMgr(), SIGNAL(changed()), SLOT(initializeFavorites()) ); - connect( kmkernel->searchFolderMgr(), SIGNAL(changed()), SLOT(initializeFavorites()) ); - - connect( kmkernel->folderMgr(), SIGNAL(folderRemoved(KMFolder*)), SLOT(folderRemoved(KMFolder*)) ); - connect( kmkernel->dimapFolderMgr(), SIGNAL(folderRemoved(KMFolder*)), SLOT(folderRemoved(KMFolder*)) ); - connect( kmkernel->imapFolderMgr(), SIGNAL(folderRemoved(KMFolder*)), SLOT(folderRemoved(KMFolder*)) ); - connect( kmkernel->searchFolderMgr(), SIGNAL(folderRemoved(KMFolder*)), SLOT(folderRemoved(KMFolder*)) ); - - QFont f = font(); + connect( this, TQT_SIGNAL(selectionChanged()), TQT_SLOT(selectionChanged()) ); + connect( this, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(itemClicked(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(dropped(TQDropEvent*,TQListViewItem*)), TQT_SLOT(dropped(TQDropEvent*,TQListViewItem*)) ); + connect( this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint &, int)), + TQT_SLOT(contextMenu(TQListViewItem*,const TQPoint&)) ); + connect( this, TQT_SIGNAL(moved()), TQT_SLOT(notifyInstancesOnChange()) ); + connect( this, TQT_SIGNAL(triggerRefresh()), TQT_SLOT(refresh()) ); + + connect( kmkernel->folderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(initializeFavorites()) ); + connect( kmkernel->dimapFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(initializeFavorites()) ); + connect( kmkernel->imapFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(initializeFavorites()) ); + connect( kmkernel->searchFolderMgr(), TQT_SIGNAL(changed()), TQT_SLOT(initializeFavorites()) ); + + connect( kmkernel->folderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), TQT_SLOT(folderRemoved(KMFolder*)) ); + connect( kmkernel->dimapFolderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), TQT_SLOT(folderRemoved(KMFolder*)) ); + connect( kmkernel->imapFolderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), TQT_SLOT(folderRemoved(KMFolder*)) ); + connect( kmkernel->searchFolderMgr(), TQT_SIGNAL(folderRemoved(KMFolder*)), TQT_SLOT(folderRemoved(KMFolder*)) ); + + TQFont f = font(); f.setItalic( true ); setFont( f ); @@ -133,9 +133,9 @@ void FavoriteFolderView::readConfig() { mReadingConfig = true; clear(); - QValueList<int> folderIds = GlobalSettings::self()->favoriteFolderIds(); - QStringList folderNames = GlobalSettings::self()->favoriteFolderNames(); - QListViewItem *afterItem = 0; + TQValueList<int> folderIds = GlobalSettings::self()->favoriteFolderIds(); + TQStringList folderNames = GlobalSettings::self()->favoriteFolderNames(); + TQListViewItem *afterItem = 0; for ( uint i = 0; i < folderIds.count(); ++i ) { KMFolder *folder = kmkernel->folderMgr()->findById( folderIds[i] ); if ( !folder ) @@ -144,7 +144,7 @@ void FavoriteFolderView::readConfig() folder = kmkernel->dimapFolderMgr()->findById( folderIds[i] ); if ( !folder ) folder = kmkernel->searchFolderMgr()->findById( folderIds[i] ); - QString name; + TQString name; if ( folderNames.count() > i ) name = folderNames[i]; afterItem = addFolder( folder, name, afterItem ); @@ -153,7 +153,7 @@ void FavoriteFolderView::readConfig() ensureItemVisible( firstChild() ); // folder tree is not yet populated at this point - QTimer::singleShot( 0, this, SLOT(initializeFavorites()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(initializeFavorites()) ); readColorConfig(); mReadingConfig = false; @@ -161,9 +161,9 @@ void FavoriteFolderView::readConfig() void FavoriteFolderView::writeConfig() { - QValueList<int> folderIds; - QStringList folderNames; - for ( QListViewItemIterator it( this ); it.current(); ++it ) { + TQValueList<int> folderIds; + TQStringList folderNames; + for ( TQListViewItemIterator it( this ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); folderIds << fti->folder()->id(); folderNames << fti->text( 0 ); @@ -172,7 +172,7 @@ void FavoriteFolderView::writeConfig() GlobalSettings::self()->setFavoriteFolderNames( folderNames ); } -bool FavoriteFolderView::acceptDrag(QDropEvent * e) const +bool FavoriteFolderView::acceptDrag(TQDropEvent * e) const { KMFolderTree *ft = mainWidget()->folderTree(); assert( ft ); @@ -182,7 +182,7 @@ bool FavoriteFolderView::acceptDrag(QDropEvent * e) const return FolderTreeBase::acceptDrag( e ); } -KMFolderTreeItem* FavoriteFolderView::addFolder(KMFolder * folder, const QString &name, QListViewItem *after) +KMFolderTreeItem* FavoriteFolderView::addFolder(KMFolder * folder, const TQString &name, TQListViewItem *after) { if ( !folder ) return 0; @@ -219,10 +219,10 @@ void FavoriteFolderView::handleGroupwareFolder( KMFolderTreeItem *fti ) break; case KMail::ContentsTypeNote: { - QByteArray arg; - QDataStream s( arg, IO_WriteOnly ); - s << QString( "kontact_knotesplugin" ); - kapp->dcopClient()->send( "kontact", "KontactIface", "selectPlugin(QString)", arg ); + TQByteArray arg; + TQDataStream s( arg, IO_WriteOnly ); + s << TQString( "kontact_knotesplugin" ); + kapp->dcopClient()->send( "kontact", "KontactIface", "selectPlugin(TQString)", arg ); break; } case KMail::ContentsTypeCalendar: @@ -230,25 +230,25 @@ void FavoriteFolderView::handleGroupwareFolder( KMFolderTreeItem *fti ) case KMail::ContentsTypeJournal: { KMail::KorgHelper::ensureRunning(); - QByteArray arg; - QDataStream s( arg, IO_WriteOnly ); + TQByteArray arg; + TQDataStream s( arg, IO_WriteOnly ); switch ( fti->folder()->storage()->contentsType() ) { case KMail::ContentsTypeCalendar: - s << QString( "kontact_korganizerplugin" ); break; + s << TQString( "kontact_korganizerplugin" ); break; case KMail::ContentsTypeTask: - s << QString( "kontact_todoplugin" ); break; + s << TQString( "kontact_todoplugin" ); break; case KMail::ContentsTypeJournal: - s << QString( "kontact_journalplugin" ); break; + s << TQString( "kontact_journalplugin" ); break; default: assert( false ); } - kapp->dcopClient()->send( "kontact", "KontactIface", "selectPlugin(QString)", arg ); + kapp->dcopClient()->send( "kontact", "KontactIface", "selectPlugin(TQString)", arg ); break; } default: break; } } -void FavoriteFolderView::itemClicked(QListViewItem * item) +void FavoriteFolderView::itemClicked(TQListViewItem * item) { if ( !item ) return; if ( !item->isSelected() ) @@ -261,7 +261,7 @@ void FavoriteFolderView::folderTreeSelectionChanged(KMFolder * folder) { blockSignals( true ); bool found = false; - for ( QListViewItemIterator it( this ); it.current(); ++it ) { + for ( TQListViewItemIterator it( this ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); if ( fti->folder() == folder && !fti->isSelected() ) { fti->setSelected( true ); @@ -284,8 +284,8 @@ void FavoriteFolderView::folderTreeSelectionChanged(KMFolder * folder) void FavoriteFolderView::folderRemoved(KMFolder * folder) { - QValueList<KMFolderTreeItem*> delItems; - for ( QListViewItemIterator it( this ); it.current(); ++it ) { + TQValueList<KMFolderTreeItem*> delItems; + for ( TQListViewItemIterator it( this ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); if ( fti->folder() == folder ) delItems << fti; @@ -297,13 +297,13 @@ void FavoriteFolderView::folderRemoved(KMFolder * folder) removeFromFolderToItemMap(folder); } -void FavoriteFolderView::dropped(QDropEvent * e, QListViewItem * after) +void FavoriteFolderView::dropped(TQDropEvent * e, TQListViewItem * after) { - QListViewItem* afterItem = after; + TQListViewItem* afterItem = after; KMFolderTree *ft = mainWidget()->folderTree(); assert( ft ); if ( e->source() == ft->viewport() && e->provides( "application/x-qlistviewitem" ) ) { - for ( QListViewItemIterator it( ft ); it.current(); ++it ) { + for ( TQListViewItemIterator it( ft ); it.current(); ++it ) { if ( !it.current()->isSelected() ) continue; KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); @@ -315,7 +315,7 @@ void FavoriteFolderView::dropped(QDropEvent * e, QListViewItem * after) } } -void FavoriteFolderView::contextMenu(QListViewItem * item, const QPoint & point) +void FavoriteFolderView::contextMenu(TQListViewItem * item, const TQPoint & point) { KMFolderTree *ft = mainWidget()->folderTree(); assert( ft ); @@ -324,8 +324,8 @@ void FavoriteFolderView::contextMenu(QListViewItem * item, const QPoint & point) KPopupMenu contextMenu; if ( fti && fti->folder() ) { contextMenu.insertItem( SmallIconSet("editdelete"), i18n("Remove From Favorites"), - this, SLOT(removeFolder()) ); - contextMenu.insertItem( SmallIconSet("edit"), i18n("Rename Favorite"), this, SLOT(renameFolder()) ); + this, TQT_SLOT(removeFolder()) ); + contextMenu.insertItem( SmallIconSet("edit"), i18n("Rename Favorite"), this, TQT_SLOT(renameFolder()) ); contextMenu.insertSeparator(); mainWidget()->action("mark_all_as_read")->plug( &contextMenu ); @@ -334,12 +334,12 @@ void FavoriteFolderView::contextMenu(QListViewItem * item, const QPoint & point) if ( fti->folder()->isMailingListEnabled() ) mainWidget()->action("post_message")->plug( &contextMenu ); - contextMenu.insertItem( SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), fti, SLOT(assignShortcut()) ); - contextMenu.insertItem( i18n("Expire..."), fti, SLOT(slotShowExpiryProperties()) ); + contextMenu.insertItem( SmallIconSet("configure_shortcuts"), i18n("&Assign Shortcut..."), fti, TQT_SLOT(assignShortcut()) ); + contextMenu.insertItem( i18n("Expire..."), fti, TQT_SLOT(slotShowExpiryProperties()) ); mainWidget()->action("modify")->plug( &contextMenu ); } else { contextMenu.insertItem( SmallIconSet("bookmark_add"), i18n("Add Favorite Folder..."), - this, SLOT(addFolder()) ); + this, TQT_SLOT(addFolder()) ); } contextMenu.exec( point, 0 ); } @@ -353,10 +353,10 @@ void FavoriteFolderView::removeFolder() void FavoriteFolderView::initializeFavorites() { - QValueList<int> seenInboxes = GlobalSettings::self()->favoriteFolderViewSeenInboxes(); + TQValueList<int> seenInboxes = GlobalSettings::self()->favoriteFolderViewSeenInboxes(); KMFolderTree *ft = mainWidget()->folderTree(); assert( ft ); - for ( QListViewItemIterator it( ft ); it.current(); ++it ) { + for ( TQListViewItemIterator it( ft ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); if ( fti->type() == KFolderTreeItem::Inbox && fti->folder() && !seenInboxes.contains( fti->folder()->id() ) ) { seenInboxes.append( fti->folder()->id() ); @@ -375,19 +375,19 @@ void FavoriteFolderView::renameFolder() if ( !mContextMenuItem ) return; bool ok; - QString name = KInputDialog::getText( i18n("Rename Favorite"), i18n("Name"), mContextMenuItem->text( 0 ), &ok, this ); + TQString name = KInputDialog::getText( i18n("Rename Favorite"), i18n("Name"), mContextMenuItem->text( 0 ), &ok, this ); if ( !ok ) return; mContextMenuItem->setText( 0, name ); notifyInstancesOnChange(); } -QString FavoriteFolderView::prettyName(KMFolderTreeItem * fti) +TQString FavoriteFolderView::prettyName(KMFolderTreeItem * fti) { assert( fti ); assert( fti->folder() ); - QString name = fti->folder()->label(); - QListViewItem *accountFti = fti; + TQString name = fti->folder()->label(); + TQListViewItem *accountFti = fti; while ( accountFti->parent() ) accountFti = accountFti->parent(); if ( fti->type() == KFolderTreeItem::Inbox ) { @@ -406,7 +406,7 @@ QString FavoriteFolderView::prettyName(KMFolderTreeItem * fti) return name; } -void FavoriteFolderView::contentsDragEnterEvent(QDragEnterEvent * e) +void FavoriteFolderView::contentsDragEnterEvent(TQDragEnterEvent * e) { if ( e->provides( "application/x-qlistviewitem" ) ) { setDropVisualizer( true ); @@ -427,21 +427,21 @@ void FavoriteFolderView::readColorConfig() KConfig* conf = KMKernel::config(); // Custom/System color support KConfigGroupSaver saver(conf, "Reader"); - QColor c = KGlobalSettings::alternateBackgroundColor(); + TQColor c = KGlobalSettings::alternateBackgroundColor(); if ( !conf->readBoolEntry("defaultColors", true) ) mPaintInfo.colBack = conf->readColorEntry( "AltBackgroundColor",&c ); else mPaintInfo.colBack = c; - QPalette newPal = palette(); - newPal.setColor( QColorGroup::Base, mPaintInfo.colBack ); + TQPalette newPal = palette(); + newPal.setColor( TQColorGroup::Base, mPaintInfo.colBack ); setPalette( newPal ); } void FavoriteFolderView::addFolder() { KMFolderSelDlg dlg( mainWidget(), i18n("Add Favorite Folder"), false ); - if ( dlg.exec() != QDialog::Accepted ) + if ( dlg.exec() != TQDialog::Accepted ) return; KMFolder *folder = dlg.folder(); if ( !folder ) @@ -462,7 +462,7 @@ KMFolderTreeItem * FavoriteFolderView::findFolderTreeItem(KMFolder * folder) con assert( folder ); KMFolderTree *ft = mainWidget()->folderTree(); assert( ft ); - for ( QListViewItemIterator it( ft ); it.current(); ++it ) { + for ( TQListViewItemIterator it( ft ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); if ( fti->folder() == folder ) return fti; @@ -473,7 +473,7 @@ KMFolderTreeItem * FavoriteFolderView::findFolderTreeItem(KMFolder * folder) con void FavoriteFolderView::checkMail() { bool found = false; - for ( QListViewItemIterator it( this ); it.current(); ++it ) { + for ( TQListViewItemIterator it( this ); it.current(); ++it ) { KMFolderTreeItem *fti = static_cast<KMFolderTreeItem*>( it.current() ); if ( fti->folder()->folderType() == KMFolderTypeImap || fti->folder()->folderType() == KMFolderTypeCachedImap ) { if ( !found ) @@ -496,7 +496,7 @@ void FavoriteFolderView::notifyInstancesOnChange() if ( mReadingConfig ) return; writeConfig(); - for ( QValueList<FavoriteFolderView*>::ConstIterator it = mInstances.begin(); it != mInstances.end(); ++it ) { + for ( TQValueList<FavoriteFolderView*>::ConstIterator it = mInstances.begin(); it != mInstances.end(); ++it ) { if ( (*it) == this || (*it)->mReadingConfig ) continue; (*it)->readConfig(); @@ -505,7 +505,7 @@ void FavoriteFolderView::notifyInstancesOnChange() void FavoriteFolderView::refresh() { - for ( QListViewItemIterator it( this ) ; it.current() ; ++it ) { + for ( TQListViewItemIterator it( this ) ; it.current() ; ++it ) { KMFolderTreeItem* fti = static_cast<KMFolderTreeItem*>(it.current()); if (!fti || !fti->folder()) continue; |