diff options
Diffstat (limited to 'kmail/imapaccountbase.cpp')
-rw-r--r-- | kmail/imapaccountbase.cpp | 304 |
1 files changed, 152 insertions, 152 deletions
diff --git a/kmail/imapaccountbase.cpp b/kmail/imapaccountbase.cpp index 9a04c3fd6..778403988 100644 --- a/kmail/imapaccountbase.cpp +++ b/kmail/imapaccountbase.cpp @@ -66,8 +66,8 @@ using KIO::PasswordDialog; #include <mimelib/message.h> //using KIO::Scheduler; // use FQN below -#include <qregexp.h> -#include <qstylesheet.h> +#include <tqregexp.h> +#include <tqstylesheet.h> namespace KMail { @@ -79,7 +79,7 @@ namespace KMail { // // - ImapAccountBase::ImapAccountBase( AccountManager * parent, const QString & name, uint id ) + ImapAccountBase::ImapAccountBase( AccountManager * parent, const TQString & name, uint id ) : NetworkAccount( parent, name, id ), mIdleTimer( 0, "mIdleTimer" ), mNoopTimer( 0, "mNoopTimer" ), @@ -105,12 +105,12 @@ namespace KMail { { mPort = imapDefaultPort; mBodyPartList.setAutoDelete(true); - KIO::Scheduler::connect(SIGNAL(slaveError(KIO::Slave *, int, const QString &)), - this, SLOT(slotSchedulerSlaveError(KIO::Slave *, int, const QString &))); - KIO::Scheduler::connect(SIGNAL(slaveConnected(KIO::Slave *)), - this, SLOT(slotSchedulerSlaveConnected(KIO::Slave *))); - connect(&mNoopTimer, SIGNAL(timeout()), SLOT(slotNoopTimeout())); - connect(&mIdleTimer, SIGNAL(timeout()), SLOT(slotIdleTimeout())); + KIO::Scheduler::connect(TQT_SIGNAL(slaveError(KIO::Slave *, int, const TQString &)), + this, TQT_SLOT(slotSchedulerSlaveError(KIO::Slave *, int, const TQString &))); + KIO::Scheduler::connect(TQT_SIGNAL(slaveConnected(KIO::Slave *)), + this, TQT_SLOT(slotSchedulerSlaveConnected(KIO::Slave *))); + connect(&mNoopTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotNoopTimeout())); + connect(&mIdleTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotIdleTimeout())); } ImapAccountBase::~ImapAccountBase() { @@ -149,7 +149,7 @@ namespace KMail { return imapDefaultPort; } - QString ImapAccountBase::protocol() const { + TQString ImapAccountBase::protocol() const { return useSSL() ? IMAP_SSL_PROTOCOL : IMAP_PROTOCOL; } @@ -200,13 +200,13 @@ namespace KMail { setListOnlyOpenFolders( config.readBoolEntry( "listOnlyOpenFolders", false ) ); // read namespaces nsMap map; - QStringList list = config.readListEntry( QString::number( PersonalNS ) ); + TQStringList list = config.readListEntry( TQString::number( PersonalNS ) ); if ( !list.isEmpty() ) map[PersonalNS] = list.gres( "\"", "" ); - list = config.readListEntry( QString::number( OtherUsersNS ) ); + list = config.readListEntry( TQString::number( OtherUsersNS ) ); if ( !list.isEmpty() ) map[OtherUsersNS] = list.gres( "\"", "" ); - list = config.readListEntry( QString::number( SharedNS ) ); + list = config.readListEntry( TQString::number( SharedNS ) ); if ( !list.isEmpty() ) map[SharedNS] = list.gres( "\"", "" ); setNamespaces( map ); @@ -216,7 +216,7 @@ namespace KMail { for ( namespaceDelim::ConstIterator it = entries.begin(); it != entries.end(); ++it ) { if ( it.key().startsWith( "Namespace:" ) ) { - QString key = it.key().right( it.key().length() - 10 ); + TQString key = it.key().right( it.key().length() - 10 ); namespaceToDelimiter[key] = it.data(); } } @@ -237,14 +237,14 @@ namespace KMail { config.writeEntry( "locally-subscribed-folders", onlyLocallySubscribedFolders() ); config.writeEntry( "loadondemand", loadOnDemand() ); config.writeEntry( "listOnlyOpenFolders", listOnlyOpenFolders() ); - QString data; + TQString data; for ( nsMap::Iterator it = mNamespaces.begin(); it != mNamespaces.end(); ++it ) { if ( !it.data().isEmpty() ) { data = "\"" + it.data().join("\",\"") + "\""; - config.writeEntry( QString::number( it.key() ), data ); + config.writeEntry( TQString::number( it.key() ), data ); } } - QString key; + TQString key; for ( namespaceDelim::ConstIterator it = mNamespaceToDelimiter.begin(); it != mNamespaceToDelimiter.end(); ++it ) { key = "Namespace:" + it.key(); @@ -280,15 +280,15 @@ namespace KMail { auth() != "GSSAPI" ) ) { Q_ASSERT( !mSlave ); // disconnected on 'wrong login' error already, or first try - QString log = login(); - QString pass = passwd(); + TQString log = login(); + TQString pass = passwd(); // We init "store" to true to indicate that we want to have the // "keep password" checkbox. Then, we set [Passwords]Keep to // storePasswd(), so that the checkbox in the dialog will be // init'ed correctly: KConfigGroup passwords( KGlobal::config(), "Passwords" ); passwords.writeEntry( "Keep", storePasswd() ); - QString msg = i18n("You need to supply a username and a password to " + TQString msg = i18n("You need to supply a username and a password to " "access this mailbox."); mPasswordDialogIsActive = true; @@ -296,10 +296,10 @@ namespace KMail { dlg.setPlainCaption( i18n("Authorization Dialog") ); dlg.addCommentLine( i18n("Account:"), name() ); int ret = dlg.exec(); - if (ret != QDialog::Accepted ) { + if (ret != TQDialog::Accepted ) { mPasswordDialogIsActive = false; mAskAgain = false; - emit connectionResult( KIO::ERR_USER_CANCELED, QString::null ); + emit connectionResult( KIO::ERR_USER_CANCELED, TQString::null ); return Error; } mPasswordDialogIsActive = false; @@ -327,7 +327,7 @@ namespace KMail { return Connecting; } - bool ImapAccountBase::handleJobError( KIO::Job *job, const QString& context, bool abortSync ) + bool ImapAccountBase::handleJobError( KIO::Job *job, const TQString& context, bool abortSync ) { JobIterator it = findJob( job ); if ( it != jobsEnd() && (*it).progressItem ) @@ -357,14 +357,14 @@ namespace KMail { } //----------------------------------------------------------------------------- - void ImapAccountBase::changeSubscription( bool subscribe, const QString& imapPath ) + void ImapAccountBase::changeSubscription( bool subscribe, const TQString& imapPath ) { // change the subscription of the folder KURL url = getUrl(); url.setPath(imapPath); - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly); if (subscribe) stream << (int) 'u' << url; @@ -382,8 +382,8 @@ namespace KMail { else jd.onlySubscribed = false; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotSubscriptionResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotSubscriptionResult(KIO::Job *))); } //----------------------------------------------------------------------------- @@ -393,7 +393,7 @@ namespace KMail { JobIterator it = findJob( job ); if ( it == jobsEnd() ) return; bool onlySubscribed = (*it).onlySubscribed; - QString path = static_cast<KIO::SimpleJob*>(job)->url().path(); + TQString path = static_cast<KIO::SimpleJob*>(job)->url().path(); if (job->error()) { handleJobError( job, i18n( "Error while trying to subscribe to %1:" ).arg( path ) + '\n' ); @@ -408,7 +408,7 @@ namespace KMail { //----------------------------------------------------------------------------- // TODO imapPath can be removed once parent can be a KMFolderImapBase or whatever - void ImapAccountBase::getUserRights( KMFolder* parent, const QString& imapPath ) + void ImapAccountBase::getUserRights( KMFolder* parent, const TQString& imapPath ) { // There isn't much point in asking the server about a user's rights on his own inbox, // it might not be the effective permissions (at least with Cyrus, one can admin his own inbox, @@ -432,8 +432,8 @@ namespace KMail { jd.cancellable = true; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotGetUserRightsResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotGetUserRightsResult(KIO::Job *))); } void ImapAccountBase::slotGetUserRightsResult( KIO::Job* _job ) @@ -463,7 +463,7 @@ namespace KMail { } //----------------------------------------------------------------------------- - void ImapAccountBase::getACL( KMFolder* parent, const QString& imapPath ) + void ImapAccountBase::getACL( KMFolder* parent, const TQString& imapPath ) { KURL url = getUrl(); url.setPath(imapPath); @@ -473,8 +473,8 @@ namespace KMail { jd.cancellable = true; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotGetACLResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotGetACLResult(KIO::Job *))); } void ImapAccountBase::slotGetACLResult( KIO::Job* _job ) @@ -490,7 +490,7 @@ namespace KMail { //----------------------------------------------------------------------------- // Do not remove imapPath, FolderDiaQuotaTab needs to call this with parent==0. - void ImapAccountBase::getStorageQuotaInfo( KMFolder* parent, const QString& imapPath ) + void ImapAccountBase::getStorageQuotaInfo( KMFolder* parent, const TQString& imapPath ) { if ( !mSlave ) return; KURL url = getUrl(); @@ -501,8 +501,8 @@ namespace KMail { jd.cancellable = true; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotGetStorageQuotaInfoResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotGetStorageQuotaInfoResult(KIO::Job *))); } void ImapAccountBase::slotGetStorageQuotaInfoResult( KIO::Job* _job ) @@ -521,15 +521,15 @@ namespace KMail { void ImapAccountBase::slotNoopTimeout() { if ( mSlave ) { - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly ); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly ); stream << ( int ) 'N'; KIO::SimpleJob *job = KIO::special( getUrl(), packedArgs, false ); KIO::Scheduler::assignJobToSlave(mSlave, job); - connect( job, SIGNAL(result( KIO::Job * ) ), - this, SLOT( slotSimpleResult( KIO::Job * ) ) ); + connect( job, TQT_SIGNAL(result( KIO::Job * ) ), + this, TQT_SLOT( slotSimpleResult( KIO::Job * ) ) ); } else { /* Stop the timer, we have disconnected. We have to make sure it is started again when a new slave appears. */ @@ -559,10 +559,10 @@ namespace KMail { //----------------------------------------------------------------------------- void ImapAccountBase::slotSchedulerSlaveError(KIO::Slave *aSlave, int errorCode, - const QString &errorMsg) + const TQString &errorMsg) { if (aSlave != mSlave) return; - handleError( errorCode, errorMsg, 0, QString::null, true ); + handleError( errorCode, errorMsg, 0, TQString::null, true ); if ( mAskAgain ) if ( makeConnection() != ImapAccountBase::Error ) return; @@ -585,81 +585,81 @@ namespace KMail { if (aSlave != mSlave) return; mSlaveConnected = true; mNoopTimer.start( 60000 ); // make sure we start sending noops - emit connectionResult( 0, QString::null ); // success + emit connectionResult( 0, TQString::null ); // success if ( mNamespaces.isEmpty() || mNamespaceToDelimiter.isEmpty() ) { - connect( this, SIGNAL( namespacesFetched( const ImapAccountBase::nsDelimMap& ) ), - this, SLOT( slotSaveNamespaces( const ImapAccountBase::nsDelimMap& ) ) ); + connect( this, TQT_SIGNAL( namespacesFetched( const ImapAccountBase::nsDelimMap& ) ), + this, TQT_SLOT( slotSaveNamespaces( const ImapAccountBase::nsDelimMap& ) ) ); getNamespaces(); } // get capabilities - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly); stream << (int) 'c'; KIO::SimpleJob *job = KIO::special( getUrl(), packedArgs, false ); KIO::Scheduler::assignJobToSlave( mSlave, job ); - connect( job, SIGNAL(infoMessage(KIO::Job*, const QString&)), - SLOT(slotCapabilitiesResult(KIO::Job*, const QString&)) ); + connect( job, TQT_SIGNAL(infoMessage(KIO::Job*, const TQString&)), + TQT_SLOT(slotCapabilitiesResult(KIO::Job*, const TQString&)) ); } //----------------------------------------------------------------------------- - void ImapAccountBase::slotCapabilitiesResult( KIO::Job*, const QString& result ) + void ImapAccountBase::slotCapabilitiesResult( KIO::Job*, const TQString& result ) { - mCapabilities = QStringList::split(' ', result.lower() ); + mCapabilities = TQStringList::split(' ', result.lower() ); kdDebug(5006) << "capabilities:" << mCapabilities << endl; } //----------------------------------------------------------------------------- void ImapAccountBase::getNamespaces() { - disconnect( this, SIGNAL( connectionResult(int, const QString&) ), - this, SLOT( getNamespaces() ) ); + disconnect( this, TQT_SIGNAL( connectionResult(int, const TQString&) ), + this, TQT_SLOT( getNamespaces() ) ); if ( makeConnection() != Connected || !mSlave ) { kdDebug(5006) << "getNamespaces - wait for connection" << endl; if ( mNamespaces.isEmpty() || mNamespaceToDelimiter.isEmpty() ) { // when the connection is established slotSchedulerSlaveConnected notifies us } else { // getNamespaces was called by someone else - connect( this, SIGNAL( connectionResult(int, const QString&) ), - this, SLOT( getNamespaces() ) ); + connect( this, TQT_SIGNAL( connectionResult(int, const TQString&) ), + this, TQT_SLOT( getNamespaces() ) ); } return; } - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly); stream << (int) 'n'; jobData jd; jd.total = 1; jd.done = 0; jd.cancellable = true; jd.progressItem = ProgressManager::createProgressItem( ProgressManager::getUniqueID(), i18n("Retrieving Namespaces"), - QString::null, true, useSSL() || useTLS() ); + TQString::null, true, useSSL() || useTLS() ); jd.progressItem->setTotalItems( 1 ); connect ( jd.progressItem, - SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ), + TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ), this, - SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); + TQT_SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); KIO::SimpleJob *job = KIO::special( getUrl(), packedArgs, false ); KIO::Scheduler::assignJobToSlave( mSlave, job ); insertJob( job, jd ); - connect( job, SIGNAL( infoMessage(KIO::Job*, const QString&) ), - SLOT( slotNamespaceResult(KIO::Job*, const QString&) ) ); + connect( job, TQT_SIGNAL( infoMessage(KIO::Job*, const TQString&) ), + TQT_SLOT( slotNamespaceResult(KIO::Job*, const TQString&) ) ); } //----------------------------------------------------------------------------- - void ImapAccountBase::slotNamespaceResult( KIO::Job* job, const QString& str ) + void ImapAccountBase::slotNamespaceResult( KIO::Job* job, const TQString& str ) { JobIterator it = findJob( job ); if ( it == jobsEnd() ) return; nsDelimMap map; namespaceDelim nsDelim; - QStringList ns = QStringList::split( ",", str ); - for ( QStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) { + TQStringList ns = TQStringList::split( ",", str ); + for ( TQStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) { // split, allow empty parts as we can get empty namespaces - QStringList parts = QStringList::split( "=", *it, true ); + TQStringList parts = TQStringList::split( "=", *it, true ); imapNamespace section = imapNamespace( parts[0].toInt() ); if ( map.contains( section ) ) { nsDelim = map[section]; @@ -687,7 +687,7 @@ namespace KMail { imapNamespace section = imapNamespace( i ); namespaceDelim ns = map[ section ]; namespaceDelim::ConstIterator it; - QStringList list; + TQStringList list; for ( it = ns.begin(); it != ns.end(); ++it ) { list += it.key(); mNamespaceToDelimiter[ it.key() ] = it.data(); @@ -714,9 +714,9 @@ namespace KMail { if ( mOldPrefix.endsWith("/") ) { mOldPrefix = mOldPrefix.left( mOldPrefix.length()-1 ); } - QStringList list = mNamespaces[PersonalNS]; + TQStringList list = mNamespaces[PersonalNS]; bool done = false; - for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { if ( (*it).startsWith( mOldPrefix ) ) { // should be ok done = true; @@ -725,7 +725,7 @@ namespace KMail { } } if ( !done ) { - QString msg = i18n("KMail has detected a prefix entry in the " + TQString msg = i18n("KMail has detected a prefix entry in the " "configuration of the account \"%1\" which is obsolete with the " "support of IMAP namespaces.").arg( name() ); if ( list.contains( "" ) ) { @@ -734,7 +734,7 @@ namespace KMail { list += mOldPrefix; mNamespaces[PersonalNS] = list; if ( mNamespaceToDelimiter.contains( "" ) ) { - QString delim = mNamespaceToDelimiter[""]; + TQString delim = mNamespaceToDelimiter[""]; mNamespaceToDelimiter.remove( "" ); mNamespaceToDelimiter[mOldPrefix] = delim; } @@ -743,12 +743,12 @@ namespace KMail { "your account configuration."); } else if ( list.count() == 1 ) { // only one entry in the personal namespace so replace it - QString old = list.first(); + TQString old = list.first(); list.clear(); list += mOldPrefix; mNamespaces[PersonalNS] = list; if ( mNamespaceToDelimiter.contains( old ) ) { - QString delim = mNamespaceToDelimiter[old]; + TQString delim = mNamespaceToDelimiter[old]; mNamespaceToDelimiter.remove( old ); mNamespaceToDelimiter[mOldPrefix] = delim; } @@ -770,9 +770,9 @@ namespace KMail { } //----------------------------------------------------------------------------- - QString ImapAccountBase::namespaceForFolder( FolderStorage* storage ) + TQString ImapAccountBase::namespaceForFolder( FolderStorage* storage ) { - QString path; + TQString path; if ( storage->folderType() == KMFolderTypeImap ) { path = static_cast<KMFolderImap*>( storage )->imapPath(); } else if ( storage->folderType() == KMFolderTypeCachedImap ) { @@ -782,10 +782,10 @@ namespace KMail { nsMap::Iterator it; for ( it = mNamespaces.begin(); it != mNamespaces.end(); ++it ) { - QStringList::Iterator strit; + TQStringList::Iterator strit; for ( strit = it.data().begin(); strit != it.data().end(); ++strit ) { - QString ns = *strit; + TQString ns = *strit; if ( ns.endsWith("/") || ns.endsWith(".") ) { // strip delimiter for the comparison ns = ns.left( ns.length()-1 ); @@ -796,11 +796,11 @@ namespace KMail { } } } - return QString::null; + return TQString::null; } //----------------------------------------------------------------------------- - QString ImapAccountBase::delimiterForNamespace( const QString& prefix ) + TQString ImapAccountBase::delimiterForNamespace( const TQString& prefix ) { kdDebug(5006) << "delimiterForNamespace " << prefix << endl; // try to match exactly @@ -814,7 +814,7 @@ namespace KMail { it != mNamespaceToDelimiter.end(); ++it ) { // the namespace definition sometimes contains the delimiter // make sure we also match this version - QString stripped = it.key().left( it.key().length() - 1 ); + TQString stripped = it.key().left( it.key().length() - 1 ); if ( !it.key().isEmpty() && ( prefix.contains( it.key() ) || prefix.contains( stripped ) ) ) { return it.data(); @@ -827,14 +827,14 @@ namespace KMail { } // well, we tried kdDebug(5006) << "delimiterForNamespace - not found" << endl; - return QString::null; + return TQString::null; } //----------------------------------------------------------------------------- - QString ImapAccountBase::delimiterForFolder( FolderStorage* storage ) + TQString ImapAccountBase::delimiterForFolder( FolderStorage* storage ) { - QString prefix = namespaceForFolder( storage ); - QString delim = delimiterForNamespace( prefix ); + TQString prefix = namespaceForFolder( storage ); + TQString delim = delimiterForNamespace( prefix ); return delim; } @@ -850,7 +850,7 @@ namespace KMail { } if (job->error()) { if (!quiet) - handleJobError(job, QString::null ); + handleJobError(job, TQString::null ); else { if ( job->error() == KIO::ERR_CONNECTION_BROKEN && slave() ) { // make sure ERR_CONNECTION_BROKEN is properly handled and the slave @@ -871,25 +871,25 @@ namespace KMail { KMMessage* msg = jd.msgList.first(); // Use double-quotes around the subject to keep the sentence readable, // but don't use double quotes around the sender since from() might return a double-quoted name already - const QString subject = msg->subject().isEmpty() ? i18n( "<unknown>" ) : QString("\"%1\"").arg( msg->subject() ); - const QString from = msg->from().isEmpty() ? i18n( "<unknown>" ) : msg->from(); - QString myError = "<p><b>" + i18n("Error while uploading message") + const TQString subject = msg->subject().isEmpty() ? i18n( "<unknown>" ) : TQString("\"%1\"").arg( msg->subject() ); + const TQString from = msg->from().isEmpty() ? i18n( "<unknown>" ) : msg->from(); + TQString myError = "<p><b>" + i18n("Error while uploading message") + "</b></p><p>" - + i18n("Could not upload the message dated %1 from <i>%2</i> with subject <i>%3</i> to the server.").arg( msg->dateStr(), QStyleSheet::escape( from ), QStyleSheet::escape( subject ) ) + + i18n("Could not upload the message dated %1 from <i>%2</i> with subject <i>%3</i> to the server.").arg( msg->dateStr(), TQStyleSheet::escape( from ), TQStyleSheet::escape( subject ) ) + "</p><p>" - + i18n("The destination folder was: <b>%1</b>.").arg( QStyleSheet::escape( folder->prettyURL() ) ) + + i18n("The destination folder was: <b>%1</b>.").arg( TQStyleSheet::escape( folder->prettyURL() ) ) + "</p><p>" + i18n("The server reported:") + "</p>"; return handleJobError( job, myError ); } - QString ImapAccountBase::prettifyQuotaError( const QString& _error, KIO::Job * job ) + TQString ImapAccountBase::prettifyQuotaError( const TQString& _error, KIO::Job * job ) { - QString error = _error; + TQString error = _error; if ( error.find( "quota", 0, false ) == -1 ) return error; // this is a quota error, prettify it a bit JobIterator it = findJob( job ); - QString quotaAsString( i18n("No detailed quota information available.") ); + TQString quotaAsString( i18n("No detailed quota information available.") ); bool readOnly = false; if (it != mapJobData.end()) { const KMFolder * const folder = (*it).parent; @@ -909,10 +909,10 @@ namespace KMail { } //----------------------------------------------------------------------------- - bool ImapAccountBase::handleError( int errorCode, const QString &errorMsg, KIO::Job* job, const QString& context, bool abortSync ) + bool ImapAccountBase::handleError( int errorCode, const TQString &errorMsg, KIO::Job* job, const TQString& context, bool abortSync ) { // Copy job's data before a possible killAllJobs - QStringList errors; + TQStringList errors; if ( job && job->error() != KIO::ERR_SLAVE_DEFINED /*workaround for kdelibs-3.2*/) errors = job->detailedErrorStrings(); @@ -943,8 +943,8 @@ namespace KMail { // check if we still display an error if ( !mErrorDialogIsActive && errorCode != KIO::ERR_USER_CANCELED ) { mErrorDialogIsActive = true; - QString msg = context + '\n' + prettifyQuotaError( KIO::buildErrorString( errorCode, errorMsg ), job ); - QString caption = i18n("Error"); + TQString msg = context + '\n' + prettifyQuotaError( KIO::buildErrorString( errorCode, errorMsg ), job ); + TQString caption = i18n("Error"); if ( jobsKilled || errorCode == KIO::ERR_COULD_NOT_LOGIN ) { if ( errorCode == KIO::ERR_SERVER_TIMEOUT || errorCode == KIO::ERR_CONNECTION_BROKEN ) { @@ -966,8 +966,8 @@ namespace KMail { } } else { // i.e. we have a chance to continue, ask the user about it if ( errors.count() >= 3 ) { // there is no detailedWarningContinueCancel... (#86517) - QString error = prettifyQuotaError( errors[1], job ); - msg = QString( "<qt>") + context + error + '\n' + errors[2]; + TQString error = prettifyQuotaError( errors[1], job ); + msg = TQString( "<qt>") + context + error + '\n' + errors[2]; caption = errors[0]; } int ret = KMessageBox::warningContinueCancel( kapp->activeWindow(), msg, caption ); @@ -989,12 +989,12 @@ namespace KMail { //----------------------------------------------------------------------------- void ImapAccountBase::cancelMailCheck() { - QMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin(); + TQMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin(); while ( it != mapJobData.end() ) { kdDebug(5006) << "cancelMailCheck: job is cancellable: " << (*it).cancellable << endl; if ( (*it).cancellable ) { it.key()->kill(); - QMap<KIO::Job*, jobData>::Iterator rmit = it; + TQMap<KIO::Job*, jobData>::Iterator rmit = it; ++it; mapJobData.remove( rmit ); // We killed a job -> this kills the slave @@ -1003,7 +1003,7 @@ namespace KMail { ++it; } - for( QPtrListIterator<FolderJob> it( mJobList ); it.current(); ++it ) { + for( TQPtrListIterator<FolderJob> it( mJobList ); it.current(); ++it ) { if ( it.current()->isCancellable() ) { FolderJob* job = it.current(); job->setPassiveDestructor( true ); @@ -1023,10 +1023,10 @@ namespace KMail { mCheckingSingleFolder = true; if ( checkingMail() ) { - disconnect( this, SIGNAL( finishedCheck( bool, CheckStatus ) ), - this, SLOT( slotCheckQueuedFolders() ) ); - connect( this, SIGNAL( finishedCheck( bool, CheckStatus ) ), - this, SLOT( slotCheckQueuedFolders() ) ); + disconnect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ), + this, TQT_SLOT( slotCheckQueuedFolders() ) ); + connect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ), + this, TQT_SLOT( slotCheckQueuedFolders() ) ); } else { slotCheckQueuedFolders(); } @@ -1035,10 +1035,10 @@ namespace KMail { //----------------------------------------------------------------------------- void ImapAccountBase::slotCheckQueuedFolders() { - disconnect( this, SIGNAL( finishedCheck( bool, CheckStatus ) ), - this, SLOT( slotCheckQueuedFolders() ) ); + disconnect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ), + this, TQT_SLOT( slotCheckQueuedFolders() ) ); - QValueList<QGuardedPtr<KMFolder> > mSaveList = mMailCheckFolders; + TQValueList<TQGuardedPtr<KMFolder> > mSaveList = mMailCheckFolders; mMailCheckFolders = mFoldersQueuedForChecking; if ( kmkernel->acctMgr() ) kmkernel->acctMgr()->singleCheckMail(this, true); @@ -1055,7 +1055,7 @@ namespace KMail { } //----------------------------------------------------------------------------- - void ImapAccountBase::handleBodyStructure( QDataStream & stream, KMMessage * msg, + void ImapAccountBase::handleBodyStructure( TQDataStream & stream, KMMessage * msg, const AttachmentStrategy *as ) { mBodyPartList.clear(); @@ -1076,9 +1076,9 @@ namespace KMail { // see what parts have to loaded according to attachmentstrategy BodyVisitor *visitor = BodyVisitorFactory::getVisitor( as ); visitor->visit( mBodyPartList ); - QPtrList<KMMessagePart> parts = visitor->partsToLoad(); + TQPtrList<KMMessagePart> parts = visitor->partsToLoad(); delete visitor; - QPtrListIterator<KMMessagePart> it( parts ); + TQPtrListIterator<KMMessagePart> it( parts ); KMMessagePart *part; int partsToLoad = 0; // check how many parts we have to load @@ -1130,7 +1130,7 @@ namespace KMail { } //----------------------------------------------------------------------------- - void ImapAccountBase::constructParts( QDataStream & stream, int count, KMMessagePart* parentKMPart, + void ImapAccountBase::constructParts( TQDataStream & stream, int count, KMMessagePart* parentKMPart, DwBodyPart * parent, const DwMessage * dwmsg ) { int children; @@ -1186,15 +1186,15 @@ namespace KMail { } //----------------------------------------------------------------------------- - void ImapAccountBase::setImapStatus( KMFolder* folder, const QString& path, const QCString& flags ) + void ImapAccountBase::setImapStatus( KMFolder* folder, const TQString& path, const TQCString& flags ) { // set the status on the server, the uids are integrated in the path kdDebug(5006) << "setImapStatus path=" << path << " to: " << flags << endl; KURL url = getUrl(); url.setPath(path); - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly); stream << (int) 'S' << url << flags; @@ -1206,17 +1206,17 @@ namespace KMail { ImapAccountBase::jobData jd( url.url(), folder ); jd.path = path; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotSetStatusResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotSetStatusResult(KIO::Job *))); } - void ImapAccountBase::setImapSeenStatus(KMFolder * folder, const QString & path, bool seen) + void ImapAccountBase::setImapSeenStatus(KMFolder * folder, const TQString & path, bool seen) { KURL url = getUrl(); url.setPath(path); - QByteArray packedArgs; - QDataStream stream( packedArgs, IO_WriteOnly); + TQByteArray packedArgs; + TQDataStream stream( packedArgs, IO_WriteOnly); stream << (int) 's' << url << seen; @@ -1228,8 +1228,8 @@ namespace KMail { ImapAccountBase::jobData jd( url.url(), folder ); jd.path = path; insertJob(job, jd); - connect(job, SIGNAL(result(KIO::Job *)), - SLOT(slotSetStatusResult(KIO::Job *))); + connect(job, TQT_SIGNAL(result(KIO::Job *)), + TQT_SLOT(slotSetStatusResult(KIO::Job *))); } //----------------------------------------------------------------------------- @@ -1239,7 +1239,7 @@ namespace KMail { if ( it == jobsEnd() ) return; int errorCode = job->error(); KMFolder * const parent = (*it).parent; - const QString path = (*it).path; + const TQString path = (*it).path; if (errorCode && errorCode != KIO::ERR_CANNOT_OPEN_FOR_WRITING) { bool cont = handleJobError( job, i18n( "Error while uploading status of messages to server: " ) + '\n' ); @@ -1286,14 +1286,14 @@ namespace KMail { { mListDirProgressItem = ProgressManager::createProgressItem( "ListDir" + name(), - QStyleSheet::escape( name() ), + TQStyleSheet::escape( name() ), i18n("retrieving folders"), true, useSSL() || useTLS() ); connect ( mListDirProgressItem, - SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ), + TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ), this, - SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); + TQT_SLOT( slotAbortRequested( KPIM::ProgressItem* ) ) ); // Start with a guessed value of the old folder count plus 5%. As long // as the list of folders doesn't constantly change, that should be good // enough. @@ -1312,9 +1312,9 @@ namespace KMail { } //------------------------------------------------------------------------------ - QString ImapAccountBase::addPathToNamespace( const QString& prefix ) + TQString ImapAccountBase::addPathToNamespace( const TQString& prefix ) { - QString myPrefix = prefix; + TQString myPrefix = prefix; if ( !myPrefix.startsWith( "/" ) ) { myPrefix = "/" + myPrefix; } @@ -1326,13 +1326,13 @@ namespace KMail { } //------------------------------------------------------------------------------ - bool ImapAccountBase::isNamespaceFolder( QString& name ) + bool ImapAccountBase::isNamespaceFolder( TQString& name ) { - QStringList ns = mNamespaces[OtherUsersNS]; + TQStringList ns = mNamespaces[OtherUsersNS]; ns += mNamespaces[SharedNS]; ns += mNamespaces[PersonalNS]; - QString nameWithDelimiter; - for ( QStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) + TQString nameWithDelimiter; + for ( TQStringList::Iterator it = ns.begin(); it != ns.end(); ++it ) { nameWithDelimiter = name + delimiterForNamespace( *it ); if ( *it == name || *it == nameWithDelimiter ) @@ -1349,9 +1349,9 @@ namespace KMail { for ( uint i = 0; i < 3; ++i ) { imapNamespace section = imapNamespace( i ); - QStringList namespaces = mNamespaces[section]; + TQStringList namespaces = mNamespaces[section]; namespaceDelim nsDelim; - QStringList::Iterator lit; + TQStringList::Iterator lit; for ( lit = namespaces.begin(); lit != namespaces.end(); ++lit ) { nsDelim[*lit] = delimiterForNamespace( *lit ); @@ -1362,17 +1362,17 @@ namespace KMail { } //------------------------------------------------------------------------------ - QString ImapAccountBase::createImapPath( const QString& parent, - const QString& folderName ) + TQString ImapAccountBase::createImapPath( const TQString& parent, + const TQString& folderName ) { kdDebug(5006) << "createImapPath parent="<<parent<<", folderName="<<folderName<<endl; - QString newName = parent; + TQString newName = parent; // strip / at the end if ( newName.endsWith("/") ) { newName = newName.left( newName.length() - 1 ); } // add correct delimiter - QString delim = delimiterForNamespace( newName ); + TQString delim = delimiterForNamespace( newName ); // should not happen... if ( delim.isEmpty() ) { delim = "/"; @@ -1391,10 +1391,10 @@ namespace KMail { } //------------------------------------------------------------------------------ - QString ImapAccountBase::createImapPath( FolderStorage* parent, - const QString& folderName ) + TQString ImapAccountBase::createImapPath( FolderStorage* parent, + const TQString& folderName ) { - QString path; + TQString path; if ( parent->folderType() == KMFolderTypeImap ) { path = static_cast<KMFolderImap*>( parent )->imapPath(); } else if ( parent->folderType() == KMFolderTypeCachedImap ) { @@ -1408,12 +1408,12 @@ namespace KMail { } - bool ImapAccountBase::locallySubscribedTo( const QString& imapPath ) + bool ImapAccountBase::locallySubscribedTo( const TQString& imapPath ) { return mLocalSubscriptionBlackList.find( imapPath ) == mLocalSubscriptionBlackList.end(); } - void ImapAccountBase::changeLocalSubscription( const QString& imapPath, bool subscribe ) + void ImapAccountBase::changeLocalSubscription( const TQString& imapPath, bool subscribe ) { if ( subscribe ) { // find in blacklist and remove from it @@ -1425,19 +1425,19 @@ namespace KMail { } - QStringList ImapAccountBase::locallyBlacklistedFolders() const + TQStringList ImapAccountBase::locallyBlacklistedFolders() const { - QStringList list; - std::set<QString>::const_iterator it = mLocalSubscriptionBlackList.begin(); - std::set<QString>::const_iterator end = mLocalSubscriptionBlackList.end(); + TQStringList list; + std::set<TQString>::const_iterator it = mLocalSubscriptionBlackList.begin(); + std::set<TQString>::const_iterator end = mLocalSubscriptionBlackList.end(); for ( ; it != end ; ++it ) list.append( *it ); return list; } - void ImapAccountBase::localBlacklistFromStringList( const QStringList &list ) + void ImapAccountBase::localBlacklistFromStringList( const TQStringList &list ) { - for( QStringList::ConstIterator it = list.constBegin( ); it != list.constEnd( ); ++it ) + for( TQStringList::ConstIterator it = list.constBegin( ); it != list.constEnd( ); ++it ) mLocalSubscriptionBlackList.insert( *it ); } |