From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmfolderimap.cpp | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'kmail/kmfolderimap.cpp') diff --git a/kmail/kmfolderimap.cpp b/kmail/kmfolderimap.cpp index f32162f8a..e5c7bd827 100644 --- a/kmail/kmfolderimap.cpp +++ b/kmail/kmfolderimap.cpp @@ -49,6 +49,7 @@ using KMail::ListJob; using KMail::SearchJob; #include "renamejob.h" using KMail::RenameJob; +#include "acljobs.h" #include #include @@ -73,6 +74,7 @@ KMFolderImap::KMFolderImap(KMFolder* folder, const char* aName) mCheckMail = true; mCheckingValidity = false; mUserRights = 0; + mUserRightsState = KMail::ACLJobs::NotFetchedYet; mAlreadyRemoved = false; mHasChildren = ChildrenUnknown; mMailCheckProgressItem = 0; @@ -108,12 +110,6 @@ KMFolderImap::~KMFolderImap() //----------------------------------------------------------------------------- void KMFolderImap::reallyDoClose(const char* owner) { - if (isSelected()) { - kdWarning(5006) << "Trying to close the selected folder " << label() << - " - ignoring!" << endl; - return; - } - // FIXME is this still needed? if (account()) account()->ignoreJobsForFolder( folder() ); @@ -334,8 +330,6 @@ void KMFolderImap::addMsgQuiet(KMMessage* aMsg) int idx = aFolder->find( aMsg ); assert( idx != -1 ); aFolder->take( idx ); - } else { - kdDebug(5006) << k_funcinfo << "no parent" << endl; } if ( !account()->hasCapability("uidplus") ) { // Remember the status with the MD5 as key @@ -999,6 +993,13 @@ void KMFolderImap::initializeFrom( KMFolderImap* parent, TQString folderPath, setNoChildren( mimeType == "message/digest" ); } +//----------------------------------------------------------------------------- +bool KMFolderImap::mailCheckInProgress() const +{ + return getContentState() != imapNoInformation && + getContentState() != imapFinished; +} + //----------------------------------------------------------------------------- void KMFolderImap::setChildrenState( TQString attributes ) { @@ -1188,7 +1189,7 @@ void KMFolderImap::getAndCheckFolder(bool force) return getFolder(force); if ( account() ) - account()->processNewMailSingleFolder( folder() ); + account()->processNewMailInFolder( folder() ); if (force) { // force an update mCheckFlags = true; @@ -2261,10 +2262,10 @@ int KMFolderImap::expungeContents() //----------------------------------------------------------------------------- void -KMFolderImap::setUserRights( unsigned int userRights ) +KMFolderImap::setUserRights( unsigned int userRights, KMail::ACLJobs::ACLFetchState userRightsState ) { mUserRights = userRights; - kdDebug(5006) << imapPath() << " setUserRights: " << userRights << endl; + mUserRightsState = userRightsState; } //----------------------------------------------------------------------------- @@ -2392,7 +2393,7 @@ bool KMFolderImap::isMoveable() const } //----------------------------------------------------------------------------- -const ulong KMFolderImap::serNumForUID( ulong uid ) +ulong KMFolderImap::serNumForUID( ulong uid ) { if ( mUidMetaDataMap.find( uid ) ) { KMMsgMetaData *md = mUidMetaDataMap[uid]; @@ -2431,4 +2432,13 @@ void KMFolderImap::finishMailCheck( const char *dbg, imapState state ) close(dbg); } +bool KMFolderImap::canDeleteMessages() const +{ + if ( isReadOnly() ) + return false; + if ( mUserRightsState == KMail::ACLJobs::Ok && !(mUserRights & KMail::ACLJobs::Delete) ) + return false; + return true; +} + #include "kmfolderimap.moc" -- cgit v1.2.1