Warning: That file was not part of the compilation database. It may have many parsing errors.

1/*
2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
3
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.
8
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.
13
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
17 02110-1301, USA.
18*/
19
20#include "akonadisink.h"
21
22#include <akonadi/control.h>
23
24#include <KDebug>
25
26AkonadiSink::AkonadiSink() :
27 SinkBase( Connect )
28{
29}
30
31AkonadiSink::~AkonadiSink()
32{
33}
34
35bool AkonadiSink::initialize(OSyncPlugin * plugin, OSyncPluginInfo * info, OSyncError ** error)
36{
37 kDebug();
38 OSyncObjTypeSink *sink = osync_objtype_main_sink_new( error );
39 wrapSink( sink );
40 osync_plugin_info_set_main_sink( info, sink );
41 return true;
42}
43
44void AkonadiSink::connect()
45{
46 osync_trace( TRACE_ENTRY, "%s(%p, %p)", __PRETTY_FUNCTION__, pluginInfo(), context() );
47 kDebug();
48
49 if ( !Akonadi::Control::start() ) {
50 error( OSYNC_ERROR_NO_CONNECTION, "Could not start Akonadi." );
51 osync_trace( TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, "Could not start Akonadi." );
52 return;
53 }
54
55 success();
56 osync_trace( TRACE_EXIT, "%s", __PRETTY_FUNCTION__ );
57}
58
59

Warning: That file was not part of the compilation database. It may have many parsing errors.