[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/kdepim/enterprise/kdepim/kresources/kolab/kcal
From: Allen Winter <winter () kde ! org>
Date: 2010-06-08 14:43:03
Message-ID: 20100608144303.478A8AC8CE () svn ! kde ! org
[Download RAW message or body]
SVN commit 1135971 by winterz:
backport several fixes found in KDE4 that seem to help, especially
with reducing the number of conflicts in to-do heirarchy changes.
specifically,
SVN commit 788074 by vkrause:
Open the temporary file before writing data into it.
This fixes calendar inline attachments. [ie. make sure the open works]
SVN commit 788080 by vkrause:
Skip link attachments here, so we don't create empty message attachments
for them. This also fixes mixed link/inline attachments in the same
incidence.
SVN commit 841234 by mlaurent:
Fix mem leak [KTempFiles]
SVN commit 858839 by vkrause:
Unregister the observer for all incidences we want to delete first,
otherwise the first deletion will trigger a change notfication for
related incidences (eg. in case of todo hierarchies), which has a whole
bunch of nasty side-effects (folder sync on subresource unload,
duplicate entries, crashs, you name it).
SVN commit 923022 by krake:
Emitting the resourceLoaded() signal when loading succeeded as required by
API contract. Not sure if error is handled somewhere internally, otherwise
the loadError() method should be called as well
MERGE: none
M +30 -4 resourcekolab.cpp
--- branches/kdepim/enterprise/kdepim/kresources/kolab/kcal/resourcekolab.cpp #1135970:1135971
@@ -216,13 +216,22 @@
bool ResourceKolab::doLoad()
{
if (!mUidMap.isEmpty() ) {
+ emit resourceLoaded( this );
return true;
}
mUidMap.clear();
- return loadAllEvents() & loadAllTodos() & loadAllJournals();
+ bool result = loadAllEvents() & loadAllTodos() & loadAllJournals();
+ if ( result ) {
+ emit resourceLoaded( this );
+ } else {
+ // FIXME: anyone know if the resource correctly calls loadError()
+ // if it has one?
}
+ return result;
+}
+
bool ResourceKolab::doLoadAll( ResourceMap& map, const char* mimetype )
{
bool rc = true;
@@ -305,7 +314,8 @@
/* We are currently processing this event ( removing and readding or
* adding it ). If so, ignore this update. Keep the last of these around
* and process once we hear back from KMail on this event. */
- mPendingUpdates.replace( uid, incidencebase );
+ mPendingUpdates.remove( uid );
+ mPendingUpdates.insert( uid, incidencebase );
return;
}
@@ -456,16 +466,24 @@
QStringList attURLs, attMimeTypes, attNames;
QValueList<KTempFile*> tmpFiles;
for ( KCal::Attachment::List::ConstIterator it = atts.constBegin(); it != atts.constEnd(); ++it ) {
+ if ( (*it)->isUri() ) {
+ continue;
+ }
KTempFile* tempFile = new KTempFile;
+ if ( tempFile->status() == 0 ) { // open ok
QCString decoded = KCodecs::base64Decode( QCString( (*it)->data() ) );
tempFile->file()->writeBlock( decoded.data(), decoded.length() );
- tempFile->close();
KURL url;
url.setPath( tempFile->name() );
attURLs.append( url.url() );
attMimeTypes.append( (*it)->mimeType() );
attNames.append( (*it)->label() );
+ tempFile->close();
+ tmpFiles.append( tempFile );
+ } else {
+ kdWarning(5006) << "Cannot open temporary file for attachment";
}
+ }
QStringList deletedAtts;
if ( kmailListAttachments( deletedAtts, subresource, sernum ) ) {
for ( QStringList::ConstIterator it = attNames.constBegin(); it != attNames.constEnd(); ++it ) {
@@ -1187,6 +1205,7 @@
const bool silent = mSilent;
mSilent = true;
Kolab::UidMap::Iterator mapIt = mUidMap.begin();
+ QPtrList<KCal::Incidence> incidences;
while ( mapIt != mUidMap.end() )
{
Kolab::UidMap::Iterator it = mapIt++;
@@ -1195,11 +1214,18 @@
// FIXME incidence() is expensive
KCal::Incidence* incidence = mCalendar.incidence( it.key() );
if( incidence ) {
+ // register all observers first before actually deleting them
+ // in case of inter-incidence relations the other part will get
+ // the change notification otherwise
incidence->unRegisterObserver( this );
- mCalendar.deleteIncidence( incidence );
+ incidences.append( incidence );
}
mUidMap.remove( it );
}
+ QPtrListIterator<KCal::Incidence> it( incidences );
+ for ( ; it.current(); ++it ) {
+ mCalendar.deleteIncidence( it.current() );
+ }
mSilent = silent;
return true;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic