The rest of the KMail changes in the proko2 branch. This is everything the

new kolab resource needs, so I'll import that next. Unfortunately this
merge was somewhat invasive, so things might be slightly shaky still. I'll
debug that over the next few days, hopefully.

svn path=/trunk/kdepim/; revision=346785
wilder-work
Till Adam 22 years ago
parent b709925198
commit 2caf6488c1
  1. 50
      kmailicalIface.h
  2. 923
      kmailicalifaceimpl.cpp
  3. 56
      kmailicalifaceimpl.h

@ -72,6 +72,10 @@ k_dcop:
virtual bool isWritableFolder( const QString& type,
const QString& resource ) = 0;
virtual KURL getAttachment( const QString& resource,
Q_UINT32 sernum,
const QString& filename ) = 0;
// This saves the iCals/vCards in the entries in the folder.
// The format in the string list is uid, entry, uid, entry...
virtual bool update( const QString& type, const QString& folder,
@ -81,6 +85,26 @@ k_dcop:
virtual bool update( const QString& type, const QString& folder,
const QString& uid, const QString& entry ) = 0;
/// Update a kolab storage entry. Returns the new mail serial number,
/// or 0 if something went wrong
virtual Q_UINT32 update( const QString& resource,
Q_UINT32 sernum,
const QString& subject,
const QStringList& attachmentURLs,
const QStringList& attachmentMimetypes,
const QStringList& attachmentNames,
const QStringList& deletedAttachments ) = 0;
virtual bool deleteIncidenceKolab( const QString& resource,
Q_UINT32 sernum ) = 0;
virtual QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
const QString& resource ) = 0;
/**
* Return list of subresources. @p contentsType is
* Mail, Calendar, Contact, Note, Task or Journal
*/
virtual QValueList<KMailICalIface::SubResource> subresourcesKolab( const QString& contentsType ) = 0;
/// The format of the mails containing other contents than actual mail
/// (like contacts, calendar etc.)
/// This is currently either ical/vcard, or XML.
@ -92,15 +116,37 @@ k_dcop:
k_dcop_signals:
// For vcard/ical type storage (imap resource)
void incidenceAdded( const QString& type, const QString& folder,
const QString& entry );
void asyncLoadResult( const QStringList& list, const QString& type,
const QString& folder );
// For xml kolab style storage
void incidenceAdded( const QString& type, const QString& folder,
Q_UINT32 sernum, int format, const QString& entry );
void asyncLoadResult( const QMap<Q_UINT32, QString>, const QString& type,
const QString& folder );
//common
void incidenceDeleted( const QString& type, const QString& folder,
const QString& uid );
void signalRefresh( const QString& type, const QString& folder );
void subresourceAdded( const QString& type, const QString& resource );
void subresourceAdded( const QString& type, const QString& resource,
const QString& label );
void subresourceDeleted( const QString& type, const QString& resource );
void asyncLoadResult( const QStringList& list, const QString& type,
const QString& folder );
};
inline QDataStream& operator<<( QDataStream& str, const KMailICalIface::SubResource& subResource )
{
str << subResource.location << subResource.label << subResource.writable;
return str;
}
inline QDataStream& operator>>( QDataStream& str, KMailICalIface::SubResource& subResource )
{
str >> subResource.location >> subResource.label >> subResource.writable;
return str;
}
#endif

File diff suppressed because it is too large Load Diff

@ -50,12 +50,11 @@ class KMFolderTreeItem;
namespace {
// Local helper classes
// Local helper class
class ExtraFolder {
public:
ExtraFolder( KMFolder* f, KMail::FolderContentsType t ) : folder( f ), type( t ) {}
KMFolder* folder;
KMail::FolderContentsType type;
ExtraFolder( KMFolder* f ) : folder( f ) {}
QGuardedPtr<KMFolder> folder;
};
class Accumulator {
@ -101,6 +100,33 @@ public:
bool update( const QString& type, const QString& folder,
const QString& uid, const QString& entry );
/// Update a kolab storage entry.
/// If message is not there, it is added and
/// given the subject as Subject: header.
/// Returns the new mail serial number,
/// or 0 if something went wrong,
Q_UINT32 update( const QString& resource,
Q_UINT32 sernum,
const QString& subject,
const QStringList& attachmentURLs,
const QStringList& attachmentMimetypes,
const QStringList& attachmentNames,
const QStringList& deletedAttachments );
bool deleteIncidenceKolab( const QString& resource,
Q_UINT32 sernum );
QMap<Q_UINT32, QString> incidencesKolab( const QString& mimetype,
const QString& resource );
QValueList<SubResource> subresourcesKolab( const QString& contentsType );
// "Get" an attachment. This actually saves the attachment in a file
// and returns a URL to it
KURL getAttachment( const QString& resource,
Q_UINT32 sernum,
const QString& filename );
// tell KOrganizer about messages to be deleted
void msgRemoved( KMFolder*, KMMessage* );
@ -146,6 +172,8 @@ public:
/** Find message matching a given UID. */
KMMessage* findMessageByUID( const QString& uid, KMFolder* folder );
/** Find message matching a given serial number. */
static KMMessage* findMessageBySerNum( Q_UINT32 serNum, KMFolder* folder );
/** Convenience function to delete a message. */
static void deleteMsg( KMMessage* msg );
@ -181,10 +209,26 @@ private slots:
private:
/** Helper function for initFolders. Initializes a single folder. */
KMFolder* initFolder( KFolderTreeItem::Type itemType, const char* typeString );
KMFolder* initFolder( KFolderTreeItem::Type itemType, const char* typeString,
KMail::FolderContentsType contentsType );
KMFolder* extraFolder( const QString& type, const QString& folder );
KMFolder* findResourceFolder( const QString& resource );
bool updateAttachment( KMMessage& msg,
const QString& attachmentURL,
const QString& attachmentName,
const QString& attachmentMimetype,
bool lookupByName );
bool deleteAttachment( KMMessage& msg,
const QString& attachmentURL );
Q_UINT32 addIncidenceKolab( KMFolder& folder,
const QString& subject,
const QStringList& attachmentURLs,
const QStringList& attachmentNames,
const QStringList& attachmentMimetypes );
static bool kolabXMLFoundAndDecoded( const KMMessage& msg, const QString& mimetype, QString& s );
void loadPixmaps() const;
QGuardedPtr<KMFolder> mContacts;
@ -194,6 +238,7 @@ private:
QGuardedPtr<KMFolder> mJournals;
// The extra IMAP resource folders
// Key: folder location. Data: folder.
QDict<ExtraFolder> mExtraFolders;
// used for collecting incidences during async loading
QDict<Accumulator> mAccumulators;
@ -215,6 +260,7 @@ private:
static QPixmap *pixContacts, *pixCalendar, *pixNotes, *pixTasks;
bool mUseResourceIMAP;
bool mResourceQuiet;
bool mHideFolders;
/*

Loading…
Cancel
Save