From: <svn...@op...> - 2010-09-20 23:13:06
|
Author: deloptes Date: Tue Sep 21 01:12:57 2010 New Revision: 6134 URL: http://www.opensync.org/changeset/6134 Log: - connect working for akonadi mainSink Modified: plugins/akonadi-sync/trunk/src/akonadi_opensync.cpp plugins/akonadi-sync/trunk/src/akonadisink.cpp plugins/akonadi-sync/trunk/src/akonadisink.h plugins/akonadi-sync/trunk/src/datasink.cpp Modified: plugins/akonadi-sync/trunk/src/akonadi_opensync.cpp ============================================================================== --- plugins/akonadi-sync/trunk/src/akonadi_opensync.cpp Mon Sep 20 03:08:16 2010 (r6133) +++ plugins/akonadi-sync/trunk/src/akonadi_opensync.cpp Tue Sep 21 01:12:57 2010 (r6134) @@ -92,7 +92,7 @@ ds = new DataSink( DataSink::Notes ); else continue; - + kDebug() << "Info:"<< osync_plugin_info_get_groupname(info); if ( !ds->initialize( plugin, info, sink, error ) ) { delete ds; delete mainSink; Modified: plugins/akonadi-sync/trunk/src/akonadisink.cpp ============================================================================== --- plugins/akonadi-sync/trunk/src/akonadisink.cpp Mon Sep 20 03:08:16 2010 (r6133) +++ plugins/akonadi-sync/trunk/src/akonadisink.cpp Tue Sep 21 01:12:57 2010 (r6134) @@ -36,8 +36,14 @@ { kDebug(); OSyncObjTypeSink *sink = osync_objtype_main_sink_new( error ); + if (!sink) { + + kDebug() << "No sink "; + return false; + } +// wrapSink( sink ); osync_plugin_info_set_main_sink( info, sink ); - wrapSink( sink ); +// osync_objtype_sink_unref(sink); return true; } @@ -51,9 +57,10 @@ osync_trace(TRACE_EXIT_ERROR, "%s: %s", __PRETTY_FUNCTION__, "Could not start Akonadi."); return; } - + connect(); success(); osync_trace(TRACE_EXIT, "%s", __PRETTY_FUNCTION__); } + #include "akonadisink.moc" Modified: plugins/akonadi-sync/trunk/src/akonadisink.h ============================================================================== --- plugins/akonadi-sync/trunk/src/akonadisink.h Mon Sep 20 03:08:16 2010 (r6133) +++ plugins/akonadi-sync/trunk/src/akonadisink.h Tue Sep 21 01:12:57 2010 (r6134) @@ -36,6 +36,7 @@ bool initialize( OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error ); void connect(); + }; #endif Modified: plugins/akonadi-sync/trunk/src/datasink.cpp ============================================================================== --- plugins/akonadi-sync/trunk/src/datasink.cpp Mon Sep 20 03:08:16 2010 (r6133) +++ plugins/akonadi-sync/trunk/src/datasink.cpp Tue Sep 21 01:12:57 2010 (r6134) @@ -59,10 +59,10 @@ kDebug() << "Create obj:" << type; m_type = type; - m_hasEvent = true ? ( type = DataSink::Calendars ) : false; - m_hasContact = true ? ( type = DataSink::Contacts ) : false; - m_hasNote = true ? ( type = DataSink::Notes ) : false; - m_hasTodo = true ? ( type = DataSink::Todos ) : false; + m_hasEvent = ( type == DataSink::Calendars ) ? true : false; + m_hasContact = ( type == DataSink::Contacts ) ? true : false; + m_hasNote = ( type == DataSink::Notes ) ? true : false; + m_hasTodo = ( type == DataSink::Todos ) ? true : false; } @@ -72,8 +72,11 @@ bool DataSink::initialize(OSyncPlugin * plugin, OSyncPluginInfo * info, OSyncObjTypeSink *sink, OSyncError ** error) { +// Q_UNUSED( plugin ); +// Q_ASSERT( info ); +// Q_ASSERT( sink ); kDebug() << "initializing" << osync_objtype_sink_get_name(sink); - Q_UNUSED(plugin); +// Q_UNUSED(plugin); bool enabled = osync_objtype_sink_is_enabled( sink ); if ( ! enabled ) { kDebug() << "sink is not enabled.."; @@ -89,15 +92,15 @@ wrapSink( sink ); -kDebug() << "Sink wrapped" << osync_objtype_sink_get_name(sink); +kDebug() << "Sink wrapped: " << osync_objtype_sink_get_name(sink); // osync_objtype_sink_set_userdata(sink, env); - osync_objtype_sink_enable_hashtable(sink, TRUE); +/* osync_objtype_sink_enable_hashtable(sink, TRUE); m_hashtable = osync_objtype_sink_get_hashtable(sink); if ( ! m_hashtable ) { kDebug() << "No hashtable for sync"; // return false; - } + } */ return true; } |