Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
Meego:Tablet
buteo-sync-plugin-google
buteo-sync-plugins-0.5.6.57-add-photo-support.p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File buteo-sync-plugins-0.5.6.57-add-photo-support.patch of Package buteo-sync-plugin-google
From e8474daa391cd53616ed93bae0630fd8005899bf Mon Sep 17 00:00:00 2001 From: Qiankun Miao <qiankun.miao@intel.com> Date: Fri, 3 Dec 2010 02:55:58 +0800 Subject: [PATCH] contactbackend: add PHOTO support When doing sync, photo of a contact would be lost due to contactbackend doesn't handle PHOTO property. This patch fixes this bug (BMC#5879) PHOTO information of a contact is stored as a picture in "~/.cache/contacts/photo/". And the path of the picture can be get from QContactAvatar detail. Read content of the picture from this path, then write as QContactThumbnail detail, finally PHOTO property would appear in VCard format of the contact. --- storageplugins/hcontacts/ContactsBackend.cpp | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/storageplugins/hcontacts/ContactsBackend.cpp b/storageplugins/hcontacts/ContactsBackend.cpp index 5c43fc0..7fac2cc 100644 --- a/storageplugins/hcontacts/ContactsBackend.cpp +++ b/storageplugins/hcontacts/ContactsBackend.cpp @@ -44,6 +44,8 @@ #include <QContactOnlineAccount> #include <QBuffer> #include <QSet> +#include <QContactThumbnail> +#include <QContactAvatar> const QLatin1String ButeoSyncTarget("buteo"); @@ -422,8 +424,18 @@ QString ContactsBackend::convertQContactToVCard(const QContact &aContact) { FUNCTION_CALL_TRACE; + QContact tContact = aContact; + const QContactAvatar avatar = tContact.detail(QContactAvatar::DefinitionName); + const QContactThumbnail thumb = tContact.detail(QContactThumbnail::DefinitionName); + if (!avatar.isEmpty() && thumb.isEmpty()){ + QImage image(avatar.imageUrl().path()); + QContactThumbnail thumbnail; + thumbnail.setThumbnail(image); + tContact.saveDetail(&thumbnail); + } + QList<QContact> contactsList; - contactsList.append (aContact); + contactsList.append (tContact); QVersitContactExporter contactExporter; -- 1.7.2.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor