2
* This file is part of buteo-sync-plugins-contacts package
4
* Copyright (C) 2013 Jolla Ltd. and/or its subsidiary(-ies).
7
* Contributors: Sateesh Kavuri <sateesh.kavuri@gmail.com>
8
* Mani Chandrasekar <maninc@gmail.com>
9
* Renato Araujo Oliveira Filho <renato.filho@canonical.com>
11
* This library is free software; you can redistribute it and/or
12
* modify it under the terms of the GNU Lesser General Public License
13
* version 2.1 as published by the Free Software Foundation.
15
* This library is distributed in the hope that it will be useful, but
16
* WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
* Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public
21
* License along with this library; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27
#include "UContactsCustomDetail.h"
30
const QString UContactsCustomDetail::FieldContactETag = "X-GOOGLE-ETAG";
31
const QString UContactsCustomDetail::FieldGroupMembershipInfo = "X-GROUP-ID";
32
const QString UContactsCustomDetail::FieldRemoteId = "X-REMOTE-ID";
33
const QString UContactsCustomDetail::FieldDeletedAt = "X-DELETED-AT";
34
const QString UContactsCustomDetail::FieldCreatedAt = "X-CREATED-AT";
35
const QString UContactsCustomDetail::FieldContactAvatarETag = "X-AVATAR-REV";
37
QContactExtendedDetail
38
UContactsCustomDetail::getCustomField(const QContact &contact, const QString &name)
40
foreach (QContactExtendedDetail xd, contact.details<QContactExtendedDetail>()) {
41
if (xd.name() == name) {
45
QContactExtendedDetail xd;
51
void UContactsCustomDetail::setCustomField(QtContacts::QContact &contact, const QString &name, const QVariant &value)
53
QContactExtendedDetail xd = getCustomField(contact, name);
55
contact.saveDetail(&xd);