summaryrefslogtreecommitdiffstats
path: root/kmail/kmfolderimap.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-01 00:37:02 +0000
commitcc29364f06178f8f6b457384f2ec37a042bd9d43 (patch)
tree7c77a3184c698bbf9d98cef09fb1ba8124daceba /kmail/kmfolderimap.cpp
parent4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff)
downloadtdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz
tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip
* 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
Diffstat (limited to 'kmail/kmfolderimap.cpp')
-rw-r--r--kmail/kmfolderimap.cpp34
1 files changed, 22 insertions, 12 deletions
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 <kdebug.h>
#include <kio/scheduler.h>
@@ -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
@@ -1000,6 +994,13 @@ void KMFolderImap::initializeFrom( KMFolderImap* parent, TQString folderPath,
}
//-----------------------------------------------------------------------------
+bool KMFolderImap::mailCheckInProgress() const
+{
+ return getContentState() != imapNoInformation &&
+ getContentState() != imapFinished;
+}
+
+//-----------------------------------------------------------------------------
void KMFolderImap::setChildrenState( TQString attributes )
{
// update children state
@@ -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"