2 Copyright (c) 2008 Volker Krause <vkrause@kde.org>
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 "akonadisink.h"
22 #include <akonadi/control.h>
26 AkonadiSink::AkonadiSink() :
31 AkonadiSink::~AkonadiSink()
35 bool AkonadiSink::initialize(OSyncPlugin
* plugin
, OSyncPluginInfo
* info
, OSyncError
** error
)
39 OSyncObjTypeSink
*sink
= osync_objtype_main_sink_new( error
);
41 // osync_objtype_sink_set_userdata ( sink, this );
42 osync_plugin_info_set_main_sink( info
, sink
);
43 osync_objtype_sink_unref(sink
);
47 void AkonadiSink::connect()
49 osync_trace(TRACE_ENTRY
, "%s(%p, %p)", __PRETTY_FUNCTION__
, pluginInfo(), context());
52 if ( !Akonadi::Control::start() ) {
53 kDebug() << "Could not start Akonadi." ;
54 error( OSYNC_ERROR_NO_CONNECTION
, "Could not start Akonadi." );
55 osync_trace(TRACE_EXIT_ERROR
, "%s: %s", __PRETTY_FUNCTION__
, "Could not start Akonadi.");
60 osync_trace(TRACE_EXIT
, "%s", __PRETTY_FUNCTION__
);
63 #include "akonadisink.moc"