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/kmfolder.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'kmail/kmfolder.cpp') diff --git a/kmail/kmfolder.cpp b/kmail/kmfolder.cpp index cae87071..68fb52f0 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( mStorage )->account(); + if ( ai ) { + delimiter = ai->delimiterForFolder( mStorage ); + } + } else { + KMAcctCachedImap *ai = static_cast( 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" -- cgit v1.2.3