From: <svn...@op...> - 2010-10-16 17:12:06
|
Author: Graham Cobb Date: Sat Oct 16 19:11:56 2010 New Revision: 6147 URL: http://www.opensync.org/changeset/6147 Log: GPE plugin updated to latest API Modified: plugins/gpe/CMakeLists.txt plugins/gpe/ChangeLog plugins/gpe/gpe-sync-basic.xml plugins/gpe/gpe-sync-old.xml plugins/gpe/src/calendar.c plugins/gpe/src/contacts.c plugins/gpe/src/gpe_sync.c plugins/gpe/src/todo.c plugins/gpe/src/utils.c Modified: plugins/gpe/CMakeLists.txt ============================================================================== --- plugins/gpe/CMakeLists.txt Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/CMakeLists.txt Sat Oct 16 19:11:56 2010 (r6147) @@ -16,9 +16,9 @@ ADD_SUBDIRECTORY( src ) OPENSYNC_PACKAGE( ${PROJECT_NAME} ${VERSION} ) -OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-base-description.xml ) -OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.0.0-description.xml ) -OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.1.1-description.xml ) -OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.2.2-description.xml ) -OPENSYNC_PLUGIN_CAPABILITIES( gpe-sync-basic.xml ) -OPENSYNC_PLUGIN_CAPABILITIES( gpe-sync-old.xml ) +#OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-base-description.xml ) +#OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.0.0-description.xml ) +#OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.1.1-description.xml ) +#OPENSYNC_PLUGIN_DESCRIPTIONS( gpe-sync-1.2.2-description.xml ) +#OPENSYNC_PLUGIN_CAPABILITIES( gpe-sync-basic.xml ) +#OPENSYNC_PLUGIN_CAPABILITIES( gpe-sync-old.xml ) Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/ChangeLog Sat Oct 16 19:11:56 2010 (r6147) @@ -1,3 +1,22 @@ +2010-10-16 Graham Cobb <g+...@co...> + + * CMakeLists.txt: Disable capabilities for now + + * gpe-sync-basic.xml: Add copyright notice. + + * gpe-sync-old.xml: Add copyright notice. + + * src/utils.c: Fix compiler warnings + + * src/todo.c: Fix compiler warnings + + * src/contacts.c: Fix compiler warnings + + * src/calendar.c: Fix compiler warnings + + * src/gpe_sync.c: Fix compiler warnings + (get_sync_info): Add error argument to osync_plugin_env_register_plugin + 2009-05-14 Graham Cobb <g+...@co...> * src/utils.c: Add hashtable assertions Modified: plugins/gpe/gpe-sync-basic.xml ============================================================================== --- plugins/gpe/gpe-sync-basic.xml Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/gpe-sync-basic.xml Sat Oct 16 19:11:56 2010 (r6147) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + * gpe-sync - A plugin for the opensync framework + * Copyright (C) 2010 Graham R. Cobb <g+o...@co...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * --> +<!-- + * This file is the capabilities file for the GPE-SYNC plugin itself. + * These capabilities were added in gpesyncd protocol version 1.3.3. +--> <capabilities> <contact> <AddressLabel/> Modified: plugins/gpe/gpe-sync-old.xml ============================================================================== --- plugins/gpe/gpe-sync-old.xml Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/gpe-sync-old.xml Sat Oct 16 19:11:56 2010 (r6147) @@ -1,4 +1,26 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<!-- + * gpe-sync - A plugin for the opensync framework + * Copyright (C) 2010 Graham R. Cobb <g+o...@co...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * --> +<!-- + * This file is the capabilities file for gpesyncd protocol + * versions 1.0.0, 1.1.1 and 1.2.2. +--> <capabilities> <contact> <AddressLabel/> Modified: plugins/gpe/src/calendar.c ============================================================================== --- plugins/gpe/src/calendar.c Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/src/calendar.c Sat Oct 16 19:11:56 2010 (r6147) @@ -188,7 +188,7 @@ if (parse_value_modified ((gchar *)iter->data, &uid, &modified) == FALSE) { - osync_context_report_error (ctx, OSYNC_ERROR_CONVERT, "Wrong uidlist item: %s"); + osync_context_report_error (ctx, OSYNC_ERROR_CONVERT, "Wrong uidlist item: %s", uid); g_slist_free (uid_list); osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: Wrong uidlist item: %s", __func__, uid); return; @@ -253,7 +253,4 @@ exit: osync_trace(TRACE_EXIT, "GPE-SYNC %s: TRUE", __func__); return TRUE; - error: - osync_trace(TRACE_EXIT, "GPE-SYNC %s: FALSE", __func__); - return FALSE; } Modified: plugins/gpe/src/contacts.c ============================================================================== --- plugins/gpe/src/contacts.c Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/src/contacts.c Sat Oct 16 19:11:56 2010 (r6147) @@ -250,7 +250,4 @@ exit: osync_trace(TRACE_EXIT, "GPE-SYNC %s: TRUE", __func__); return TRUE; - error: - osync_trace(TRACE_EXIT, "GPE-SYNC %s: FALSE", __func__); - return FALSE; } Modified: plugins/gpe/src/gpe_sync.c ============================================================================== --- plugins/gpe/src/gpe_sync.c Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/src/gpe_sync.c Sat Oct 16 19:11:56 2010 (r6147) @@ -149,7 +149,7 @@ if (resource) { // Is calendar name specified? env->calendar = osync_plugin_resource_get_path(resource); - if (env->calendar) osync_trace(TRACE_INTERNAL, "GPE-SYNC %s: calendar = %d", __func__, env->calendar); + if (env->calendar) osync_trace(TRACE_INTERNAL, "GPE-SYNC %s: calendar = %s", __func__, env->calendar); } env->configured = TRUE; @@ -426,8 +426,6 @@ */ static void sync_done(OSyncObjTypeSink *sink, OSyncPluginInfo *info, OSyncContext *ctx, void *data) { - OSyncError *error = NULL; - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p, %p)", __func__, sink, info, ctx, data); sink_environment *sinkenv = (sink_environment *)data; @@ -445,11 +443,6 @@ osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); return; - -error: - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: %s", __func__, osync_error_print(&error)); - osync_error_unref(&error); } static void free_sink(sink_environment *sinkenv) @@ -490,8 +483,6 @@ */ static void *initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) { - const char *configdata = NULL; - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, plugin, info, error); gpe_environment *env = osync_try_malloc0(sizeof(gpe_environment), error); @@ -556,7 +547,8 @@ osync_plugin_set_finalize(plugin, finalize); osync_plugin_set_discover(plugin, discover); - osync_plugin_env_register_plugin(env, plugin); + if (!osync_plugin_env_register_plugin(env, plugin, error)) + goto error; osync_plugin_unref(plugin); //If you like, you can overwrite the default timeouts of your plugin @@ -569,7 +561,6 @@ return TRUE; error: osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: Unable to register: %s", __func__, osync_error_print(error)); - osync_error_unref(error); return FALSE; } Modified: plugins/gpe/src/todo.c ============================================================================== --- plugins/gpe/src/todo.c Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/src/todo.c Sat Oct 16 19:11:56 2010 (r6147) @@ -187,7 +187,7 @@ if (parse_value_modified ((gchar *)iter->data, &uid, &modified) == FALSE) { - osync_context_report_error (ctx, OSYNC_ERROR_CONVERT, "Wrong uidlist item: %s"); + osync_context_report_error (ctx, OSYNC_ERROR_CONVERT, "Wrong uidlist item: %s", uid); g_slist_free (uid_list); osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: Wrong uidlist item: %s", __func__, uid); return; @@ -250,7 +250,4 @@ exit: osync_trace(TRACE_EXIT, "GPE-SYNC %s: TRUE", __func__); return TRUE; - error: - osync_trace(TRACE_EXIT, "GPE-SYNC %s: FALSE", __func__); - return FALSE; } Modified: plugins/gpe/src/utils.c ============================================================================== --- plugins/gpe/src/utils.c Fri Oct 15 16:44:04 2010 (r6146) +++ plugins/gpe/src/utils.c Sat Oct 16 19:11:56 2010 (r6147) @@ -1,7 +1,7 @@ /* * gpe-sync - A plugin for the opensync framework * Copyright (C) 2005 Martin Felis <ma...@si...> - * Copyright (C) 2007 Graham R. Cobb <g+o...@co...> + * Copyright (C) 2007, 2010 Graham R. Cobb <g+o...@co...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -143,7 +143,6 @@ gpe_assert(hashtable); //check for deleted entries ... via hashtable - int i; OSyncList *u, *uids = osync_hashtable_get_deleted(hashtable); for (u = uids; u; u = u->next) { OSyncChange *change = osync_change_new(&error); |