summaryrefslogtreecommitdiffstats
path: root/kmail/kmfolder.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/kmfolder.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/kmfolder.cpp')
-rw-r--r--kmail/kmfolder.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/kmail/kmfolder.cpp b/kmail/kmfolder.cpp
index cae870710..68fb52f04 100644
--- a/kmail/kmfolder.cpp
+++ b/kmail/kmfolder.cpp
@@ -124,6 +124,10 @@ KMFolder::KMFolder( KMFolderDir* aParent, const TQString& aFolderName,
TQT_SIGNAL( numUnreadMsgsChanged( KMFolder* ) ) );
connect( mStorage, TQT_SIGNAL( removed( KMFolder*, bool ) ),
TQT_SIGNAL( removed( KMFolder*, bool ) ) );
+ connect( mStorage, TQT_SIGNAL(noContentChanged()),
+ TQT_SIGNAL(noContentChanged()) );
+ connect( mStorage, TQT_SIGNAL(syncStateChanged()),
+ TQT_SIGNAL(syncStateChanged()) );
connect( mStorage, TQT_SIGNAL( contentsTypeChanged( KMail::FolderContentsType ) ),
this, TQT_SLOT( slotContentsTypeChanged( KMail::FolderContentsType ) ) );
@@ -559,6 +563,21 @@ bool KMFolder::isReadOnly() const
return mStorage->isReadOnly();
}
+bool KMFolder::mailCheckInProgress() const
+{
+ return mStorage->mailCheckInProgress();
+}
+
+bool KMFolder::isWritable() const
+{
+ return !mStorage->isReadOnly() && mStorage->canDeleteMessages();
+}
+
+bool KMFolder::canDeleteMessages() const
+{
+ return mStorage->canDeleteMessages();
+}
+
TQString KMFolder::label() const
{
if ( !mSystemLabel.isEmpty() )
@@ -877,5 +896,44 @@ void KMFolder::slotFolderSizeChanged()
}
}
+bool KMFolder::isValidName( const TQString &folderName, TQString &message )
+{
+ KMFolderType fldType = folderType();
+
+ // names of local folders must not contain a '/'
+ if ( folderName.find( '/' ) != -1 &&
+ fldType != KMFolderTypeImap &&
+ fldType != KMFolderTypeCachedImap ) {
+ message = i18n( "Folder names cannot contain the / (slash) character; please choose another folder name." );
+ return false;
+ }
+
+ // folder names must not start with a '.'
+ if ( folderName.startsWith( "." ) ) {
+ message = i18n( "Folder names cannot start with a . (dot) character; please choose another folder name." );
+ return false;
+ }
+
+ // names of IMAP folders must not contain the folder delimiter
+ if ( fldType == KMFolderTypeImap || fldType == KMFolderTypeCachedImap ) {
+ TQString delimiter;
+ if ( fldType == KMFolderTypeImap ) {
+ KMAcctImap *ai = static_cast<KMFolderImap*>( mStorage )->account();
+ if ( ai ) {
+ delimiter = ai->delimiterForFolder( mStorage );
+ }
+ } else {
+ KMAcctCachedImap *ai = static_cast<KMFolderCachedImap*>( mStorage )->account();
+ if ( ai ) {
+ delimiter = ai->delimiterForFolder( mStorage );
+ }
+ }
+ if ( !delimiter.isEmpty() && folderName.find( delimiter ) != -1 ) {
+ message = i18n( "Your IMAP server does not allow the character '%1'; please choose another folder name." ).arg( delimiter );
+ return false;
+ }
+ }
+ return true;
+}
#include "kmfolder.moc"