summaryrefslogtreecommitdiffstats
path: root/kmail/kmacctimap.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmacctimap.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmacctimap.cpp')
-rw-r--r--kmail/kmacctimap.cpp126
1 files changed, 63 insertions, 63 deletions
diff --git a/kmail/kmacctimap.cpp b/kmail/kmacctimap.cpp
index 9e83d243d..bf96c79a1 100644
--- a/kmail/kmacctimap.cpp
+++ b/kmail/kmacctimap.cpp
@@ -50,12 +50,12 @@ using KPIM::ProgressManager;
#include <kmessagebox.h>
#include <kdebug.h>
-#include <qstylesheet.h>
+#include <tqstylesheet.h>
#include <errno.h>
//-----------------------------------------------------------------------------
-KMAcctImap::KMAcctImap(AccountManager* aOwner, const QString& aAccountName, uint id):
+KMAcctImap::KMAcctImap(AccountManager* aOwner, const TQString& aAccountName, uint id):
KMail::ImapAccountBase(aOwner, aAccountName, id),
mCountRemainChecks( 0 ),
mErrorTimer( 0, "mErrorTimer" )
@@ -64,17 +64,17 @@ KMAcctImap::KMAcctImap(AccountManager* aOwner, const QString& aAccountName, uint
mScheduler = 0;
mNoopTimer.start( 60000 ); // // send a noop every minute
mOpenFolders.setAutoDelete(true);
- connect(kmkernel->imapFolderMgr(), SIGNAL(changed()),
- this, SLOT(slotUpdateFolderList()));
- connect(&mErrorTimer, SIGNAL(timeout()), SLOT(slotResetConnectionError()));
+ connect(kmkernel->imapFolderMgr(), TQT_SIGNAL(changed()),
+ this, TQT_SLOT(slotUpdateFolderList()));
+ connect(&mErrorTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotResetConnectionError()));
- QString serNumUri = locateLocal( "data", "kmail/unfiltered." +
- QString("%1").arg(KAccount::id()) );
+ TQString serNumUri = locateLocal( "data", "kmail/unfiltered." +
+ TQString("%1").arg(KAccount::id()) );
KConfig config( serNumUri );
- QStringList serNums = config.readListEntry( "unfiltered" );
+ TQStringList serNums = config.readListEntry( "unfiltered" );
mFilterSerNumsToSave.setAutoDelete( false );
- for ( QStringList::ConstIterator it = serNums.begin();
+ for ( TQStringList::ConstIterator it = serNums.begin();
it != serNums.end(); ++it ) {
mFilterSerNums.append( (*it).toUInt() );
mFilterSerNumsToSave.insert( *it, (const int *)1 );
@@ -87,11 +87,11 @@ KMAcctImap::~KMAcctImap()
{
killAllJobs( true );
- QString serNumUri = locateLocal( "data", "kmail/unfiltered." +
- QString("%1").arg(KAccount::id()) );
+ TQString serNumUri = locateLocal( "data", "kmail/unfiltered." +
+ TQString("%1").arg(KAccount::id()) );
KConfig config( serNumUri );
- QStringList serNums;
- QDictIterator<int> it( mFilterSerNumsToSave );
+ TQStringList serNums;
+ TQDictIterator<int> it( mFilterSerNumsToSave );
for( ; it.current(); ++it )
serNums.append( it.currentKey() );
config.writeEntry( "unfiltered", serNums );
@@ -99,7 +99,7 @@ KMAcctImap::~KMAcctImap()
//-----------------------------------------------------------------------------
-QString KMAcctImap::type() const
+TQString KMAcctImap::type() const
{
return "imap";
}
@@ -125,7 +125,7 @@ void KMAcctImap::setImapFolder(KMFolderImap *aFolder)
//-----------------------------------------------------------------------------
-bool KMAcctImap::handleError( int errorCode, const QString &errorMsg, KIO::Job* job, const QString& context, bool abortSync )
+bool KMAcctImap::handleError( int errorCode, const TQString &errorMsg, KIO::Job* job, const TQString& context, bool abortSync )
{
/* TODO check where to handle this one better. */
if ( errorCode == KIO::ERR_DOES_NOT_EXIST ) {
@@ -141,11 +141,11 @@ bool KMAcctImap::handleError( int errorCode, const QString &errorMsg, KIO::Job*
//-----------------------------------------------------------------------------
void KMAcctImap::killAllJobs( bool disconnectSlave )
{
- QMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
+ TQMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
for ( ; it != mapJobData.end(); ++it)
{
- QPtrList<KMMessage> msgList = (*it).msgList;
- QPtrList<KMMessage>::Iterator it2 = msgList.begin();
+ TQPtrList<KMMessage> msgList = (*it).msgList;
+ TQPtrList<KMMessage>::Iterator it2 = msgList.begin();
for ( ; it2 != msgList.end(); ++it2 ) {
KMMessage *msg = *it2;
if ( msg->transferInProgress() ) {
@@ -179,7 +179,7 @@ void KMAcctImap::killAllJobs( bool disconnectSlave )
// KMAccount::deleteFolderJobs(); doesn't work here always, it deletes jobs from
// its own mJobList instead of our mJobList...
KMAccount::deleteFolderJobs();
- QPtrListIterator<ImapJob> it2( mJobList );
+ TQPtrListIterator<ImapJob> it2( mJobList );
while ( it2.current() ) {
ImapJob *job = it2.current();
++it2;
@@ -202,7 +202,7 @@ void KMAcctImap::killAllJobs( bool disconnectSlave )
void KMAcctImap::ignoreJobsForMessage( KMMessage* msg )
{
if (!msg) return;
- QPtrListIterator<ImapJob> it( mJobList );
+ TQPtrListIterator<ImapJob> it( mJobList );
while ( it.current() )
{
ImapJob *job = it.current();
@@ -217,7 +217,7 @@ void KMAcctImap::ignoreJobsForMessage( KMMessage* msg )
//-----------------------------------------------------------------------------
void KMAcctImap::ignoreJobsForFolder( KMFolder* folder )
{
- QPtrListIterator<ImapJob> it( mJobList );
+ TQPtrListIterator<ImapJob> it( mJobList );
while ( it.current() )
{
ImapJob *job = it.current();
@@ -233,9 +233,9 @@ void KMAcctImap::ignoreJobsForFolder( KMFolder* folder )
void KMAcctImap::removeSlaveJobsForFolder( KMFolder* folder )
{
// Make sure the folder is not referenced in any kio slave jobs
- QMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
+ TQMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
while ( it != mapJobData.end() ) {
- QMap<KIO::Job*, jobData>::Iterator i = it;
+ TQMap<KIO::Job*, jobData>::Iterator i = it;
it++;
if ( (*i).parent ) {
if ( (*i).parent == folder ) {
@@ -249,8 +249,8 @@ void KMAcctImap::removeSlaveJobsForFolder( KMFolder* folder )
void KMAcctImap::cancelMailCheck()
{
// Make list of folders to reset, like in killAllJobs
- QValueList<KMFolderImap*> folderList;
- QMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
+ TQValueList<KMFolderImap*> folderList;
+ TQMap<KIO::Job*, jobData>::Iterator it = mapJobData.begin();
for (; it != mapJobData.end(); ++it) {
if ( (*it).cancellable && (*it).parent ) {
folderList << static_cast<KMFolderImap*>((*it).parent->storage());
@@ -262,7 +262,7 @@ void KMAcctImap::cancelMailCheck()
killAllJobs( true );
// emit folderComplete, this is important for
// KMAccount::checkingMail() to be reset, in case we restart checking mail later.
- for( QValueList<KMFolderImap*>::Iterator it = folderList.begin(); it != folderList.end(); ++it ) {
+ for( TQValueList<KMFolderImap*>::Iterator it = folderList.begin(); it != folderList.end(); ++it ) {
KMFolderImap *fld = *it;
fld->sendFolderComplete(FALSE);
}
@@ -297,18 +297,18 @@ void KMAcctImap::processNewMail(bool interactive)
mMailCheckProgressItem =
ProgressManager::createProgressItem(
"MailCheckAccount" + name(),
- i18n("Checking account: %1" ).arg( QStyleSheet::escape( name() ) ),
- QString::null, // status
+ i18n("Checking account: %1" ).arg( TQStyleSheet::escape( name() ) ),
+ TQString::null, // status
true, // can be canceled
useSSL() || useTLS() );
mMailCheckProgressItem->setTotalItems( mMailCheckFolders.count() );
connect ( mMailCheckProgressItem,
- SIGNAL( progressItemCanceled( KPIM::ProgressItem*) ),
+ TQT_SIGNAL( progressItemCanceled( KPIM::ProgressItem*) ),
this,
- SLOT( slotMailCheckCanceled() ) );
+ TQT_SLOT( slotMailCheckCanceled() ) );
- QValueList<QGuardedPtr<KMFolder> >::Iterator it;
+ TQValueList<TQGuardedPtr<KMFolder> >::Iterator it;
// first get the current count of unread-messages
mCountRemainChecks = 0;
mCountUnread = 0;
@@ -336,8 +336,8 @@ void KMAcctImap::processNewMail(bool interactive)
mCountRemainChecks++;
if (imapFolder->isSelected()) {
- connect(imapFolder, SIGNAL(folderComplete(KMFolderImap*, bool)),
- this, SLOT(postProcessNewMail(KMFolderImap*, bool)));
+ connect(imapFolder, TQT_SIGNAL(folderComplete(KMFolderImap*, bool)),
+ this, TQT_SLOT(postProcessNewMail(KMFolderImap*, bool)));
imapFolder->getFolder();
} else if ( kmkernel->filterMgr()->atLeastOneIncomingFilterAppliesTo( id() ) &&
imapFolder->folder()->isSystemFolder() &&
@@ -345,13 +345,13 @@ void KMAcctImap::processNewMail(bool interactive)
imapFolder->open("acctimap"); // will be closed in the folderSelected slot
// first get new headers before we select the folder
imapFolder->setSelected( true );
- connect( imapFolder, SIGNAL( folderComplete( KMFolderImap*, bool ) ),
- this, SLOT( slotFolderSelected( KMFolderImap*, bool) ) );
+ connect( imapFolder, TQT_SIGNAL( folderComplete( KMFolderImap*, bool ) ),
+ this, TQT_SLOT( slotFolderSelected( KMFolderImap*, bool) ) );
imapFolder->getFolder();
}
else {
- connect(imapFolder, SIGNAL(numUnreadMsgsChanged(KMFolder*)),
- this, SLOT(postProcessNewMail(KMFolder*)));
+ connect(imapFolder, TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)),
+ this, TQT_SLOT(postProcessNewMail(KMFolder*)));
bool ok = imapFolder->processNewMail(interactive);
if (!ok)
{
@@ -382,15 +382,15 @@ void KMAcctImap::processNewMail(bool interactive)
//-----------------------------------------------------------------------------
void KMAcctImap::postProcessNewMail(KMFolderImap* folder, bool)
{
- disconnect(folder, SIGNAL(folderComplete(KMFolderImap*, bool)),
- this, SLOT(postProcessNewMail(KMFolderImap*, bool)));
+ disconnect(folder, TQT_SIGNAL(folderComplete(KMFolderImap*, bool)),
+ this, TQT_SLOT(postProcessNewMail(KMFolderImap*, bool)));
postProcessNewMail(static_cast<KMFolder*>(folder->folder()));
}
void KMAcctImap::postProcessNewMail( KMFolder * folder )
{
- disconnect( folder->storage(), SIGNAL(numUnreadMsgsChanged(KMFolder*)),
- this, SLOT(postProcessNewMail(KMFolder*)) );
+ disconnect( folder->storage(), TQT_SIGNAL(numUnreadMsgsChanged(KMFolder*)),
+ this, TQT_SLOT(postProcessNewMail(KMFolder*)) );
if ( mMailCheckProgressItem ) {
mMailCheckProgressItem->incCompletedItems();
@@ -400,7 +400,7 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
mCountRemainChecks--;
// count the unread messages
- const QString folderId = folder->idString();
+ const TQString folderId = folder->idString();
int newInFolder = folder->countUnread();
if ( mUnreadBeforeCheck.find( folderId ) != mUnreadBeforeCheck.end() )
newInFolder -= mUnreadBeforeCheck[folderId];
@@ -410,17 +410,17 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
}
// Filter messages
- QValueListIterator<Q_UINT32> filterIt = mFilterSerNums.begin();
- QValueList<Q_UINT32> inTransit;
+ TQValueListIterator<Q_UINT32> filterIt = mFilterSerNums.begin();
+ TQValueList<Q_UINT32> inTransit;
if (ActionScheduler::isEnabled() ||
kmkernel->filterMgr()->atLeastOneOnlineImapFolderTarget()) {
KMFilterMgr::FilterSet set = KMFilterMgr::Inbound;
- QValueList<KMFilter*> filters = kmkernel->filterMgr()->filters();
+ TQValueList<KMFilter*> filters = kmkernel->filterMgr()->filters();
if (!mScheduler) {
mScheduler = new KMail::ActionScheduler( set, filters );
mScheduler->setAccountId( id() );
- connect( mScheduler, SIGNAL(filtered(Q_UINT32)), this, SLOT(slotFiltered(Q_UINT32)) );
+ connect( mScheduler, TQT_SIGNAL(filtered(Q_UINT32)), this, TQT_SLOT(slotFiltered(Q_UINT32)) );
} else {
mScheduler->setFilterList( filters );
}
@@ -434,7 +434,7 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
// It's possible that the message has been deleted or moved into a
// different folder, or that the serNum is stale
if ( !folder ) {
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( *filterIt ) );
++filterIt;
continue;
}
@@ -443,7 +443,7 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
if (!imapFolder ||
!imapFolder->folder()->isSystemFolder() ||
!(imapFolder->imapPath() == "/INBOX/") ) { // sanity checking
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( *filterIt ) );
++filterIt;
continue;
}
@@ -452,7 +452,7 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
msg = folder->getMsg( idx );
if (!msg) { // sanity checking
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( *filterIt ) );
++filterIt;
continue;
}
@@ -469,11 +469,11 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
msg->setTransferInProgress(true);
if ( !msg->isComplete() ) {
FolderJob *job = folder->createJob(msg);
- connect(job, SIGNAL(messageRetrieved(KMMessage*)),
- SLOT(slotFilterMsg(KMMessage*)));
+ connect(job, TQT_SIGNAL(messageRetrieved(KMMessage*)),
+ TQT_SLOT(slotFilterMsg(KMMessage*)));
job->start();
} else {
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( *filterIt ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( *filterIt ) );
if (slotFilterMsg(msg) == 2) break;
}
}
@@ -498,7 +498,7 @@ void KMAcctImap::postProcessNewMail( KMFolder * folder )
//-----------------------------------------------------------------------------
void KMAcctImap::slotFiltered(Q_UINT32 serNum)
{
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( serNum ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( serNum ) );
}
//-----------------------------------------------------------------------------
@@ -509,14 +509,14 @@ void KMAcctImap::slotUpdateFolderList()
kdWarning(5006) << "KMAcctImap::slotUpdateFolderList return" << endl;
return;
}
- QStringList strList;
+ TQStringList strList;
mMailCheckFolders.clear();
kmkernel->imapFolderMgr()->createFolderList(&strList, &mMailCheckFolders,
- mFolder->folder()->child(), QString::null, false);
+ mFolder->folder()->child(), TQString::null, false);
// the new list
- QValueList<QGuardedPtr<KMFolder> > includedFolders;
+ TQValueList<TQGuardedPtr<KMFolder> > includedFolders;
// check for excluded folders
- QValueList<QGuardedPtr<KMFolder> >::Iterator it;
+ TQValueList<TQGuardedPtr<KMFolder> >::Iterator it;
for (it = mMailCheckFolders.begin(); it != mMailCheckFolders.end(); ++it)
{
KMFolderImap* folder = static_cast<KMFolderImap*>(((KMFolder*)(*it))->storage());
@@ -571,8 +571,8 @@ void KMAcctImap::slotResetConnectionError()
void KMAcctImap::slotFolderSelected( KMFolderImap* folder, bool )
{
folder->setSelected( false );
- disconnect( folder, SIGNAL( folderComplete( KMFolderImap*, bool ) ),
- this, SLOT( slotFolderSelected( KMFolderImap*, bool) ) );
+ disconnect( folder, TQT_SIGNAL( folderComplete( KMFolderImap*, bool ) ),
+ this, TQT_SLOT( slotFolderSelected( KMFolderImap*, bool) ) );
postProcessNewMail( static_cast<KMFolder*>(folder->folder()) );
folder->close( "acctimap" );
}
@@ -580,11 +580,11 @@ void KMAcctImap::slotFolderSelected( KMFolderImap* folder, bool )
void KMAcctImap::execFilters(Q_UINT32 serNum)
{
if ( !kmkernel->filterMgr()->atLeastOneFilterAppliesTo( id() ) ) return;
- QValueListIterator<Q_UINT32> findIt = mFilterSerNums.find( serNum );
+ TQValueListIterator<Q_UINT32> findIt = mFilterSerNums.find( serNum );
if ( findIt != mFilterSerNums.end() )
return;
mFilterSerNums.append( serNum );
- mFilterSerNumsToSave.insert( QString( "%1" ).arg( serNum ), (const int *)1 );
+ mFilterSerNumsToSave.insert( TQString( "%1" ).arg( serNum ), (const int *)1 );
}
int KMAcctImap::slotFilterMsg( KMMessage *msg )
@@ -596,7 +596,7 @@ int KMAcctImap::slotFilterMsg( KMMessage *msg )
msg->setTransferInProgress(false);
Q_UINT32 serNum = msg->getMsgSerNum();
if ( serNum )
- mFilterSerNumsToSave.remove( QString( "%1" ).arg( serNum ) );
+ mFilterSerNumsToSave.remove( TQString( "%1" ).arg( serNum ) );
int filterResult = kmkernel->filterMgr()->process(msg,
KMFilterMgr::Inbound,
@@ -604,7 +604,7 @@ int KMAcctImap::slotFilterMsg( KMMessage *msg )
id() );
if (filterResult == 2) {
// something went horribly wrong (out of space?)
- kmkernel->emergencyExit( i18n("Unable to process messages: " ) + QString::fromLocal8Bit(strerror(errno)));
+ kmkernel->emergencyExit( i18n("Unable to process messages: " ) + TQString::fromLocal8Bit(strerror(errno)));
return 2;
}
if (msg->parent()) { // unGet this msg