summaryrefslogtreecommitdiff
path: root/kolabformatV2
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-06-27 08:53:02 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-06-27 08:53:02 (GMT)
commitb99d69b8f85c5920989e1df1f0e40126779d0255 (patch)
tree876fde45f65552f281a9d19f2c47cc7fb84c969a /kolabformatV2
parent9b386b6506e427efc25646c5ed2b86813bbde9ab (diff)
downloadlibkolab-b99d69b8f85c5920989e1df1f0e40126779d0255.tar.gz
Compile with libcalendaring
Diffstat (limited to 'kolabformatV2')
-rw-r--r--kolabformatV2/contact.cpp24
-rw-r--r--kolabformatV2/distributionlist.cpp55
2 files changed, 40 insertions, 39 deletions
diff --git a/kolabformatV2/contact.cpp b/kolabformatV2/contact.cpp
index 21d6fec..7e0e951 100644
--- a/kolabformatV2/contact.cpp
+++ b/kolabformatV2/contact.cpp
@@ -1179,10 +1179,10 @@ QImage Contact::loadPictureFromAddressee( const KABC::Picture& picture )
QImage img;
if ( !picture.isIntern() && !picture.url().isEmpty() ) {
QString tmpFile;
- if ( KIO::NetAccess::download( picture.url(), tmpFile, 0 /*no widget known*/ ) ) {
- img.load( tmpFile );
- KIO::NetAccess::removeTempFile( tmpFile );
- }
+// if ( KIO::NetAccess::download( picture.url(), tmpFile, 0 /*no widget known*/ ) ) {
+// img.load( tmpFile );
+// KIO::NetAccess::removeTempFile( tmpFile );
+// }
} else
img = picture.data();
return img;
@@ -1193,14 +1193,14 @@ QByteArray KolabV2::Contact::loadSoundFromAddressee( const KABC::Sound& sound )
QByteArray data;
if ( !sound.isIntern() && !sound.url().isEmpty() ) {
QString tmpFile;
- if ( KIO::NetAccess::download( sound.url(), tmpFile, 0 /*no widget known*/ ) ) {
- QFile f( tmpFile );
- if ( f.open( QIODevice::ReadOnly ) ) {
- data = f.readAll();
- f.close();
- }
- KIO::NetAccess::removeTempFile( tmpFile );
- }
+// if ( KIO::NetAccess::download( sound.url(), tmpFile, 0 /*no widget known*/ ) ) {
+// QFile f( tmpFile );
+// if ( f.open( QIODevice::ReadOnly ) ) {
+// data = f.readAll();
+// f.close();
+// }
+// KIO::NetAccess::removeTempFile( tmpFile );
+// }
} else
data = sound.data();
return data;
diff --git a/kolabformatV2/distributionlist.cpp b/kolabformatV2/distributionlist.cpp
index f011458..61605c6 100644
--- a/kolabformatV2/distributionlist.cpp
+++ b/kolabformatV2/distributionlist.cpp
@@ -31,8 +31,8 @@
#include "distributionlist.h"
-#include <akonadi/itemfetchjob.h>
-#include <akonadi/itemfetchscope.h>
+// #include <akonadi/itemfetchjob.h>
+// #include <akonadi/itemfetchscope.h>
#include <kabc/addressee.h>
#include <kabc/contactgroup.h>
#include <kdebug.h>
@@ -198,31 +198,32 @@ void DistributionList::setFields( const KABC::ContactGroup* contactGroup )
// Hopefully all resources are available during saving, so we can look up
// in the addressbook to get name+email from the UID.
// TODO proxy should at least know the addressees it created
- for ( uint index = 0; index < contactGroup->contactReferenceCount(); ++index ) {
- const KABC::ContactGroup::ContactReference& reference = contactGroup->contactReference( index );
-
- const Akonadi::Item item( reference.uid().toLongLong() );
- Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( item );
- job->fetchScope().fetchFullPayload();
- if ( !job->exec() )
- continue;
-
- const Akonadi::Item::List items = job->items();
- if ( items.count() != 1 )
- continue;
-
- const KABC::Addressee addressee = job->items().first().payload<KABC::Addressee>();
-
- if ( !addressee.isEmpty() ) {
- Member m;
- m.displayName = addressee.formattedName();
- m.email = reference.preferredEmail();
- if ( m.email.isEmpty() )
- m.email = addressee.preferredEmail();
-
- mDistrListMembers.append( m );
- }
- }
+// for ( uint index = 0; index < contactGroup->contactReferenceCount(); ++index ) {
+// const KABC::ContactGroup::ContactReference& reference = contactGroup->contactReference( index );
+//
+// //FIXME this won't work on the server (wihtout akonadi), move this part to the akonadi resource
+// const Akonadi::Item item( reference.uid().toLongLong() );
+// Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( item );
+// job->fetchScope().fetchFullPayload();
+// if ( !job->exec() )
+// continue;
+//
+// const Akonadi::Item::List items = job->items();
+// if ( items.count() != 1 )
+// continue;
+//
+// const KABC::Addressee addressee = job->items().first().payload<KABC::Addressee>();
+//
+// if ( !addressee.isEmpty() ) {
+// Member m;
+// m.displayName = addressee.formattedName();
+// m.email = reference.preferredEmail();
+// if ( m.email.isEmpty() )
+// m.email = addressee.preferredEmail();
+//
+// mDistrListMembers.append( m );
+// }
+// }
}
// The loading is: xml -> DistributionList -> contactgroup, this is the second part