2
Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
4
This library is free software; you can redistribute it and/or modify it
5
under the terms of the GNU Library General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or (at your
7
option) any later version.
9
This library is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12
License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to the
16
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20
#include "akonadi_serializer_contactgroup.h"
22
#include <QtCore/qplugin.h>
24
#include <kabc/contactgroup.h>
25
#include <kabc/contactgrouptool.h>
29
#include <akonadi/item.h>
30
#include <akonadi/kabc/contactparts.h>
32
using namespace Akonadi;
34
bool SerializerPluginContactGroup::deserialize( Item& item, const QByteArray& label, QIODevice& data, int version )
39
KABC::ContactGroup contactGroup;
41
if ( !KABC::ContactGroupTool::convertFromXml( &data, contactGroup ) ){
42
// TODO: error reporting
46
item.setPayload<KABC::ContactGroup>( contactGroup );
51
void SerializerPluginContactGroup::serialize( const Item& item, const QByteArray& label, QIODevice& data, int &version )
56
if ( !item.hasPayload<KABC::ContactGroup>() )
59
KABC::ContactGroupTool::convertToXml( item.payload<KABC::ContactGroup>(), &data );
62
Q_EXPORT_PLUGIN2( akonadi_serializer_contactgroup, Akonadi::SerializerPluginContactGroup )
64
#include "akonadi_serializer_contactgroup.moc"
65
// kate: space-indent on; indent-width 2; replace-tabs on;