diff options
Diffstat (limited to 'kmail/kmfoldercachedimap.cpp')
-rw-r--r-- | kmail/kmfoldercachedimap.cpp | 500 |
1 files changed, 250 insertions, 250 deletions
diff --git a/kmail/kmfoldercachedimap.cpp b/kmail/kmfoldercachedimap.cpp index 405176c4e..05f01b778 100644 --- a/kmail/kmfoldercachedimap.cpp +++ b/kmail/kmfoldercachedimap.cpp @@ -35,7 +35,7 @@ #include <errno.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> #include "kmkernel.h" #include "kmfoldercachedimap.h" @@ -69,15 +69,15 @@ using KMail::ListJob; #include <kconfig.h> #include <kio/global.h> #include <kio/scheduler.h> -#include <qbuffer.h> -#include <qbuttongroup.h> -#include <qcombobox.h> -#include <qfile.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qradiobutton.h> -#include <qvaluelist.h> +#include <tqbuffer.h> +#include <tqbuttongroup.h> +#include <tqcombobox.h> +#include <tqfile.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqradiobutton.h> +#include <tqvaluelist.h> #include "annotationjobs.h" #include "quotajobs.h" using namespace KMail; @@ -86,32 +86,32 @@ using namespace KMail; #define UIDCACHE_VERSION 1 #define MAIL_LOSS_DEBUGGING 0 -static QString incidencesForToString( KMFolderCachedImap::IncidencesFor r ) { +static TQString incidencesForToString( KMFolderCachedImap::IncidencesFor r ) { switch (r) { case KMFolderCachedImap::IncForNobody: return "nobody"; case KMFolderCachedImap::IncForAdmins: return "admins"; case KMFolderCachedImap::IncForReaders: return "readers"; } - return QString::null; // can't happen + return TQString::null; // can't happen } -static KMFolderCachedImap::IncidencesFor incidencesForFromString( const QString& str ) { +static KMFolderCachedImap::IncidencesFor incidencesForFromString( const TQString& str ) { if ( str == "nobody" ) return KMFolderCachedImap::IncForNobody; if ( str == "admins" ) return KMFolderCachedImap::IncForAdmins; if ( str == "readers" ) return KMFolderCachedImap::IncForReaders; return KMFolderCachedImap::IncForAdmins; // by default } -DImapTroubleShootDialog::DImapTroubleShootDialog( QWidget* parent, +DImapTroubleShootDialog::DImapTroubleShootDialog( TQWidget* parent, const char* name ) : KDialogBase( Plain, i18n( "Troubleshooting IMAP Cache" ), Ok | Cancel, Cancel, parent, name, true ), rc( None ) { - QFrame* page = plainPage(); - QVBoxLayout *topLayout = new QVBoxLayout( page, 0 ); + TQFrame* page = plainPage(); + TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0 ); // spell "lose" correctly. but don't cause a fuzzy. - QString txt = i18n( "<p><b>Troubleshooting the IMAP cache.</b></p>" + TQString txt = i18n( "<p><b>Troubleshooting the IMAP cache.</b></p>" "<p>If you have problems with synchronizing an IMAP " "folder, you should first try rebuilding the index " "file. This will take some time to rebuild, but will " @@ -127,36 +127,36 @@ DImapTroubleShootDialog::DImapTroubleShootDialog( QWidget* parent, "you can try refreshing the IMAP cache. If you do this, " "you will lose all your local changes for this folder " "and all its subfolders.</p>" ); - topLayout->addWidget( new QLabel( txt, page ) ); + topLayout->addWidget( new TQLabel( txt, page ) ); - QButtonGroup *group = new QButtonGroup( 0 ); + TQButtonGroup *group = new TQButtonGroup( 0 ); - mIndexButton = new QRadioButton( page ); + mIndexButton = new TQRadioButton( page ); mIndexButton->setText( i18n( "Rebuild &Index" ) ); group->insert( mIndexButton ); topLayout->addWidget( mIndexButton ); - QHBox *hbox = new QHBox( page ); - QLabel *scopeLabel = new QLabel( i18n( "Scope:" ), hbox ); + TQHBox *hbox = new TQHBox( page ); + TQLabel *scopeLabel = new TQLabel( i18n( "Scope:" ), hbox ); scopeLabel->setEnabled( false ); - mIndexScope = new QComboBox( hbox ); + mIndexScope = new TQComboBox( hbox ); mIndexScope->insertItem( i18n( "Only current folder" ) ); mIndexScope->insertItem( i18n( "Current folder and all subfolders" ) ); mIndexScope->insertItem( i18n( "All folders of this account" ) ); mIndexScope->setEnabled( false ); topLayout->addWidget( hbox ); - mCacheButton = new QRadioButton( page ); + mCacheButton = new TQRadioButton( page ); mCacheButton->setText( i18n( "Refresh &Cache" ) ); group->insert( mCacheButton ); topLayout->addWidget( mCacheButton ); enableButtonSeparator( true ); - connect ( mIndexButton, SIGNAL(toggled(bool)), mIndexScope, SLOT(setEnabled(bool)) ); - connect ( mIndexButton, SIGNAL(toggled(bool)), scopeLabel, SLOT(setEnabled(bool)) ); + connect ( mIndexButton, TQT_SIGNAL(toggled(bool)), mIndexScope, TQT_SLOT(setEnabled(bool)) ); + connect ( mIndexButton, TQT_SIGNAL(toggled(bool)), scopeLabel, TQT_SLOT(setEnabled(bool)) ); - connect( this, SIGNAL( okClicked () ), this, SLOT( slotDone() ) ); + connect( this, TQT_SIGNAL( okClicked () ), this, TQT_SLOT( slotDone() ) ); } int DImapTroubleShootDialog::run() @@ -198,14 +198,14 @@ KMFolderCachedImap::KMFolderCachedImap( KMFolder* folder, const char* aName ) setUidValidity(""); // if we fail to read a uid file but there is one, nuke it if ( readUidCache() == -1 ) { - if ( QFile::exists( uidCacheLocation() ) ) { + if ( TQFile::exists( uidCacheLocation() ) ) { KMessageBox::error( 0, i18n( "The UID cache file for folder %1 could not be read. There " "could be a problem with file system permission, or it is corrupted." ).arg( folder->prettyURL() ) ); // try to unlink it, in case it was corruped. If it couldn't be read // because of permissions, this will fail, which is fine - unlink( QFile::encodeName( uidCacheLocation() ) ); + unlink( TQFile::encodeName( uidCacheLocation() ) ); } } @@ -239,7 +239,7 @@ void KMFolderCachedImap::readConfig() KConfig* config = KMKernel::config(); KConfigGroupSaver saver( config, "Folder-" + folder()->idString() ); if( mImapPath.isEmpty() ) mImapPath = config->readEntry( "ImapPath" ); - if( QString( name() ).upper() == "INBOX" && mImapPath == "/INBOX/" ) + if( TQString( name() ).upper() == "INBOX" && mImapPath == "/INBOX/" ) { folder()->setLabel( i18n( "inbox" ) ); // for the icon @@ -268,7 +268,7 @@ void KMFolderCachedImap::readConfig() int storageQuotaUsage = config->readNumEntry( "StorageQuotaUsage", -1 ); int storageQuotaLimit = config->readNumEntry( "StorageQuotaLimit", -1 ); - QString storageQuotaRoot = config->readEntry( "StorageQuotaRoot", QString::null ); + TQString storageQuotaRoot = config->readEntry( "StorageQuotaRoot", TQString::null ); if ( !storageQuotaRoot.isNull() ) { // isEmpty() means we know there is no quota set mQuotaInfo.setName( "STORAGE" ); mQuotaInfo.setRoot( storageQuotaRoot ); @@ -290,11 +290,11 @@ void KMFolderCachedImap::readConfig() mImapPathCreation = config->readEntry("ImapPathCreation"); } - QStringList uids = config->readListEntry( "UIDSDeletedSinceLastSync" ); + TQStringList uids = config->readListEntry( "UIDSDeletedSinceLastSync" ); #if MAIL_LOSS_DEBUGGING kdDebug( 5006 ) << "READING IN UIDSDeletedSinceLastSync: " << folder()->prettyURL() << endl << uids << endl; #endif - for ( QStringList::iterator it = uids.begin(); it != uids.end(); it++ ) { + for ( TQStringList::iterator it = uids.begin(); it != uids.end(); it++ ) { mDeletedUIDsSinceLastSync.insert( (*it).toULong(), 0); } } @@ -320,10 +320,10 @@ void KMFolderCachedImap::writeConfig() } } if ( !mDeletedUIDsSinceLastSync.isEmpty() ) { - QValueList<ulong> uids = mDeletedUIDsSinceLastSync.keys(); - QStringList uidstrings; - for( QValueList<ulong>::iterator it = uids.begin(); it != uids.end(); it++ ) { - uidstrings.append( QString::number( (*it) ) ); + TQValueList<ulong> uids = mDeletedUIDsSinceLastSync.keys(); + TQStringList uidstrings; + for( TQValueList<ulong>::iterator it = uids.begin(); it != uids.end(); it++ ) { + uidstrings.append( TQString::number( (*it) ) ); } configGroup.writeEntry( "UIDSDeletedSinceLastSync", uidstrings ); #if MAIL_LOSS_DEBUGGING @@ -377,26 +377,26 @@ void KMFolderCachedImap::remove() { mFolderRemoved = true; - QString part1 = folder()->path() + "/." + dotEscape(name()); - QString uidCacheFile = part1 + ".uidcache"; + TQString part1 = folder()->path() + "/." + dotEscape(name()); + TQString uidCacheFile = part1 + ".uidcache"; // This is the account folder of an account that was just removed // When this happens, be sure to delete all traces of the cache - if( QFile::exists(uidCacheFile) ) - unlink( QFile::encodeName( uidCacheFile ) ); + if( TQFile::exists(uidCacheFile) ) + unlink( TQFile::encodeName( uidCacheFile ) ); FolderStorage::remove(); } -QString KMFolderCachedImap::uidCacheLocation() const +TQString KMFolderCachedImap::uidCacheLocation() const { - QString sLocation(folder()->path()); + TQString sLocation(folder()->path()); if (!sLocation.isEmpty()) sLocation += '/'; return sLocation + '.' + dotEscape(fileName()) + ".uidcache"; } int KMFolderCachedImap::readUidCache() { - QFile uidcache( uidCacheLocation() ); + TQFile uidcache( uidCacheLocation() ); if( uidcache.open( IO_ReadOnly ) ) { char buf[1024]; int len = uidcache.readLine( buf, sizeof(buf) ); @@ -406,14 +406,14 @@ int KMFolderCachedImap::readUidCache() if( cacheVersion == UIDCACHE_VERSION ) { len = uidcache.readLine( buf, sizeof(buf) ); if( len > 0 ) { - setUidValidity( QString::fromLocal8Bit(buf).stripWhiteSpace() ); + setUidValidity( TQString::fromLocal8Bit(buf).stripWhiteSpace() ); len = uidcache.readLine( buf, sizeof(buf) ); if( len > 0 ) { #if MAIL_LOSS_DEBUGGING - kdDebug(5006) << "Reading in last uid from cache: " << QString::fromLocal8Bit(buf).stripWhiteSpace() << " in " << folder()->prettyURL() << endl; + kdDebug(5006) << "Reading in last uid from cache: " << TQString::fromLocal8Bit(buf).stripWhiteSpace() << " in " << folder()->prettyURL() << endl; #endif // load the last known highest uid from the on disk cache - setLastUid( QString::fromLocal8Bit(buf).stripWhiteSpace().toULong() ); + setLastUid( TQString::fromLocal8Bit(buf).stripWhiteSpace().toULong() ); return 0; } } @@ -427,16 +427,16 @@ int KMFolderCachedImap::writeUidCache() { if( uidValidity().isEmpty() || uidValidity() == "INVALID" ) { // No info from the server yet, remove the file. - if( QFile::exists( uidCacheLocation() ) ) - return unlink( QFile::encodeName( uidCacheLocation() ) ); + if( TQFile::exists( uidCacheLocation() ) ) + return unlink( TQFile::encodeName( uidCacheLocation() ) ); return 0; } #if MAIL_LOSS_DEBUGGING kdDebug(5006) << "Writing out UID cache lastuid: " << lastUid() << " in: " << folder()->prettyURL() << endl; #endif - QFile uidcache( uidCacheLocation() ); + TQFile uidcache( uidCacheLocation() ); if( uidcache.open( IO_WriteOnly ) ) { - QTextStream str( &uidcache ); + TQTextStream str( &uidcache ); str << "# KMail-UidCache V" << UIDCACHE_VERSION << endl; str << uidValidity() << endl; str << lastUid() << endl; @@ -553,17 +553,17 @@ bool KMFolderCachedImap::canRemoveFolder() const { } /* Reimplemented from KMFolderDir */ -int KMFolderCachedImap::rename( const QString& aName, +int KMFolderCachedImap::rename( const TQString& aName, KMFolderDir* /*aParent*/ ) { - QString oldName = mAccount->renamedFolder( imapPath() ); + TQString oldName = mAccount->renamedFolder( imapPath() ); if ( oldName.isEmpty() ) oldName = name(); if ( aName == oldName ) // Stupid user trying to rename it to it's old name :) return 0; if( account() == 0 || imapPath().isEmpty() ) { // I don't think any of this can happen anymore - QString err = i18n("You must synchronize with the server before renaming IMAP folders."); + TQString err = i18n("You must synchronize with the server before renaming IMAP folders."); KMessageBox::error( 0, err ); return -1; } @@ -586,7 +586,7 @@ int KMFolderCachedImap::rename( const QString& aName, KMFolder* KMFolderCachedImap::trashFolder() const { - QString trashStr = account()->trash(); + TQString trashStr = account()->trash(); return kmkernel->dimapFolderMgr()->findIdString( trashStr ); } @@ -601,12 +601,12 @@ void KMFolderCachedImap::setLastUid( ulong uid ) uidWriteTimer = startTimer( 60000 ); } -void KMFolderCachedImap::timerEvent( QTimerEvent* ) +void KMFolderCachedImap::timerEvent( TQTimerEvent* ) { killTimer( uidWriteTimer ); uidWriteTimer = -1; if ( writeUidCache() == -1 ) - unlink( QFile::encodeName( uidCacheLocation() ) ); + unlink( TQFile::encodeName( uidCacheLocation() ) ); } ulong KMFolderCachedImap::lastUid() @@ -622,7 +622,7 @@ KMMsgBase* KMFolderCachedImap::findByUID( ulong uid ) mapReloaded = true; } - QMap<ulong,int>::Iterator it = uidMap.find( uid ); + TQMap<ulong,int>::Iterator it = uidMap.find( uid ); if( it != uidMap.end() ) { KMMsgBase *msg = getMsgBase( *it ); #if MAIL_LOSS_DEBUGGING @@ -684,12 +684,12 @@ void KMFolderCachedImap::slotTroubleshoot() "Please try running a sync before this.") ); return; } - QString str = i18n("Are you sure you want to refresh the IMAP cache of " + TQString str = i18n("Are you sure you want to refresh the IMAP cache of " "the folder %1 and all its subfolders?\nThis will " "remove all changes you have done locally to your " "folders.").arg( label() ); - QString s1 = i18n("Refresh IMAP Cache"); - QString s2 = i18n("&Refresh"); + TQString s1 = i18n("Refresh IMAP Cache"); + TQString s2 = i18n("&Refresh"); if( KMessageBox::warningContinueCancel( 0, str, s1, s2 ) == KMessageBox::Continue ) account()->invalidateIMAPFolders( this ); @@ -722,7 +722,7 @@ void KMFolderCachedImap::slotTroubleshoot() void KMFolderCachedImap::serverSync( bool recurse ) { if( mSyncState != SYNC_STATE_INITIAL ) { - if( KMessageBox::warningYesNo( 0, i18n("Folder %1 is not in initial sync state (state was %2). Do you want to reset it to initial sync state and sync anyway?" ).arg( imapPath() ).arg( mSyncState ), QString::null, i18n("Reset && Sync"), KStdGuiItem::cancel() ) == KMessageBox::Yes ) { + if( KMessageBox::warningYesNo( 0, i18n("Folder %1 is not in initial sync state (state was %2). Do you want to reset it to initial sync state and sync anyway?" ).arg( imapPath() ).arg( mSyncState ), TQString::null, i18n("Reset && Sync"), KStdGuiItem::cancel() ) == KMessageBox::Yes ) { mSyncState = SYNC_STATE_INITIAL; } else return; } @@ -753,7 +753,7 @@ void KMFolderCachedImap::serverSync( bool recurse ) serverSyncInternal(); } -QString KMFolderCachedImap::state2String( int state ) const +TQString KMFolderCachedImap::state2String( int state ) const { switch( state ) { case SYNC_STATE_INITIAL: return "SYNC_STATE_INITIAL"; @@ -853,8 +853,8 @@ void KMFolderCachedImap::serverSyncInternal() // kdDebug(5006) << "makeConnection said Connecting, waiting for signal." << endl; newState( mProgress, i18n("Connecting to %1").arg( mAccount->host() ) ); // We'll wait for the connectionResult signal from the account. - connect( mAccount, SIGNAL( connectionResult(int, const QString&) ), - this, SLOT( slotConnectionResult(int, const QString&) ) ); + connect( mAccount, TQT_SIGNAL( connectionResult(int, const TQString&) ), + this, TQT_SLOT( slotConnectionResult(int, const TQString&) ) ); break; } else { // Connected @@ -874,8 +874,8 @@ void KMFolderCachedImap::serverSyncInternal() // Check the user's own rights. We do this every time in case they changed. mOldUserRights = mUserRights; newState( mProgress, i18n("Checking permissions")); - connect( mAccount, SIGNAL( receivedUserRights( KMFolder* ) ), - this, SLOT( slotReceivedUserRights( KMFolder* ) ) ); + connect( mAccount, TQT_SIGNAL( receivedUserRights( KMFolder* ) ), + this, TQT_SLOT( slotReceivedUserRights( KMFolder* ) ) ); mAccount->getUserRights( folder(), imapPath() ); // after connecting, due to the INBOX case break; } @@ -885,12 +885,12 @@ void KMFolderCachedImap::serverSyncInternal() mSyncState = SYNC_STATE_CHECK_UIDVALIDITY; // Returns the new name if the folder was renamed, empty otherwise. bool isResourceFolder = kmkernel->iCalIface().isStandardResourceFolder( folder() ); - QString newName = mAccount->renamedFolder( imapPath() ); + TQString newName = mAccount->renamedFolder( imapPath() ); if ( !newName.isEmpty() && !folder()->isSystemFolder() && !isResourceFolder ) { newState( mProgress, i18n("Renaming folder") ); CachedImapJob *job = new CachedImapJob( newName, CachedImapJob::tRenameFolder, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), this, SLOT( slotIncreaseProgress() ) ); - connect( job, SIGNAL( finished() ), this, SLOT( serverSyncInternal() ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), this, TQT_SLOT( slotIncreaseProgress() ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( serverSyncInternal() ) ); job->start(); break; } @@ -970,8 +970,8 @@ void KMFolderCachedImap::serverSyncInternal() newState( mProgress, i18n("Deleting folders from server")); CachedImapJob* job = new CachedImapJob( foldersForDeletionOnServer, CachedImapJob::tDeleteFolders, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), this, SLOT( slotIncreaseProgress() ) ); - connect( job, SIGNAL( finished() ), this, SLOT( slotFolderDeletionOnServerFinished() ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), this, TQT_SLOT( slotIncreaseProgress() ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotFolderDeletionOnServerFinished() ) ); job->start(); break; } @@ -1007,10 +1007,10 @@ void KMFolderCachedImap::serverSyncInternal() mSyncState = SYNC_STATE_GET_MESSAGES; if( !noContent() ) { newState( mProgress, i18n("Expunging deleted messages")); - CachedImapJob *job = new CachedImapJob( QString::null, + CachedImapJob *job = new CachedImapJob( TQString::null, CachedImapJob::tExpungeFolder, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), this, SLOT( slotIncreaseProgress() ) ); - connect( job, SIGNAL( finished() ), this, SLOT( serverSyncInternal() ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), this, TQT_SLOT( slotIncreaseProgress() ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( serverSyncInternal() ) ); job->start(); break; } @@ -1024,10 +1024,10 @@ void KMFolderCachedImap::serverSyncInternal() CachedImapJob *job = new CachedImapJob( mMsgsForDownload, CachedImapJob::tGetMessage, this ); - connect( job, SIGNAL( progress(unsigned long, unsigned long) ), - this, SLOT( slotProgress(unsigned long, unsigned long) ) ); - connect( job, SIGNAL( finished() ), this, SLOT( slotUpdateLastUid() ) ); - connect( job, SIGNAL( finished() ), this, SLOT( serverSyncInternal() ) ); + connect( job, TQT_SIGNAL( progress(unsigned long, unsigned long) ), + this, TQT_SLOT( slotProgress(unsigned long, unsigned long) ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotUpdateLastUid() ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( serverSyncInternal() ) ); job->start(); mMsgsForDownload.clear(); break; @@ -1080,8 +1080,8 @@ void KMFolderCachedImap::serverSyncInternal() ImapAccountBase::jobData jd( url.url(), folder() ); jd.cancellable = true; // we can always do so later mAccount->insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotTestAnnotationResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotTestAnnotationResult(KIO::Job *))); break; } @@ -1096,7 +1096,7 @@ void KMFolderCachedImap::serverSyncInternal() // for a folder we didn't create ourselves: get annotation from server if ( mAnnotationFolderType == "FROMSERVER" ) { needToGetInitialAnnotations = true; - mAnnotationFolderType = QString::null; + mAnnotationFolderType = TQString::null; } else { updateAnnotationFolderType(); } @@ -1106,7 +1106,7 @@ void KMFolderCachedImap::serverSyncInternal() // On the other hand, if the user changed the contentstype, there's no need to get first. if ( !noContent() && mAccount->hasAnnotationSupport() && ( kmkernel->iCalIface().isEnabled() || needToGetInitialAnnotations ) ) { - QStringList annotations; // list of annotations to be fetched + TQStringList annotations; // list of annotations to be fetched if ( !mAnnotationFolderTypeChanged || mAnnotationFolderType.isEmpty() ) annotations << KOLAB_FOLDERTYPE; if ( !mIncidencesForChanged ) @@ -1121,10 +1121,10 @@ void KMFolderCachedImap::serverSyncInternal() jd.cancellable = true; mAccount->insertJob(job, jd); - connect( job, SIGNAL(annotationResult(const QString&, const QString&, bool)), - SLOT(slotAnnotationResult(const QString&, const QString&, bool)) ); - connect( job, SIGNAL(result(KIO::Job *)), - SLOT(slotGetAnnotationResult(KIO::Job *)) ); + connect( job, TQT_SIGNAL(annotationResult(const TQString&, const TQString&, bool)), + TQT_SLOT(slotAnnotationResult(const TQString&, const TQString&, bool)) ); + connect( job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotGetAnnotationResult(KIO::Job *)) ); break; } } @@ -1144,7 +1144,7 @@ void KMFolderCachedImap::serverSyncInternal() kdDebug(5006) << "Setting folder-type annotation for " << label() << " to " << mAnnotationFolderType << endl; } if ( mIncidencesForChanged ) { - const QString val = incidencesForToString( mIncidencesFor ); + const TQString val = incidencesForToString( mIncidencesFor ); KMail::AnnotationAttribute attr( KOLAB_INCIDENCESFOR, "value.shared", val ); annotations.append( attr ); kdDebug(5006) << "Setting incidences-for annotation for " << label() << " to " << val << endl; @@ -1156,10 +1156,10 @@ void KMFolderCachedImap::serverSyncInternal() jd.cancellable = true; // we can always do so later mAccount->insertJob(job, jd); - connect(job, SIGNAL(annotationChanged( const QString&, const QString&, const QString& ) ), - SLOT( slotAnnotationChanged( const QString&, const QString&, const QString& ) )); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotSetAnnotationResult(KIO::Job *))); + connect(job, TQT_SIGNAL(annotationChanged( const TQString&, const TQString&, const TQString& ) ), + TQT_SLOT( slotAnnotationChanged( const TQString&, const TQString&, const TQString& ) )); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotSetAnnotationResult(KIO::Job *))); break; } } @@ -1182,10 +1182,10 @@ void KMFolderCachedImap::serverSyncInternal() ImapAccountBase::jobData jd( url.url(), folder() ); mAccount->insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotMultiSetACLResult(KIO::Job *))); - connect(job, SIGNAL(aclChanged( const QString&, int )), - SLOT(slotACLChanged( const QString&, int )) ); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotMultiSetACLResult(KIO::Job *))); + connect(job, TQT_SIGNAL(aclChanged( const TQString&, int )), + TQT_SLOT(slotACLChanged( const TQString&, int )) ); break; } } @@ -1196,8 +1196,8 @@ void KMFolderCachedImap::serverSyncInternal() if( !noContent() && mAccount->hasACLSupport() ) { newState( mProgress, i18n( "Retrieving permissions" ) ); mAccount->getACL( folder(), mImapPath ); - connect( mAccount, SIGNAL(receivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )), - this, SLOT(slotReceivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )) ); + connect( mAccount, TQT_SIGNAL(receivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )), + this, TQT_SLOT(slotReceivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )) ); break; } case SYNC_STATE_GET_QUOTA: @@ -1210,10 +1210,10 @@ void KMFolderCachedImap::serverSyncInternal() KIO::Job* job = KMail::QuotaJobs::getStorageQuota( mAccount->slave(), url ); ImapAccountBase::jobData jd( url.url(), folder() ); mAccount->insertJob(job, jd); - connect( job, SIGNAL( storageQuotaResult( const QuotaInfo& ) ), - SLOT( slotStorageQuotaResult( const QuotaInfo& ) ) ); - connect( job, SIGNAL(result(KIO::Job *)), - SLOT(slotQuotaResult(KIO::Job *)) ); + connect( job, TQT_SIGNAL( storageQuotaResult( const QuotaInfo& ) ), + TQT_SLOT( slotStorageQuotaResult( const QuotaInfo& ) ) ); + connect( job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotQuotaResult(KIO::Job *)) ); break; } case SYNC_STATE_FIND_SUBFOLDERS: @@ -1258,8 +1258,8 @@ void KMFolderCachedImap::serverSyncInternal() case SYNC_STATE_SYNC_SUBFOLDERS: { if( mCurrentSubfolder ) { - disconnect( mCurrentSubfolder, SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), - this, SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); + disconnect( mCurrentSubfolder, TQT_SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), + this, TQT_SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); mCurrentSubfolder = 0; } @@ -1271,8 +1271,8 @@ void KMFolderCachedImap::serverSyncInternal() } else { mCurrentSubfolder = mSubfoldersForSync.front(); mSubfoldersForSync.pop_front(); - connect( mCurrentSubfolder, SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), - this, SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); + connect( mCurrentSubfolder, TQT_SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), + this, TQT_SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); //kdDebug(5006) << "Sync'ing subfolder " << mCurrentSubfolder->imapPath() << endl; assert( !mCurrentSubfolder->imapPath().isEmpty() ); @@ -1292,10 +1292,10 @@ void KMFolderCachedImap::serverSyncInternal() /* Connected to the imap account's connectionResult signal. Emitted when the slave connected or failed to connect. */ -void KMFolderCachedImap::slotConnectionResult( int errorCode, const QString& errorMsg ) +void KMFolderCachedImap::slotConnectionResult( int errorCode, const TQString& errorMsg ) { - disconnect( mAccount, SIGNAL( connectionResult(int, const QString&) ), - this, SLOT( slotConnectionResult(int, const QString&) ) ); + disconnect( mAccount, TQT_SIGNAL( connectionResult(int, const TQString&) ), + this, TQT_SLOT( slotConnectionResult(int, const TQString&) ) ); if ( !errorCode ) { // Success mSyncState = SYNC_STATE_GET_USERRIGHTS; @@ -1309,9 +1309,9 @@ void KMFolderCachedImap::slotConnectionResult( int errorCode, const QString& err } /* find new messages (messages without a UID) */ -QValueList<unsigned long> KMFolderCachedImap::findNewMessages() +TQValueList<unsigned long> KMFolderCachedImap::findNewMessages() { - QValueList<unsigned long> result; + TQValueList<unsigned long> result; for( int i = 0; i < count(); ++i ) { KMMsgBase *msg = getMsgBase( i ); if( !msg ) continue; /* what goes on if getMsg() returns 0? */ @@ -1324,20 +1324,20 @@ QValueList<unsigned long> KMFolderCachedImap::findNewMessages() /* Upload new messages to server */ void KMFolderCachedImap::uploadNewMessages() { - QValueList<unsigned long> newMsgs = findNewMessages(); + TQValueList<unsigned long> newMsgs = findNewMessages(); if( !newMsgs.isEmpty() ) { if ( mUserRights <= 0 || ( mUserRights & ( KMail::ACLJobs::Insert ) ) ) { newState( mProgress, i18n("Uploading messages to server")); CachedImapJob *job = new CachedImapJob( newMsgs, CachedImapJob::tPutMessage, this ); - connect( job, SIGNAL( progress( unsigned long, unsigned long) ), - this, SLOT( slotPutProgress(unsigned long, unsigned long) ) ); - connect( job, SIGNAL( finished() ), this, SLOT( serverSyncInternal() ) ); + connect( job, TQT_SIGNAL( progress( unsigned long, unsigned long) ), + this, TQT_SLOT( slotPutProgress(unsigned long, unsigned long) ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( serverSyncInternal() ) ); job->start(); return; } else { KMCommand *command = rescueUnsyncedMessages(); - connect( command, SIGNAL( completed( KMCommand * ) ), - this, SLOT( serverSyncInternal() ) ); + connect( command, TQT_SIGNAL( completed( KMCommand * ) ), + this, TQT_SLOT( serverSyncInternal() ) ); } } else { // nothing to upload if ( mUserRights != mOldUserRights && (mOldUserRights & KMail::ACLJobs::Insert) @@ -1357,7 +1357,7 @@ void KMFolderCachedImap::slotPutProgress( unsigned long done, unsigned long tota { // (going from mProgress to mProgress+10) int progressSpan = 10; - newState( mProgress + (progressSpan * done) / total, QString::null ); + newState( mProgress + (progressSpan * done) / total, TQString::null ); if ( done == total ) // we're done mProgress += progressSpan; } @@ -1370,7 +1370,7 @@ void KMFolderCachedImap::uploadFlags() newState( mProgress, i18n("Uploading status of messages to server")); // FIXME DUPLICATED FROM KMFOLDERIMAP - QMap< QString, QStringList > groups; + TQMap< TQString, TQStringList > groups; //open(); //already done for( int i = 0; i < count(); ++i ) { KMMsgBase* msg = getMsgBase( i ); @@ -1378,28 +1378,28 @@ void KMFolderCachedImap::uploadFlags() // Either not a valid message or not one that is on the server yet continue; - QString flags = KMFolderImap::statusToFlags(msg->status(), mPermanentFlags); + TQString flags = KMFolderImap::statusToFlags(msg->status(), mPermanentFlags); // Collect uids for each typem of flags. - QString uid; + TQString uid; uid.setNum( msg->UID() ); groups[flags].append(uid); } - QMapIterator< QString, QStringList > dit; + TQMapIterator< TQString, TQStringList > dit; for( dit = groups.begin(); dit != groups.end(); ++dit ) { - QCString flags = dit.key().latin1(); - QStringList sets = KMFolderImap::makeSets( (*dit), true ); + TQCString flags = dit.key().latin1(); + TQStringList sets = KMFolderImap::makeSets( (*dit), true ); mStatusFlagsJobs += sets.count(); // ### that's not in kmfolderimap.... // Send off a status setting job for each set. - for( QStringList::Iterator slit = sets.begin(); slit != sets.end(); ++slit ) { - QString imappath = imapPath() + ";UID=" + ( *slit ); + for( TQStringList::Iterator slit = sets.begin(); slit != sets.end(); ++slit ) { + TQString imappath = imapPath() + ";UID=" + ( *slit ); mAccount->setImapStatus(folder(), imappath, flags); } } // FIXME END DUPLICATED FROM KMFOLDERIMAP if ( mStatusFlagsJobs ) { - connect( mAccount, SIGNAL( imapStatusChanged(KMFolder*, const QString&, bool) ), - this, SLOT( slotImapStatusChanged(KMFolder*, const QString&, bool) ) ); + connect( mAccount, TQT_SIGNAL( imapStatusChanged(KMFolder*, const TQString&, bool) ), + this, TQT_SLOT( slotImapStatusChanged(KMFolder*, const TQString&, bool) ) ); return; } } @@ -1413,7 +1413,7 @@ void KMFolderCachedImap::uploadSeenFlags() mStatusFlagsJobs = 0; newState( mProgress, i18n("Uploading status of messages to server")); - QValueList<ulong> seenUids, unseenUids; + TQValueList<ulong> seenUids, unseenUids; for( int i = 0; i < count(); ++i ) { KMMsgBase* msg = getMsgBase( i ); if( !msg || msg->UID() == 0 ) @@ -1426,25 +1426,25 @@ void KMFolderCachedImap::uploadSeenFlags() unseenUids.append( msg->UID() ); } if ( !seenUids.isEmpty() ) { - QStringList sets = KMFolderImap::makeSets( seenUids, true ); + TQStringList sets = KMFolderImap::makeSets( seenUids, true ); mStatusFlagsJobs += sets.count(); - for( QStringList::Iterator it = sets.begin(); it != sets.end(); ++it ) { - QString imappath = imapPath() + ";UID=" + ( *it ); + for( TQStringList::Iterator it = sets.begin(); it != sets.end(); ++it ) { + TQString imappath = imapPath() + ";UID=" + ( *it ); mAccount->setImapSeenStatus( folder(), imappath, true ); } } if ( !unseenUids.isEmpty() ) { - QStringList sets = KMFolderImap::makeSets( unseenUids, true ); + TQStringList sets = KMFolderImap::makeSets( unseenUids, true ); mStatusFlagsJobs += sets.count(); - for( QStringList::Iterator it = sets.begin(); it != sets.end(); ++it ) { - QString imappath = imapPath() + ";UID=" + ( *it ); + for( TQStringList::Iterator it = sets.begin(); it != sets.end(); ++it ) { + TQString imappath = imapPath() + ";UID=" + ( *it ); mAccount->setImapSeenStatus( folder(), imappath, false ); } } if ( mStatusFlagsJobs ) { - connect( mAccount, SIGNAL( imapStatusChanged(KMFolder*, const QString&, bool) ), - this, SLOT( slotImapStatusChanged(KMFolder*, const QString&, bool) ) ); + connect( mAccount, TQT_SIGNAL( imapStatusChanged(KMFolder*, const TQString&, bool) ), + this, TQT_SLOT( slotImapStatusChanged(KMFolder*, const TQString&, bool) ) ); return; } } @@ -1452,7 +1452,7 @@ void KMFolderCachedImap::uploadSeenFlags() serverSyncInternal(); } -void KMFolderCachedImap::slotImapStatusChanged(KMFolder* folder, const QString&, bool cont) +void KMFolderCachedImap::slotImapStatusChanged(KMFolder* folder, const TQString&, bool cont) { if ( mSyncState == SYNC_STATE_INITIAL ){ //kdDebug(5006) << "IMAP status changed but reset " << endl; @@ -1462,8 +1462,8 @@ void KMFolderCachedImap::slotImapStatusChanged(KMFolder* folder, const QString&, if ( folder->storage() == this ) { --mStatusFlagsJobs; if ( mStatusFlagsJobs == 0 || !cont ) // done or aborting - disconnect( mAccount, SIGNAL( imapStatusChanged(KMFolder*, const QString&, bool) ), - this, SLOT( slotImapStatusChanged(KMFolder*, const QString&, bool) ) ); + disconnect( mAccount, TQT_SIGNAL( imapStatusChanged(KMFolder*, const TQString&, bool) ), + this, TQT_SLOT( slotImapStatusChanged(KMFolder*, const TQString&, bool) ) ); if ( mStatusFlagsJobs == 0 && cont ) { mProgress += 5; serverSyncInternal(); @@ -1479,7 +1479,7 @@ void KMFolderCachedImap::setStatus( int idx, KMMsgStatus status, bool toggle) mStatusChangedLocally = true; } -void KMFolderCachedImap::setStatus(QValueList<int>& ids, KMMsgStatus status, bool toggle) +void KMFolderCachedImap::setStatus(TQValueList<int>& ids, KMMsgStatus status, bool toggle) { KMFolderMaildir::setStatus(ids, status, toggle); mStatusChangedLocally = true; @@ -1488,22 +1488,22 @@ void KMFolderCachedImap::setStatus(QValueList<int>& ids, KMMsgStatus status, boo /* Upload new folders to server */ void KMFolderCachedImap::createNewFolders() { - QValueList<KMFolderCachedImap*> newFolders = findNewFolders(); + TQValueList<KMFolderCachedImap*> newFolders = findNewFolders(); //kdDebug(5006) << label() << " createNewFolders:" << newFolders.count() << " new folders." << endl; if( !newFolders.isEmpty() ) { newState( mProgress, i18n("Creating subfolders on server")); CachedImapJob *job = new CachedImapJob( newFolders, CachedImapJob::tAddSubfolders, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), this, SLOT( slotIncreaseProgress() ) ); - connect( job, SIGNAL( finished() ), this, SLOT( serverSyncInternal() ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), this, TQT_SLOT( slotIncreaseProgress() ) ); + connect( job, TQT_SIGNAL( finished() ), this, TQT_SLOT( serverSyncInternal() ) ); job->start(); } else { serverSyncInternal(); } } -QValueList<KMFolderCachedImap*> KMFolderCachedImap::findNewFolders() +TQValueList<KMFolderCachedImap*> KMFolderCachedImap::findNewFolders() { - QValueList<KMFolderCachedImap*> newFolders; + TQValueList<KMFolderCachedImap*> newFolders; if( folder() && folder()->child() ) { KMFolderNode *node = folder()->child()->first(); while( node ) { @@ -1528,18 +1528,18 @@ QValueList<KMFolderCachedImap*> KMFolderCachedImap::findNewFolders() bool KMFolderCachedImap::deleteMessages() { /* Delete messages from cache that are gone from the server */ - QPtrList<KMMessage> msgsForDeletion; + TQPtrList<KMMessage> msgsForDeletion; // It is not possible to just go over all indices and remove // them one by one because the index list can get resized under // us. So use msg pointers instead - QStringList uids; - QMap<ulong,int>::const_iterator it = uidMap.constBegin(); + TQStringList uids; + TQMap<ulong,int>::const_iterator it = uidMap.constBegin(); for( ; it != uidMap.end(); it++ ) { ulong uid ( it.key() ); if( uid!=0 && !uidsOnServer.find( uid ) ) { - uids << QString::number( uid ); + uids << TQString::number( uid ); msgsForDeletion.append( getMsg( *it ) ); } } @@ -1560,12 +1560,12 @@ bool KMFolderCachedImap::deleteMessages() /* Delete messages from the server that we dont have anymore */ if( !uidsForDeletionOnServer.isEmpty() ) { newState( mProgress, i18n("Deleting removed messages from server")); - QStringList sets = KMFolderImap::makeSets( uidsForDeletionOnServer, true ); + TQStringList sets = KMFolderImap::makeSets( uidsForDeletionOnServer, true ); uidsForDeletionOnServer.clear(); kdDebug(5006) << "Deleting " << sets.count() << " sets of messages from server folder " << imapPath() << endl; CachedImapJob *job = new CachedImapJob( sets, CachedImapJob::tDeleteMessage, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), - this, SLOT( slotDeleteMessagesResult(KMail::FolderJob *) ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), + this, TQT_SLOT( slotDeleteMessagesResult(KMail::FolderJob *) ) ); job->start(); return true; } else { @@ -1600,9 +1600,9 @@ void KMFolderCachedImap::checkUidValidity() { else { newState( mProgress, i18n("Checking folder validity")); CachedImapJob *job = new CachedImapJob( FolderJob::tCheckUidValidity, this ); - connect( job, SIGNAL(permanentFlags(int)), SLOT(slotPermanentFlags(int)) ); - connect( job, SIGNAL( result( KMail::FolderJob* ) ), - this, SLOT( slotCheckUidValidityResult( KMail::FolderJob* ) ) ); + connect( job, TQT_SIGNAL(permanentFlags(int)), TQT_SLOT(slotPermanentFlags(int)) ); + connect( job, TQT_SIGNAL( result( KMail::FolderJob* ) ), + this, TQT_SLOT( slotCheckUidValidityResult( KMail::FolderJob* ) ) ); job->start(); } } @@ -1651,8 +1651,8 @@ void KMFolderCachedImap::listMessages() { mFoundAnIMAPDigest = false; CachedImapJob* job = new CachedImapJob( FolderJob::tListMessages, this ); - connect( job, SIGNAL( result(KMail::FolderJob *) ), - this, SLOT( slotGetLastMessagesResult(KMail::FolderJob *) ) ); + connect( job, TQT_SIGNAL( result(KMail::FolderJob *) ), + this, TQT_SLOT( slotGetLastMessagesResult(KMail::FolderJob *) ) ); job->start(); } @@ -1662,7 +1662,7 @@ void KMFolderCachedImap::slotGetLastMessagesResult(KMail::FolderJob *job) } // Connected to the listMessages job in CachedImapJob -void KMFolderCachedImap::slotGetMessagesData(KIO::Job * job, const QByteArray & data) +void KMFolderCachedImap::slotGetMessagesData(KIO::Job * job, const TQByteArray & data) { KMAcctCachedImap::JobIterator it = mAccount->findJob(job); if ( it == mAccount->jobsEnd() ) { // Shouldn't happen @@ -1674,7 +1674,7 @@ void KMFolderCachedImap::slotGetMessagesData(KIO::Job * job, const QByteArray & serverSyncInternal(); /* HACK^W Fix: we should at least try to keep going */ return; } - (*it).cdata += QCString(data, data.size() + 1); + (*it).cdata += TQCString(data, data.size() + 1); int pos = (*it).cdata.find("\r\n--IMAPDIGEST"); if (pos > 0) { int a = (*it).cdata.find("\r\nX-uidValidity:"); @@ -1690,7 +1690,7 @@ void KMFolderCachedImap::slotGetMessagesData(KIO::Job * job, const QByteArray & // sources for the readonly setting, in any case. if (a != -1 && mUserRights == -1 ) { int b = (*it).cdata.find("\r\n", a + 12); - const QString access = (*it).cdata.mid(a + 12, b - a - 12); + const TQString access = (*it).cdata.mid(a + 12, b - a - 12); setReadOnly( access == "Read only" ); } (*it).cdata.remove(0, pos); @@ -1711,7 +1711,7 @@ void KMFolderCachedImap::slotGetMessagesData(KIO::Job * job, const QByteArray & */ // The below is optimized for speed, not prettiness. The commented out chunk // above was the solution copied from kmfolderimap, and it's 15-20% slower. - const QCString& entry( (*it).cdata ); + const TQCString& entry( (*it).cdata ); const int indexOfUID = entry.find("X-UID", 16); const int startOfUIDValue = indexOfUID + 7; const int indexOfLength = entry.find("X-Length", startOfUIDValue ); // we know length comes after UID @@ -1833,7 +1833,7 @@ void KMFolderCachedImap::slotProgress(unsigned long done, unsigned long total) //kdDebug(5006) << "KMFolderCachedImap::slotProgress done=" << done << " total=" << total << "=> mProgress=" << mProgress + ( progressSpan * done ) / total << endl; // Progress info while retrieving new emails // (going from mProgress to mProgress+progressSpan) - newState( mProgress + (progressSpan * done) / total, QString::null ); + newState( mProgress + (progressSpan * done) / total, TQString::null ); } void KMFolderCachedImap::setAccount(KMAcctCachedImap *aAccount) @@ -1843,7 +1843,7 @@ void KMFolderCachedImap::setAccount(KMAcctCachedImap *aAccount) if( imapPath()=="/" ) aAccount->setFolder( folder() ); // Folder was renamed in a previous session, and the user didn't sync yet - QString newName = mAccount->renamedFolder( imapPath() ); + TQString newName = mAccount->renamedFolder( imapPath() ); if ( !newName.isEmpty() ) folder()->setLabel( newName ); @@ -1865,10 +1865,10 @@ void KMFolderCachedImap::listNamespaces() mSyncState = SYNC_STATE_DELETE_SUBFOLDERS; mPersonalNamespacesCheckDone = true; - QStringList ns = mAccount->namespaces()[ImapAccountBase::OtherUsersNS]; + TQStringList ns = mAccount->namespaces()[ImapAccountBase::OtherUsersNS]; ns += mAccount->namespaces()[ImapAccountBase::SharedNS]; mNamespacesToCheck = ns.count(); - for ( QStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) + for ( TQStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) { if ( (*it).isEmpty() ) { // ignore empty listings as they have been listed before @@ -1877,10 +1877,10 @@ void KMFolderCachedImap::listNamespaces() } KMail::ListJob* job = new KMail::ListJob( mAccount, type, this, mAccount->addPathToNamespace( *it ) ); job->setHonorLocalSubscription( true ); - connect( job, SIGNAL(receivedFolders(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&)), - this, SLOT(slotCheckNamespace(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&))); + connect( job, TQT_SIGNAL(receivedFolders(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&)), + this, TQT_SLOT(slotCheckNamespace(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&))); job->start(); } if ( mNamespacesToCheck == 0 ) { @@ -1890,7 +1890,7 @@ void KMFolderCachedImap::listNamespaces() } mPersonalNamespacesCheckDone = false; - QString ns = mNamespacesToList.front(); + TQString ns = mNamespacesToList.front(); mNamespacesToList.pop_front(); mSyncState = SYNC_STATE_LIST_SUBFOLDERS2; @@ -1899,17 +1899,17 @@ void KMFolderCachedImap::listNamespaces() mAccount->addPathToNamespace( ns ) ); job->setNamespace( ns ); job->setHonorLocalSubscription( true ); - connect( job, SIGNAL(receivedFolders(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&)), - this, SLOT(slotListResult(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&))); + connect( job, TQT_SIGNAL(receivedFolders(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&)), + this, TQT_SLOT(slotListResult(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&))); job->start(); } -void KMFolderCachedImap::slotCheckNamespace( const QStringList& subfolderNames, - const QStringList& subfolderPaths, - const QStringList& subfolderMimeTypes, - const QStringList& subfolderAttributes, +void KMFolderCachedImap::slotCheckNamespace( const TQStringList& subfolderNames, + const TQStringList& subfolderPaths, + const TQStringList& subfolderMimeTypes, + const TQStringList& subfolderAttributes, const ImapAccountBase::jobData& jobData ) { Q_UNUSED( subfolderPaths ); @@ -1921,7 +1921,7 @@ void KMFolderCachedImap::slotCheckNamespace( const QStringList& subfolderNames, // get a correct foldername: // strip / and make sure it does not contain the delimiter - QString name = jobData.path.mid( 1, jobData.path.length()-2 ); + TQString name = jobData.path.mid( 1, jobData.path.length()-2 ); name.remove( mAccount->delimiterForNamespace( name ) ); if ( name.isEmpty() ) { // should not happen @@ -1987,19 +1987,19 @@ bool KMFolderCachedImap::listDirectory() type = ImapAccountBase::ListSubscribed; KMail::ListJob* job = new KMail::ListJob( mAccount, type, this ); job->setHonorLocalSubscription( true ); - connect( job, SIGNAL(receivedFolders(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&)), - this, SLOT(slotListResult(const QStringList&, const QStringList&, - const QStringList&, const QStringList&, const ImapAccountBase::jobData&))); + connect( job, TQT_SIGNAL(receivedFolders(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&)), + this, TQT_SLOT(slotListResult(const TQStringList&, const TQStringList&, + const TQStringList&, const TQStringList&, const ImapAccountBase::jobData&))); job->start(); return true; } -void KMFolderCachedImap::slotListResult( const QStringList& folderNames, - const QStringList& folderPaths, - const QStringList& folderMimeTypes, - const QStringList& folderAttributes, +void KMFolderCachedImap::slotListResult( const TQStringList& folderNames, + const TQStringList& folderPaths, + const TQStringList& folderMimeTypes, + const TQStringList& folderAttributes, const ImapAccountBase::jobData& jobData ) { Q_UNUSED( jobData ); @@ -2016,7 +2016,7 @@ void KMFolderCachedImap::slotListResult( const QStringList& folderNames, KMFolderNode *node = folder()->child()->first(); bool root = ( this == mAccount->rootFolder() ); - QPtrList<KMFolder> toRemove; + TQPtrList<KMFolder> toRemove; bool emptyList = ( root && mSubfolderNames.empty() ); if ( !emptyList ) { while (node) { @@ -2024,7 +2024,7 @@ void KMFolderCachedImap::slotListResult( const QStringList& folderNames, KMFolderCachedImap *f = static_cast<KMFolderCachedImap*>(static_cast<KMFolder*>(node)->storage()); if ( mSubfolderNames.findIndex(node->name()) == -1 ) { - QString name = node->name(); + TQString name = node->name(); // as more than one namespace can be listed in the root folder we need to make sure // that the folder is within the current namespace bool isInNamespace = ( jobData.curNamespace.isEmpty() || @@ -2069,7 +2069,7 @@ void KMFolderCachedImap::slotListResult( const QStringList& folderNames, // This synchronizes the local folders as needed (creation/deletion). No network communication here. void KMFolderCachedImap::listDirectory2() { - QString path = folder()->path(); + TQString path = folder()->path(); kmkernel->dimapFolderMgr()->quiet(true); bool root = ( this == mAccount->rootFolder() ); @@ -2113,7 +2113,7 @@ void KMFolderCachedImap::listDirectory2() } // Find all subfolders present on server but not on disk - QValueVector<int> foldersNewOnServer; + TQValueVector<int> foldersNewOnServer; for (uint i = 0; i < mSubfolderNames.count(); i++) { // Find the subdir, if already present @@ -2126,7 +2126,7 @@ void KMFolderCachedImap::listDirectory2() if (!node) { // This folder is not present here // Either it's new on the server, or we just deleted it. - QString subfolderPath = mSubfolderPaths[i]; + TQString subfolderPath = mSubfolderPaths[i]; // The code used to look at the uidcache to know if it was "just deleted". // But this breaks with noContent folders and with shared folders. // So instead we keep a list in the account. @@ -2136,7 +2136,7 @@ void KMFolderCachedImap::listDirectory2() // (could be that the folder was deleted & recreated meanwhile from another client...) if ( !locallyDeleted && mAccount->isPreviouslyDeletedFolder( subfolderPath ) ) { locallyDeleted = KMessageBox::warningYesNo( - 0, i18n( "<qt><p>It seems that the folder <b>%1</b> was deleted. Do you want to delete it from the server?</p></qt>" ).arg( mSubfolderNames[i] ), QString::null, KStdGuiItem::del(), KStdGuiItem::cancel() ) == KMessageBox::Yes; + 0, i18n( "<qt><p>It seems that the folder <b>%1</b> was deleted. Do you want to delete it from the server?</p></qt>" ).arg( mSubfolderNames[i] ), TQString::null, KStdGuiItem::del(), KStdGuiItem::cancel() ) == KMessageBox::Yes; } if ( locallyDeleted ) { @@ -2177,24 +2177,24 @@ void KMFolderCachedImap::listDirectory2() && GlobalSettings::self()->theIMAPResourceEnabled() && !foldersNewOnServer.isEmpty() ) { - QStringList paths; + TQStringList paths; for ( uint i = 0; i < foldersNewOnServer.count(); ++i ) paths << mSubfolderPaths[ foldersNewOnServer[i] ]; AnnotationJobs::MultiUrlGetAnnotationJob* job = AnnotationJobs::multiUrlGetAnnotation( mAccount->slave(), mAccount->getUrl(), paths, KOLAB_FOLDERTYPE ); - ImapAccountBase::jobData jd( QString::null, folder() ); + ImapAccountBase::jobData jd( TQString::null, folder() ); jd.cancellable = true; mAccount->insertJob(job, jd); - connect( job, SIGNAL(result(KIO::Job *)), - SLOT(slotMultiUrlGetAnnotationResult(KIO::Job *)) ); + connect( job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotMultiUrlGetAnnotationResult(KIO::Job *)) ); } else { createFoldersNewOnServerAndFinishListing( foldersNewOnServer ); } } -void KMFolderCachedImap::createFoldersNewOnServerAndFinishListing( const QValueVector<int> foldersNewOnServer ) +void KMFolderCachedImap::createFoldersNewOnServerAndFinishListing( const TQValueVector<int> foldersNewOnServer ) { for ( uint i = 0; i < foldersNewOnServer.count(); ++i ) { int idx = foldersNewOnServer[i]; @@ -2227,10 +2227,10 @@ void KMFolderCachedImap::createFoldersNewOnServerAndFinishListing( const QValueV } //----------------------------------------------------------------------------- -KMFolderCachedImap* KMFolderCachedImap::findParent( const QString& path, - const QString& name ) +KMFolderCachedImap* KMFolderCachedImap::findParent( const TQString& path, + const TQString& name ) { - QString parent = path.left( path.length() - name.length() - 2 ); + TQString parent = path.left( path.length() - name.length() - 2 ); if ( parent.length() > 1 ) { // extract name of the parent @@ -2267,8 +2267,8 @@ void KMFolderCachedImap::slotSubFolderComplete(KMFolderCachedImap* sub, bool suc // success == false means the sync was aborted. if ( mCurrentSubfolder ) { Q_ASSERT( sub == mCurrentSubfolder ); - disconnect( mCurrentSubfolder, SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), - this, SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); + disconnect( mCurrentSubfolder, TQT_SIGNAL( folderComplete(KMFolderCachedImap*, bool) ), + this, TQT_SLOT( slotSubFolderComplete(KMFolderCachedImap*, bool) ) ); mCurrentSubfolder = 0; } @@ -2279,11 +2279,11 @@ void KMFolderCachedImap::slotSubFolderComplete(KMFolderCachedImap* sub, bool suc } } -void KMFolderCachedImap::slotSimpleData(KIO::Job * job, const QByteArray & data) +void KMFolderCachedImap::slotSimpleData(KIO::Job * job, const TQByteArray & data) { KMAcctCachedImap::JobIterator it = mAccount->findJob(job); if (it == mAccount->jobsEnd()) return; - QBuffer buff((*it).data); + TQBuffer buff((*it).data); buff.open(IO_WriteOnly | IO_Append); buff.writeBlock(data.data(), data.size()); buff.close(); @@ -2291,9 +2291,9 @@ void KMFolderCachedImap::slotSimpleData(KIO::Job * job, const QByteArray & data) FolderJob* KMFolderCachedImap::doCreateJob( KMMessage *msg, FolderJob::JobType jt, KMFolder *folder, - QString, const AttachmentStrategy* ) const + TQString, const AttachmentStrategy* ) const { - QPtrList<KMMessage> msgList; + TQPtrList<KMMessage> msgList; msgList.append( msg ); CachedImapJob *job = new CachedImapJob( msgList, jt, folder? static_cast<KMFolderCachedImap*>( folder->storage() ):0 ); job->setParentFolder( this ); @@ -2301,7 +2301,7 @@ KMFolderCachedImap::doCreateJob( KMMessage *msg, FolderJob::JobType jt, KMFolder } FolderJob* -KMFolderCachedImap::doCreateJob( QPtrList<KMMessage>& msgList, const QString& sets, +KMFolderCachedImap::doCreateJob( TQPtrList<KMMessage>& msgList, const TQString& sets, FolderJob::JobType jt, KMFolder *folder ) const { //FIXME: how to handle sets here? @@ -2322,8 +2322,8 @@ void KMFolderCachedImap::slotReceivedUserRights( KMFolder* folder ) { if ( folder->storage() == this ) { - disconnect( mAccount, SIGNAL( receivedUserRights( KMFolder* ) ), - this, SLOT( slotReceivedUserRights( KMFolder* ) ) ); + disconnect( mAccount, TQT_SIGNAL( receivedUserRights( KMFolder* ) ), + this, TQT_SLOT( slotReceivedUserRights( KMFolder* ) ) ); if ( mUserRights == 0 ) // didn't work mUserRights = -1; // error code (used in folderdia) else @@ -2346,8 +2346,8 @@ void KMFolderCachedImap::slotReceivedACL( KMFolder* folder, KIO::Job*, const KMail::ACLList& aclList ) { if ( folder->storage() == this ) { - disconnect( mAccount, SIGNAL(receivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )), - this, SLOT(slotReceivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )) ); + disconnect( mAccount, TQT_SIGNAL(receivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )), + this, TQT_SLOT(slotReceivedACL( KMFolder*, KIO::Job*, const KMail::ACLList& )) ); mACLList = aclList; serverSyncInternal(); } @@ -2393,7 +2393,7 @@ KMFolderCachedImap::slotMultiSetACLResult(KIO::Job *job) } void -KMFolderCachedImap::slotACLChanged( const QString& userId, int permissions ) +KMFolderCachedImap::slotACLChanged( const TQString& userId, int permissions ) { // The job indicates success in changing the permissions for this user // -> we note that it's been done. @@ -2417,7 +2417,7 @@ void KMFolderCachedImap::resetSyncState() close("cachedimap"); // Don't use newState here, it would revert to mProgress (which is < current value when listing messages) KPIM::ProgressItem *progressItem = mAccount->mailCheckProgressItem(); - QString str = i18n("Aborted"); + TQString str = i18n("Aborted"); if (progressItem) progressItem->setStatus( str ); emit statusMsg( str ); @@ -2428,19 +2428,19 @@ void KMFolderCachedImap::slotIncreaseProgress() mProgress += 5; } -void KMFolderCachedImap::newState( int progress, const QString& syncStatus ) +void KMFolderCachedImap::newState( int progress, const TQString& syncStatus ) { //kdDebug() << k_funcinfo << folder() << " " << mProgress << " " << syncStatus << endl; KPIM::ProgressItem *progressItem = mAccount->mailCheckProgressItem(); if( progressItem ) progressItem->setCompletedItems( progress ); if ( !syncStatus.isEmpty() ) { - QString str; + TQString str; // For a subfolder, show the label. But for the main folder, it's already shown. if ( mAccount->imapFolder() == this ) str = syncStatus; else - str = QString( "%1: %2" ).arg( label() ).arg( syncStatus ); + str = TQString( "%1: %2" ).arg( label() ).arg( syncStatus ); if( progressItem ) progressItem->setStatus( str ); emit statusMsg( str ); @@ -2456,7 +2456,7 @@ void KMFolderCachedImap::setSubfolderState( imapState state ) { // pass through to childs KMFolderNode* node; - QPtrListIterator<KMFolderNode> it( *folder()->child() ); + TQPtrListIterator<KMFolderNode> it( *folder()->child() ); for ( ; (node = it.current()); ) { ++it; @@ -2467,7 +2467,7 @@ void KMFolderCachedImap::setSubfolderState( imapState state ) } } -void KMFolderCachedImap::setImapPath(const QString &path) +void KMFolderCachedImap::setImapPath(const TQString &path) { mImapPath = path; } @@ -2479,15 +2479,15 @@ void KMFolderCachedImap::setImapPath(const QString &path) // on startup, it's too early there to know if this is a standard resource folder. void KMFolderCachedImap::updateAnnotationFolderType() { - QString oldType = mAnnotationFolderType; - QString oldSubType; + TQString oldType = mAnnotationFolderType; + TQString oldSubType; int dot = oldType.find( '.' ); if ( dot != -1 ) { oldType.truncate( dot ); oldSubType = mAnnotationFolderType.mid( dot + 1 ); } - QString newType, newSubType; + TQString newType, newSubType; // We want to store an annotation on the folder only if using the kolab storage. if ( kmkernel->iCalIface().storageFormat( folder() ) == KMailICalIfaceImpl::StorageXML ) { newType = KMailICalIfaceImpl::annotationForContentsType( mContentsType ); @@ -2499,7 +2499,7 @@ void KMFolderCachedImap::updateAnnotationFolderType() //kdDebug(5006) << mImapPath << ": updateAnnotationFolderType: " << newType << " " << newSubType << endl; if ( newType != oldType || newSubType != oldSubType ) { - mAnnotationFolderType = newType + ( newSubType.isEmpty() ? QString::null : "."+newSubType ); + mAnnotationFolderType = newType + ( newSubType.isEmpty() ? TQString::null : "."+newSubType ); mAnnotationFolderTypeChanged = true; // force a "set annotation" on next sync kdDebug(5006) << mImapPath << ": updateAnnotationFolderType: '" << mAnnotationFolderType << "', was (" << oldType << " " << oldSubType << ") => mAnnotationFolderTypeChanged set to TRUE" << endl; } @@ -2515,7 +2515,7 @@ void KMFolderCachedImap::setIncidencesFor( IncidencesFor incfor ) } } -void KMFolderCachedImap::slotAnnotationResult(const QString& entry, const QString& value, bool found) +void KMFolderCachedImap::slotAnnotationResult(const TQString& entry, const TQString& value, bool found) { if ( entry == KOLAB_FOLDERTYPE ) { // There are four cases. @@ -2524,8 +2524,8 @@ void KMFolderCachedImap::slotAnnotationResult(const QString& entry, const QStrin // 3) different (known) content-type on server, no local change -> get it // 4) different unknown content-type on server, probably some older version -> set it if ( found ) { - QString type = value; - QString subtype; + TQString type = value; + TQString subtype; int dot = value.find( '.' ); if ( dot != -1 ) { type.truncate( dot ); @@ -2618,7 +2618,7 @@ void KMFolderCachedImap::slotMultiUrlGetAnnotationResult( KIO::Job* job ) Q_ASSERT( (*it).parent == folder() ); if ( (*it).parent != folder() ) return; // Shouldn't happen - QValueVector<int> folders; + TQValueVector<int> folders; AnnotationJobs::MultiUrlGetAnnotationJob* annjob = static_cast<AnnotationJobs::MultiUrlGetAnnotationJob *>( job ); if ( annjob->error() ) { @@ -2633,14 +2633,14 @@ void KMFolderCachedImap::slotMultiUrlGetAnnotationResult( KIO::Job* job ) kdWarning(5006) << "slotGetMultiUrlAnnotationResult: " << job->errorString() << endl; } else { // we got the annotation allright, let's filter out the ones with the wrong type - QMap<QString, QString> annotations = annjob->annotations(); - QMap<QString, QString>::Iterator it = annotations.begin(); + TQMap<TQString, TQString> annotations = annjob->annotations(); + TQMap<TQString, TQString>::Iterator it = annotations.begin(); for ( ; it != annotations.end(); ++it ) { - const QString folderPath = it.key(); - const QString annotation = it.data(); + const TQString folderPath = it.key(); + const TQString annotation = it.data(); kdDebug(5006) << k_funcinfo << "Folder: " << folderPath << " has type: " << annotation << endl; // we're only interested in the main type - QString type(annotation); + TQString type(annotation); int dot = annotation.find( '.' ); if ( dot != -1 ) type.truncate( dot ); type = type.simplifyWhiteSpace(); @@ -2688,7 +2688,7 @@ void KMFolderCachedImap::slotQuotaResult( KIO::Job* job ) } void -KMFolderCachedImap::slotAnnotationChanged( const QString& entry, const QString& attribute, const QString& value ) +KMFolderCachedImap::slotAnnotationChanged( const TQString& entry, const TQString& attribute, const TQString& value ) { Q_UNUSED( attribute ); Q_UNUSED( value ); @@ -2790,7 +2790,7 @@ bool KMFolderCachedImap::isMoveable() const void KMFolderCachedImap::slotFolderDeletionOnServerFinished() { - for ( QStringList::const_iterator it = foldersForDeletionOnServer.constBegin(); + for ( TQStringList::const_iterator it = foldersForDeletionOnServer.constBegin(); it != foldersForDeletionOnServer.constEnd(); ++it ) { KURL url( mAccount->getUrl() ); url.setPath( *it ); @@ -2805,7 +2805,7 @@ int KMFolderCachedImap::createIndexFromContentsRecursive() return 0; KMFolderNode *node = 0; - for( QPtrListIterator<KMFolderNode> it( *folder()->child() ); (node = it.current()); ++it ) { + for( TQPtrListIterator<KMFolderNode> it( *folder()->child() ); (node = it.current()); ++it ) { if( !node->isDir() ) { KMFolderCachedImap* storage = static_cast<KMFolderCachedImap*>(static_cast<KMFolder*>(node)->storage()); kdDebug() << k_funcinfo << "Re-indexing: " << storage->folder()->label() << endl; @@ -2842,7 +2842,7 @@ bool KMFolderCachedImap::isCloseToQuota() const KMCommand* KMFolderCachedImap::rescueUnsyncedMessages() { - QValueList<unsigned long> newMsgs = findNewMessages(); + TQValueList<unsigned long> newMsgs = findNewMessages(); kdDebug() << k_funcinfo << newMsgs << " of " << count() << endl; if ( newMsgs.isEmpty() ) return 0; @@ -2850,7 +2850,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages() bool manualMove = true; while ( GlobalSettings::autoLostFoundMove() ) { // find the inbox of this account - KMFolder *inboxFolder = kmkernel->findFolderById( QString(".%1.directory/INBOX").arg( account()->id() ) ); + KMFolder *inboxFolder = kmkernel->findFolderById( TQString(".%1.directory/INBOX").arg( account()->id() ) ); if ( !inboxFolder ) { kdWarning(5006) << k_funcinfo << "inbox not found!" << endl; break; @@ -2882,15 +2882,15 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages() break; // create subfolder for this incident - QDate today = QDate::currentDate(); - QString baseName = folder()->label() + "-" + QString::number( today.year() ) - + (today.month() < 10 ? "0" : "" ) + QString::number( today.month() ) - + (today.day() < 10 ? "0" : "" ) + QString::number( today.day() ); - QString name = baseName; + TQDate today = TQDate::currentDate(); + TQString baseName = folder()->label() + "-" + TQString::number( today.year() ) + + (today.month() < 10 ? "0" : "" ) + TQString::number( today.month() ) + + (today.day() < 10 ? "0" : "" ) + TQString::number( today.day() ); + TQString name = baseName; int suffix = 0; while ( (node = lfFolder->child()->hasNamedFolder( name )) ) { ++suffix; - name = baseName + '-' + QString::number( suffix ); + name = baseName + '-' + TQString::number( suffix ); } kdDebug(5006) << k_funcinfo << "creating lost+found folder " << name << endl; dest = kmkernel->dimapFolderMgr()->createFolder( name, false, KMFolderTypeCachedImap, lfFolder->child() ); @@ -2913,14 +2913,14 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages() } if ( manualMove ) { - const QString msg ( i18n( "<p>There are new messages in this folder (%1), which " + const TQString msg ( i18n( "<p>There are new messages in this folder (%1), which " "have not been uploaded to the server yet, but the folder has been deleted " "on the server or you do not " "have sufficient access rights on the folder now to upload them. " "Please contact your administrator to allow upload of new messages " "to you, or move them out of this folder.</p> " "<p>Do you want to move these messages to another folder now?</p>").arg( folder()->prettyURL() ) ); - if ( KMessageBox::warningYesNo( 0, msg, QString::null, i18n("Move"), i18n("Do Not Move") ) == KMessageBox::Yes ) { + if ( KMessageBox::warningYesNo( 0, msg, TQString::null, i18n("Move"), i18n("Do Not Move") ) == KMessageBox::Yes ) { KMail::KMFolderSelDlg dlg( kmkernel->getKMMainWidget(), i18n("Move Messages to Folder"), true ); if ( dlg.exec() ) { @@ -2929,7 +2929,7 @@ KMCommand* KMFolderCachedImap::rescueUnsyncedMessages() } } if ( dest ) { - QPtrList<KMMsgBase> msgs; + TQPtrList<KMMsgBase> msgs; for( int i = 0; i < count(); ++i ) { KMMsgBase *msg = getMsgBase( i ); if( !msg ) continue; /* what goes on if getMsg() returns 0? */ @@ -2953,8 +2953,8 @@ void KMFolderCachedImap::rescueUnsyncedMessagesAndDeleteFolder( KMFolder *folder if ( storage ) { KMCommand *command = storage->rescueUnsyncedMessages(); if ( command ) { - connect( command, SIGNAL(completed(KMCommand*)), - SLOT(slotRescueDone(KMCommand*)) ); + connect( command, TQT_SIGNAL(completed(KMCommand*)), + TQT_SLOT(slotRescueDone(KMCommand*)) ); ++mRescueCommandCount; } else { // nothing to rescue, close folder @@ -2981,7 +2981,7 @@ void KMFolderCachedImap::slotRescueDone(KMCommand * command) --mRescueCommandCount; if ( mRescueCommandCount > 0 ) return; - for ( QValueList<KMFolder*>::ConstIterator it = mToBeDeletedAfterRescue.constBegin(); + for ( TQValueList<KMFolder*>::ConstIterator it = mToBeDeletedAfterRescue.constBegin(); it != mToBeDeletedAfterRescue.constEnd(); ++it ) { kmkernel->dimapFolderMgr()->remove( *it ); } |