diff --git a/kmailicalifaceimpl.cpp b/kmailicalifaceimpl.cpp index cae8cb019..1d56873ce 100644 --- a/kmailicalifaceimpl.cpp +++ b/kmailicalifaceimpl.cpp @@ -582,7 +582,7 @@ QMap KMailICalIfaceImpl::subresourcesKolab( const QString& conten { QMap map; - kdDebug(5006) << k_funcinfo << endl; + kdDebug(5006) << k_funcinfo << contentsType << endl; // Add the default one KMFolder* f = folderFromType( contentsType, QString::null ); if ( f && storageFormat( f ) == StorageXML ) { @@ -1194,6 +1194,18 @@ KMailICalIfaceImpl::StorageFormat KMailICalIfaceImpl::storageFormat( KMFolder* f return StorageIcalVcard; } +void KMailICalIfaceImpl::setStorageFormat( KMFolder* folder, StorageFormat format ) +{ + FolderInfoMap::Iterator it = mFolderInfoMap.find( folder ); + if ( it != mFolderInfoMap.end() ) + (*it).mStorageFormat = format; + else { + FolderInfo info; + info.mStorageFormat = format; + mFolderInfoMap.insert( folder, info ); + } +} + KMFolder* KMailICalIfaceImpl::findResourceFolder( const QString& resource ) { // Try the standard folders diff --git a/kmailicalifaceimpl.h b/kmailicalifaceimpl.h index 74f870267..1993ecaca 100644 --- a/kmailicalifaceimpl.h +++ b/kmailicalifaceimpl.h @@ -163,6 +163,8 @@ public: /// @return the storage format of a given folder StorageFormat storageFormat( KMFolder* folder ) const; + /// Set the storage format of a given folder. Called when seeing the kolab annotation. + void setStorageFormat( KMFolder* folder, StorageFormat format ); public slots: /* (Re-)Read configuration file */ diff --git a/kmfoldercachedimap.cpp b/kmfoldercachedimap.cpp index 6b1c41bee..d89df17d2 100644 --- a/kmfoldercachedimap.cpp +++ b/kmfoldercachedimap.cpp @@ -1729,6 +1729,7 @@ void KMFolderCachedImap::slotGetAnnotationResult( KIO::Job* job ) for ( uint i = 0 ; i < sizeof s_contentsType2Annotation / sizeof *s_contentsType2Annotation; ++i ) { if ( type == s_contentsType2Annotation[i] ) { // Case 3: known content-type on server, get it + kmkernel->iCalIface().setStorageFormat( folder(), KMailICalIfaceImpl::StorageXML ); setContentsType( static_cast( i ) ); mContentsTypeChanged = false; // we changed it, not the user foundKnownType = true;