[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise/kdepim
From: Volker Krause <vkrause () kde ! org>
Date: 2008-11-07 15:39:13
Message-ID: 1226072353.687013.22140.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 881255 by vkrause:
Detect if the server supports shared seen flags. Also preserve the IMAP
server capabilities in kmailrc so that detection also works without a
prior sync.
M +12 -0 kioslaves/imap4/imap4.cc
M +2 -0 kmail/imapaccountbase.cpp
M +5 -0 kmail/kmfolderdia.cpp
--- branches/kdepim/enterprise/kdepim/kioslaves/imap4/imap4.cc #881254:881255
@@ -2111,6 +2111,18 @@
removeCapability( "ANNOTATEMORE" );
}
+ // starting from Cyrus IMAP 2.3.9, shared seen flags are available
+ QRegExp regExp( "Cyrus\\sIMAP4\\sv(\\d+)\\.(\\d+)\\.(\\d+)", false );
+ if ( regExp.search( greeting ) >= 0 ) {
+ const int major = regExp.cap( 1 ).toInt();
+ const int minor = regExp.cap( 2 ).toInt();
+ const int patch = regExp.cap( 3 ).toInt();
+ if ( major > 2 || (major == 2 && (minor > 3 || (minor == 3 && patch > 9))) ) {
+ kdDebug(7116) << k_funcinfo << "Cyrus IMAP >= 2.3.9 detected, enabling \
shared seen flag support" << endl; + imapCapabilities.append( \
"x-kmail-sharedseen" ); + }
+ }
+
kdDebug(7116) << "IMAP4::makeLogin - attempting login" << endl;
KIO::AuthInfo authInfo;
--- branches/kdepim/enterprise/kdepim/kmail/imapaccountbase.cpp #881254:881255
@@ -198,6 +198,7 @@
setOnlyLocallySubscribedFolders( config.readBoolEntry( \
"locally-subscribed-folders", false ) ); setLoadOnDemand( config.readBoolEntry( \
"loadondemand", false ) );
setListOnlyOpenFolders( config.readBoolEntry( "listOnlyOpenFolders", false ) );
+ mCapabilities = config.readListEntry( "capabilities", QStringList() );
// read namespaces
nsMap map;
QStringList list = config.readListEntry( QString::number( PersonalNS ) );
@@ -237,6 +238,7 @@
config.writeEntry( "locally-subscribed-folders", onlyLocallySubscribedFolders() \
); config.writeEntry( "loadondemand", loadOnDemand() );
config.writeEntry( "listOnlyOpenFolders", listOnlyOpenFolders() );
+ config.writeEntry( "capabilities", mCapabilities );
QString data;
for ( nsMap::Iterator it = mNamespaces.begin(); it != mNamespaces.end(); ++it ) \
{ if ( !it.data().isEmpty() ) {
--- branches/kdepim/enterprise/kdepim/kmail/kmfolderdia.cpp #881254:881255
@@ -583,8 +583,13 @@
}
if ( mSharedSeenFlagsCheckBox ) {
KMFolderCachedImap *dimap = static_cast<KMFolderCachedImap*>( folder->storage() \
); + ImapAccountBase *account = dynamic_cast<ImapAccountBase*>( dimap->account() \
); mSharedSeenFlagsCheckBox->setChecked( dimap->sharedSeenFlags() );
mSharedSeenFlagsCheckBox->setDisabled( folder->isReadOnly() );
+ if ( account && account->hasCapability( "x-kmail-sharedseen" ) )
+ mSharedSeenFlagsCheckBox->show();
+ else
+ mSharedSeenFlagsCheckBox->hide();
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic