From d11d4301ea1519fe564ff6e2311b0b74c6c6dc3d Mon Sep 17 00:00:00 2001 From: Till Adam Date: Wed, 24 May 2006 16:32:33 +0000 Subject: [PATCH] Move the code that makes an empty quota info form an invalid one into the quotajob class, and out of kmfoldercachedimap, so it works for online imap as well. (proko2 issue 1186) svn path=/branches/kdepim/proko2/kdepim/; revision=544380 --- kmfoldercachedimap.cpp | 10 ---------- quotajobs.cpp | 10 +++++++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/kmfoldercachedimap.cpp b/kmfoldercachedimap.cpp index 0f6717bdc..a4fb3c315 100644 --- a/kmfoldercachedimap.cpp +++ b/kmfoldercachedimap.cpp @@ -2227,16 +2227,6 @@ void KMFolderCachedImap::slotQuotaResult( KIO::Job* job ) } else kdWarning(5006) << "slotGetQuotaResult: " << job->errorString() << endl; - } else { - // There was no error, which means the server does support quota, but - // our info is not valid. That means that there is no quota on this folder, - // which we indicate by setting the name to something valid, but leaving the - // values invalid or setting them to invalid, in case we had info there before. - if ( !mQuotaInfo.isValid() ) { - mQuotaInfo = empty; - mQuotaInfo.name = "STORAGE"; - writeConfigKeysWhichShouldNotGetOverwrittenByReadConfig(); - } } if (mAccount->slave()) mAccount->removeJob(job); diff --git a/quotajobs.cpp b/quotajobs.cpp index eba7c21db..26857b212 100644 --- a/quotajobs.cpp +++ b/quotajobs.cpp @@ -116,10 +116,14 @@ QuotaJobs::GetStorageQuotaJob::GetStorageQuotaJob( KIO::Slave* slave, const KURL void QuotaJobs::GetStorageQuotaJob::slotQuotarootResult( const QStringList& roots ) { - if ( mStorageQuotaInfo.isValid() ) { - emit storageQuotaResult( mStorageQuotaInfo ); + if ( !mStorageQuotaInfo.isValid() && !error() ) { + // No error, so the account supports quota, but no usable info + // was transmitted => no quota set on the folder. Make the info + // valid, bit leave it empty. + mStorageQuotaInfo.name = "STORAGE"; } -// emitResult(); + if ( mStorageQuotaInfo.isValid() ) + emit storageQuotaResult( mStorageQuotaInfo ); } void QuotaJobs::GetStorageQuotaJob::slotQuotaInfoReceived( const QuotaInfoList& infos )