summaryrefslogtreecommitdiffstats
path: root/kmail/imapaccountbase.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kmail/imapaccountbase.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/imapaccountbase.cpp')
-rw-r--r--kmail/imapaccountbase.cpp154
1 files changed, 77 insertions, 77 deletions
diff --git a/kmail/imapaccountbase.cpp b/kmail/imapaccountbase.cpp
index 01e1324c8..04dc29332 100644
--- a/kmail/imapaccountbase.cpp
+++ b/kmail/imapaccountbase.cpp
@@ -32,7 +32,7 @@ using KMail::SieveConfig;
using KMail::AccountManager;
#include "kmfolder.h"
#include "broadcaststatus.h"
-using KPIM::BroadcasStatus;
+using KPIM::BroadcastqStatus;
#include "kmmainwin.h"
#include "kmfolderimap.h"
#include "kmmainwidget.h"
@@ -79,8 +79,8 @@ namespace KMail {
//
//
- ImapAccountBase::ImapAccountBase( AccountManager * parent, const TQString & name, uint id )
- : NetworkAccount( parent, name, id ),
+ ImapAccountBase::ImapAccountBase( AccountManager * tqparent, const TQString & name, uint id )
+ : NetworkAccount( tqparent, name, id ),
mIdleTimer( 0, "mIdleTimer" ),
mNoopTimer( 0, "mNoopTimer" ),
mTotal( 0 ),
@@ -301,7 +301,7 @@ namespace KMail {
if (ret != TQDialog::Accepted ) {
mPasswordDialogIsActive = false;
mAskAgain = false;
- emit connectionResult( KIO::ERR_USER_CANCELED, TQString::null );
+ emit connectionResult( KIO::ERR_USER_CANCELED, TQString() );
return Error;
}
mPasswordDialogIsActive = false;
@@ -354,7 +354,7 @@ namespace KMail {
checkDone( false, CheckOK );
}
if ( showStatusMsg )
- BroadcasStatus::instance()->seStatusMsgTransmissionCompleted(
+ BroadcastqStatus::instance()->seStatusMsgTransmissionCompleted(
name(), newMails);
}
@@ -412,19 +412,19 @@ namespace KMail {
}
//-----------------------------------------------------------------------------
- // TODO imapPath can be removed once parent can be a KMFolderImapBase or whatever
- void ImapAccountBase::getUserRights( KMFolder* parent, const TQString& imapPath )
+ // TODO imapPath can be removed once tqparent can be a KMFolderImapBase or whatever
+ void ImapAccountBase::getUserRights( KMFolder* tqparent, 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,
- // even after a SETACL that removes the admin permissions. Other imap servers apparently
+ // even after a SETACL that removes the admin permissions. Other imap servers aptqparently
// don't even allow removing one's own admin permission, so this code won't hurt either).
if ( imapPath == "/INBOX/" ) {
- if ( parent->folderType() == KMFolderTypeImap )
- static_cast<KMFolderImap*>( parent->storage() )->setUserRights( ACLJobs::All, ACLJobs::Ok );
- else if ( parent->folderType() == KMFolderTypeCachedImap )
- static_cast<KMFolderCachedImap*>( parent->storage() )->setUserRights( ACLJobs::All, ACLJobs::Ok );
- emit receivedUserRights( parent ); // warning, you need to connect first to get that one
+ if ( tqparent->folderType() == KMFolderTypeImap )
+ static_cast<KMFolderImap*>( tqparent->storage() )->setUserRights( ACLJobs::All, ACLJobs::Ok );
+ else if ( tqparent->folderType() == KMFolderTypeCachedImap )
+ static_cast<KMFolderCachedImap*>( tqparent->storage() )->setUserRights( ACLJobs::All, ACLJobs::Ok );
+ emit receivedUserRights( tqparent ); // warning, you need to connect first to get that one
return;
}
@@ -433,7 +433,7 @@ namespace KMail {
ACLJobs::GetUserRightsJob* job = ACLJobs::getUserRights( mSlave, url );
- jobData jd( url.url(), parent );
+ jobData jd( url.url(), tqparent );
jd.cancellable = true;
insertJob(job, jd);
@@ -447,7 +447,7 @@ namespace KMail {
JobIterator it = findJob( job );
if ( it == jobsEnd() ) return;
- KMFolder* folder = (*it).parent;
+ KMFolder* folder = (*it).tqparent;
if ( job->error() ) {
if ( job->error() == KIO::ERR_UNSUPPORTED_ACTION ) // that's when the imap server doesn't support ACLs
mACLSupport = false;
@@ -471,13 +471,13 @@ namespace KMail {
}
//-----------------------------------------------------------------------------
- void ImapAccountBase::getACL( KMFolder* parent, const TQString& imapPath )
+ void ImapAccountBase::getACL( KMFolder* tqparent, const TQString& imapPath )
{
KURL url = getUrl();
url.setPath(imapPath);
ACLJobs::GetACLJob* job = ACLJobs::getACL( mSlave, url );
- jobData jd( url.url(), parent );
+ jobData jd( url.url(), tqparent );
jd.cancellable = true;
insertJob(job, jd);
@@ -491,21 +491,21 @@ namespace KMail {
JobIterator it = findJob( job );
if ( it == jobsEnd() ) return;
- KMFolder* folder = (*it).parent;
+ KMFolder* folder = (*it).tqparent;
emit receivedACL( folder, job, job->entries() );
if (mSlave) removeJob(job);
}
//-----------------------------------------------------------------------------
- // Do not remove imapPath, FolderDiaQuotaTab needs to call this with parent==0.
- void ImapAccountBase::getStorageQuotaInfo( KMFolder* parent, const TQString& imapPath )
+ // Do not remove imapPath, FolderDiaQuotaTab needs to call this with tqparent==0.
+ void ImapAccountBase::getStorageQuotaInfo( KMFolder* tqparent, const TQString& imapPath )
{
if ( !mSlave ) return;
KURL url = getUrl();
url.setPath(imapPath);
QuotaJobs::GetStorageQuotaJob* job = QuotaJobs::getStorageQuota( mSlave, url );
- jobData jd( url.url(), parent );
+ jobData jd( url.url(), tqparent );
jd.cancellable = true;
insertJob(job, jd);
@@ -521,7 +521,7 @@ namespace KMail {
if ( job->error() && job->error() == KIO::ERR_UNSUPPORTED_ACTION )
setHasNoQuotaSupport();
- KMFolder* folder = (*it).parent; // can be 0
+ KMFolder* folder = (*it).tqparent; // can be 0
emit receivedStorageQuotaInfo( folder, job, job->storageQuotaInfo() );
if (mSlave) removeJob(job);
}
@@ -570,7 +570,7 @@ namespace KMail {
const TQString &errorMsg)
{
if (aSlave != mSlave) return;
- handleError( errorCode, errorMsg, 0, TQString::null, true );
+ handleError( errorCode, errorMsg, 0, TQString(), true );
if ( mAskAgain )
if ( makeConnection() != ImapAccountBase::Error )
return;
@@ -593,7 +593,7 @@ namespace KMail {
if (aSlave != mSlave) return;
mSlaveConnected = true;
mNoopTimer.start( 60000 ); // make sure we start sending noops
- emit connectionResult( 0, TQString::null ); // success
+ emit connectionResult( 0, TQString() ); // success
if ( mNamespaces.isEmpty() || mNamespaceToDelimiter.isEmpty() ) {
connect( this, TQT_SIGNAL( namespacesFetched( const ImapAccountBase::nsDelimMap& ) ),
@@ -643,7 +643,7 @@ namespace KMail {
jd.progressItem = ProgressManager::createProgressItem(
ProgressManager::getUniqueID(),
i18n("Retrieving Namespaces"),
- TQString::null, true, useSSL() || useTLS() );
+ TQString(), true, useSSL() || useTLS() );
jd.progressItem->setTotalItems( 1 );
connect ( jd.progressItem,
TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem* ) ),
@@ -737,7 +737,7 @@ namespace KMail {
"configuration of the account \"%1\" which is obsolete with the "
"support of IMAP namespaces.").arg( name() );
if ( list.tqcontains( "" ) ) {
- // tqreplace empty entry with the old prefix
+ // replace empty entry with the old prefix
list.remove( "" );
list += mOldPrefix;
mNamespaces[PersonalNS] = list;
@@ -746,11 +746,11 @@ namespace KMail {
mNamespaceToDelimiter.remove( "" );
mNamespaceToDelimiter[mOldPrefix] = delim;
}
- kdDebug(5006) << "migratePrefix - tqreplaced empty with " << mOldPrefix << endl;
+ kdDebug(5006) << "migratePrefix - replaced empty with " << mOldPrefix << endl;
msg += i18n("The configuration was automatically migrated but you should check "
"your account configuration.");
} else if ( list.count() == 1 ) {
- // only one entry in the personal namespace so tqreplace it
+ // only one entry in the personal namespace so replace it
TQString old = list.first();
list.clear();
list += mOldPrefix;
@@ -760,7 +760,7 @@ namespace KMail {
mNamespaceToDelimiter.remove( old );
mNamespaceToDelimiter[mOldPrefix] = delim;
}
- kdDebug(5006) << "migratePrefix - tqreplaced single with " << mOldPrefix << endl;
+ kdDebug(5006) << "migratePrefix - replaced single with " << mOldPrefix << endl;
msg += i18n("The configuration was automatically migrated but you should check "
"your account configuration.");
} else {
@@ -799,12 +799,12 @@ namespace KMail {
ns = ns.left( ns.length()-1 );
}
// first ignore an empty prefix as it would match always
- if ( !ns.isEmpty() && path.find( ns ) != -1 ) {
+ if ( !ns.isEmpty() && path.tqfind( ns ) != -1 ) {
return (*strit);
}
}
}
- return TQString::null;
+ return TQString();
}
//-----------------------------------------------------------------------------
@@ -820,7 +820,7 @@ namespace KMail {
// exclude empty namespace
for ( namespaceDelim::ConstIterator it = mNamespaceToDelimiter.begin();
it != mNamespaceToDelimiter.end(); ++it ) {
- // the namespace definition sometimes tqcontains the delimiter
+ // the namespace definition sometimes contains the delimiter
// make sure we also match this version
TQString stripped = it.key().left( it.key().length() - 1 );
if ( !it.key().isEmpty() &&
@@ -835,7 +835,7 @@ namespace KMail {
}
// well, we tried
//kdDebug(5006) << "delimiterForNamespace - not found" << endl;
- return TQString::null;
+ return TQString();
}
//-----------------------------------------------------------------------------
@@ -858,7 +858,7 @@ namespace KMail {
}
if (job->error()) {
if (!quiet)
- handleJobError(job, TQString::null );
+ handleJobError(job, TQString() );
else {
if ( job->error() == KIO::ERR_CONNECTION_BROKEN && slave() ) {
// make sure ERR_CONNECTION_BROKEN is properly handled and the slave
@@ -894,13 +894,13 @@ namespace KMail {
TQString ImapAccountBase::prettifyQuotaError( const TQString& _error, KIO::Job * job )
{
TQString error = _error;
- if ( error.find( "quota", 0, false ) == -1 ) return error;
+ if ( error.tqfind( "quota", 0, false ) == -1 ) return error;
// this is a quota error, prettify it a bit
JobIterator it = findJob( job );
TQString quotaAsString( i18n("No detailed quota information available.") );
bool readOnly = false;
if (it != mapJobData.end()) {
- const KMFolder * const folder = (*it).parent;
+ const KMFolder * const folder = (*it).tqparent;
if( !folder ) return _error;
const KMFolderCachedImap * const imap = dynamic_cast<const KMFolderCachedImap*>( folder->storage() );
if ( imap ) {
@@ -961,10 +961,10 @@ namespace KMail {
KMessageBox::information( kapp->activeWindow(), msg, caption, "kmailConnectionBrokenErrorDialog" );
// Show it in the status bar, in case the user has ticked "don't show again"
if ( errorCode == KIO::ERR_CONNECTION_BROKEN )
- KPIM::BroadcasStatus::instance()->seStatusMsg(
+ KPIM::BroadcastqStatus::instance()->seStatusMsg(
i18n( "The connection to account %1 was broken." ).arg( name() ) );
else if ( errorCode == KIO::ERR_SERVER_TIMEOUT )
- KPIM::BroadcasStatus::instance()->seStatusMsg(
+ KPIM::BroadcastqStatus::instance()->seStatusMsg(
i18n( "The connection to account %1 timed out." ).arg( name() ) );
} else {
if ( !errors.isEmpty() )
@@ -1031,9 +1031,9 @@ namespace KMail {
mCheckingSingleFolder = ( type == Single );
if ( checkingMail() )
{
- disconnect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ),
+ disconnect( this, TQT_SIGNAL( finishedCheck( bool, ChecktqStatus ) ),
this, TQT_SLOT( slotCheckQueuedFolders() ) );
- connect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ),
+ connect( this, TQT_SIGNAL( finishedCheck( bool, ChecktqStatus ) ),
this, TQT_SLOT( slotCheckQueuedFolders() ) );
} else {
slotCheckQueuedFolders();
@@ -1043,7 +1043,7 @@ namespace KMail {
//-----------------------------------------------------------------------------
void ImapAccountBase::slotCheckQueuedFolders()
{
- disconnect( this, TQT_SIGNAL( finishedCheck( bool, CheckStatus ) ),
+ disconnect( this, TQT_SIGNAL( finishedCheck( bool, ChecktqStatus ) ),
this, TQT_SLOT( slotCheckQueuedFolders() ) );
TQValueList<TQGuardedPtr<KMFolder> > mSaveList = mMailCheckFolders;
@@ -1109,7 +1109,7 @@ namespace KMail {
// more than 50% of the parts have to be loaded anyway so it is faster
// to load the message completely
kdDebug(5006) << "Falling back to normal mode" << endl;
- FolderJob *job = msg->parent()->createJob(
+ FolderJob *job = msg->tqparent()->createJob(
msg, FolderJob::tGetMessage, 0, "TEXT" );
job->start();
return;
@@ -1123,14 +1123,14 @@ namespace KMail {
if ( part->loadHeaders() )
{
kdDebug(5006) << "load HEADER" << endl;
- FolderJob *job = msg->parent()->createJob(
+ FolderJob *job = msg->tqparent()->createJob(
msg, FolderJob::tGetMessage, 0, part->partSpecifier()+".MIME" );
job->start();
}
if ( part->loadPart() )
{
kdDebug(5006) << "load Part" << endl;
- FolderJob *job = msg->parent()->createJob(
+ FolderJob *job = msg->tqparent()->createJob(
msg, FolderJob::tGetMessage, 0, part->partSpecifier() );
job->start();
}
@@ -1138,26 +1138,26 @@ namespace KMail {
}
//-----------------------------------------------------------------------------
- void ImapAccountBase::constructParts( TQDataStream & stream, int count, KMMessagePart* parentKMPart,
- DwBodyPart * parent, const DwMessage * dwmsg )
+ void ImapAccountBase::constructParts( TQDataStream & stream, int count, KMMessagePart* tqparentKMPart,
+ DwBodyPart * tqparent, const DwMessage * dwmsg )
{
- int children;
+ int tqchildren;
for (int i = 0; i < count; i++)
{
- stream >> children;
+ stream >> tqchildren;
KMMessagePart* part = new KMMessagePart( stream );
- part->setParent( parentKMPart );
+ part->setParent( tqparentKMPart );
mBodyPartList.append( part );
kdDebug(5006) << "ImapAccountBase::constructParts - created id " << part->partSpecifier()
<< " of type " << part->originalContentTypeStr() << endl;
DwBodyPart *dwpart = mCurrentMsg->createDWBodyPart( part );
- if ( parent )
+ if ( tqparent )
{
- // add to parent body
- parent->Body().AddBodyPart( dwpart );
+ // add to tqparent body
+ tqparent->Body().AddBodyPart( dwpart );
dwpart->Parse();
-// kdDebug(5006) << "constructed dwpart " << dwpart << ",dwmsg " << dwmsg << ",parent " << parent
+// kdDebug(5006) << "constructed dwpart " << dwpart << ",dwmsg " << dwmsg << ",tqparent " << tqparent
// << ",dwparts msg " << dwpart->Body().Message() <<",id "<<dwpart->ObjectId() << endl;
} else if ( part->partSpecifier() != "0" &&
!part->partSpecifier().endsWith(".HEADER") )
@@ -1165,39 +1165,39 @@ namespace KMail {
// add to message
dwmsg->Body().AddBodyPart( dwpart );
dwpart->Parse();
-// kdDebug(5006) << "constructed dwpart " << dwpart << ",dwmsg " << dwmsg << ",parent " << parent
+// kdDebug(5006) << "constructed dwpart " << dwpart << ",dwmsg " << dwmsg << ",tqparent " << tqparent
// << ",dwparts msg " << dwpart->Body().Message() <<",id "<<dwpart->ObjectId() << endl;
} else
dwpart = 0;
- if ( !parentKMPart )
- parentKMPart = part;
+ if ( !tqparentKMPart )
+ tqparentKMPart = part;
- if (children > 0)
+ if (tqchildren > 0)
{
- DwBodyPart* newparent = dwpart;
+ DwBodyPart* newtqparent = dwpart;
const DwMessage* newmsg = dwmsg;
if ( part->originalContentTypeStr() == "MESSAGE/RFC822" && dwpart &&
dwpart->Body().Message() )
{
// set the encapsulated message as the new message
- newparent = 0;
+ newtqparent = 0;
newmsg = dwpart->Body().Message();
}
KMMessagePart* newParentKMPart = part;
- if ( part->partSpecifier().endsWith(".HEADER") ) // we don't want headers as parent
- newParentKMPart = parentKMPart;
+ if ( part->partSpecifier().endsWith(".HEADER") ) // we don't want headers as tqparent
+ newParentKMPart = tqparentKMPart;
- constructParts( stream, children, newParentKMPart, newparent, newmsg );
+ constructParts( stream, tqchildren, newParentKMPart, newtqparent, newmsg );
}
}
}
//-----------------------------------------------------------------------------
- void ImapAccountBase::setImapStatus( KMFolder* folder, const TQString& path, const TQCString& flags )
+ void ImapAccountBase::setImaptqStatus( 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;
+ kdDebug(5006) << "setImaptqStatus path=" << path << " to: " << flags << endl;
KURL url = getUrl();
url.setPath(path);
@@ -1218,7 +1218,7 @@ namespace KMail {
TQT_SLOT(slotSeStatusResult(KIO::Job *)));
}
- void ImapAccountBase::setImapSeenStatus(KMFolder * folder, const TQString & path, bool seen)
+ void ImapAccountBase::setImapSeentqStatus(KMFolder * folder, const TQString & path, bool seen)
{
KURL url = getUrl();
url.setPath(path);
@@ -1246,16 +1246,16 @@ namespace KMail {
ImapAccountBase::JobIterator it = findJob(job);
if ( it == jobsEnd() ) return;
int errorCode = job->error();
- KMFolder * const parent = (*it).parent;
+ KMFolder * const tqparent = (*it).tqparent;
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' );
- emit imapStatusChanged( parent, path, cont );
+ emit imapStatusChanged( tqparent, path, cont );
}
else
{
- emit imapStatusChanged( parent, path, true );
+ emit imapStatusChanged( tqparent, path, true );
removeJob(it);
}
}
@@ -1370,11 +1370,11 @@ namespace KMail {
}
//------------------------------------------------------------------------------
- TQString ImapAccountBase::createImapPath( const TQString& parent,
+ TQString ImapAccountBase::createImapPath( const TQString& tqparent,
const TQString& folderName )
{
- kdDebug(5006) << "createImapPath parent="<<parent<<", folderName="<<folderName<<endl;
- TQString newName = parent;
+ kdDebug(5006) << "createImapPath tqparent="<<tqparent<<", folderName="<<folderName<<endl;
+ TQString newName = tqparent;
// strip / at the end
if ( newName.endsWith("/") ) {
newName = newName.left( newName.length() - 1 );
@@ -1399,14 +1399,14 @@ namespace KMail {
}
//------------------------------------------------------------------------------
- TQString ImapAccountBase::createImapPath( FolderStorage* parent,
+ TQString ImapAccountBase::createImapPath( FolderStorage* tqparent,
const TQString& folderName )
{
TQString path;
- if ( parent->folderType() == KMFolderTypeImap ) {
- path = static_cast<KMFolderImap*>( parent )->imapPath();
- } else if ( parent->folderType() == KMFolderTypeCachedImap ) {
- path = static_cast<KMFolderCachedImap*>( parent )->imapPath();
+ if ( tqparent->folderType() == KMFolderTypeImap ) {
+ path = static_cast<KMFolderImap*>( tqparent )->imapPath();
+ } else if ( tqparent->folderType() == KMFolderTypeCachedImap ) {
+ path = static_cast<KMFolderCachedImap*>( tqparent )->imapPath();
} else {
// error
return path;
@@ -1418,7 +1418,7 @@ namespace KMail {
bool ImapAccountBase::locallySubscribedTo( const TQString& imapPath )
{
- return mLocalSubscriptionBlackList.find( imapPath ) == mLocalSubscriptionBlackList.end();
+ return mLocalSubscriptionBlackList.tqfind( imapPath ) == mLocalSubscriptionBlackList.end();
}
void ImapAccountBase::changeLocalSubscription( const TQString& imapPath, bool subscribe )