Changeset 112
- Timestamp:
- 01/10/05 19:12:55 (4 years ago)
- Files:
-
- trunk/engine/osengine_engine.c (modified) (2 diffs)
- trunk/plugins/evolution2_sync/src/Makefile.am (modified) (2 diffs)
- trunk/plugins/evolution2_sync/src/evo2-sync (modified) (1 diff)
- trunk/plugins/evolution2_sync/src/evo2_sync.h (added)
- trunk/plugins/evolution2_sync/src/evolution_sync.c (modified) (1 diff)
- trunk/plugins/evolution2_sync/src/evolution_sync.h (modified) (1 diff)
- trunk/src/opensync_env.c (modified) (1 diff)
- trunk/src/opensync_member.c (modified) (4 diffs)
- trunk/src/opensync_member.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/engine/osengine_engine.c
r109 r112 595 595 void osync_engine_finalize(OSyncEngine *engine) 596 596 { 597 g_assert(engine); 597 598 _osync_debug(engine, "ENG", 3, "finalizing engine %p", engine); 598 599 g_main_loop_quit(engine->syncloop); … … 618 619 osync_bool osync_engine_synchronize(OSyncEngine *engine, OSyncError **error) 619 620 { 621 g_assert(engine); 620 622 osync_flag_set(engine->fl_running); 621 623 return TRUE; trunk/plugins/evolution2_sync/src/Makefile.am
r33 r112 1 1 plugindir=@OPENSYNC_PLUGINDIR@/plugins 2 2 configdir=@OPENSYNC_CONFIGDIR@/defaults 3 3 headerdir=$(includedir)/opensync/ 4 4 INCLUDES = @PACKAGE_CFLAGS@ 5 5 … … 8 8 #FIXME: the 'evo2-sync' file is missing from subversion 9 9 config_DATA = evo2-sync 10 11 header_HEADERS = \ 12 evo2_sync.h 10 13 11 14 plugin_LTLIBRARIES = evo2_sync.la trunk/plugins/evolution2_sync/src/evo2-sync
r34 r112 1 <config><adress_path></adress_path><calenda t_path></calendar_path><tasks_path></tasks_path></config>1 <config><adress_path></adress_path><calendar_path></calendar_path><tasks_path></tasks_path></config> trunk/plugins/evolution2_sync/src/evolution_sync.c
r111 r112 17 17 for (s = e_source_group_peek_sources (group); s; s = s->next) { 18 18 source = E_SOURCE (s->data); 19 char *path = g_strdup_printf("%s:%s", e_source_get_uri(source), e_source_peek_name(source)); 19 evo2_location *path = g_malloc0(sizeof(evo2_location)); 20 path->uri = g_strdup(e_source_get_uri(source)); 21 path->name = g_strdup(e_source_peek_name(source)); 22 paths = g_list_append(paths, path); 23 } 24 } 25 return paths; 26 } 27 28 GList *evo2_list_tasks(evo_environment *env, void *data) 29 { 30 GList *paths = NULL; 31 ESourceList *sources = NULL; 32 ESource *source = NULL; 33 34 if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_TODO, NULL)) { 35 return NULL; 36 } 37 38 GSList *g = NULL; 39 for (g = e_source_list_peek_groups (sources); g; g = g->next) { 40 ESourceGroup *group = E_SOURCE_GROUP (g->data); 41 GSList *s = NULL; 42 for (s = e_source_group_peek_sources (group); s; s = s->next) { 43 source = E_SOURCE (s->data); 44 evo2_location *path = g_malloc0(sizeof(evo2_location)); 45 path->uri = g_strdup(e_source_get_uri(source)); 46 path->name = g_strdup(e_source_peek_name(source)); 47 paths = g_list_append(paths, path); 48 } 49 } 50 return paths; 51 } 52 53 GList *evo2_list_addressbooks(evo_environment *env, void *data) 54 { 55 GList *paths = NULL; 56 ESourceList *sources = NULL; 57 ESource *source = NULL; 58 59 if (!e_book_get_addressbooks(&sources, NULL)) { 60 return NULL; 61 } 62 63 GSList *g = NULL; 64 for (g = e_source_list_peek_groups (sources); g; g = g->next) { 65 ESourceGroup *group = E_SOURCE_GROUP (g->data); 66 GSList *s = NULL; 67 for (s = e_source_group_peek_sources (group); s; s = s->next) { 68 source = E_SOURCE (s->data); 69 evo2_location *path = g_malloc0(sizeof(evo2_location)); 70 path->uri = g_strdup(e_source_get_uri(source)); 71 path->name = g_strdup(e_source_peek_name(source)); 20 72 paths = g_list_append(paths, path); 21 73 } trunk/plugins/evolution2_sync/src/evolution_sync.h
r60 r112 1 1 #ifndef EVO2_SYNC_H 2 2 #define EVO2_SYNC_H 3 4 #include "evo2_sync.h" 3 5 4 6 #include <opensync/opensync.h> trunk/src/opensync_env.c
r109 r112 520 520 osync_bool ret = FALSE; 521 521 GError *error = NULL; 522 523 if (!filename) { 524 osync_debug("OSYNC", 3, "No file open specified"); 525 osync_error_set(oserror, OSYNC_ERROR_IO_ERROR, "No file to open specified"); 526 return FALSE; 527 } 522 528 GIOChannel *chan = g_io_channel_new_file(filename, "r", &error); 523 529 if (!chan) { trunk/src/opensync_member.c
r109 r112 87 87 } 88 88 89 void osync_member_unload_plugin(OSyncMember *member) 90 { 91 g_assert(member); 92 if (!member->plugin) 93 return; 94 95 if (!member->plugin->info.is_threadsafe) { 96 osync_plugin_unload(member->plugin); 97 osync_plugin_free(member->plugin); 98 } 99 100 g_list_free(member->objtype_sinks); 101 g_list_free(member->format_sinks); 102 //Really free the formats! 103 104 member->objtype_sinks = NULL; 105 member->format_sinks = NULL; 106 member->plugin = NULL; 107 } 108 89 109 osync_bool osync_member_instance_plugin(OSyncMember *member, OSyncPlugin *plugin, OSyncError **error) 90 110 { … … 92 112 g_assert(plugin); 93 113 osync_debug("OSMEM", 3, "Instancing plugin %s for member %i", plugin->info.name, member->id); 114 osync_member_unload_plugin(member); 115 94 116 if (plugin->info.is_threadsafe) { 95 117 member->plugin = plugin; … … 126 148 } 127 149 150 OSyncPlugin *osync_member_get_plugin(OSyncMember *member) 151 { 152 g_assert(member); 153 return member->plugin; 154 } 155 128 156 const char *osync_member_get_pluginname(OSyncMember *member) 129 157 { … … 145 173 if (!osync_member_read_config(member, data, size, error)) { 146 174 char *filename = g_strdup_printf(OPENSYNC_CONFIGDIR"/defaults/%s", osync_plugin_get_name(member->plugin)); 147 osync_debug("OSMEM", 3, "Reading default config file for member %i", member->id);175 osync_debug("OSMEM", 3, "Reading default2 config file for member %lli from %s", member->id, filename); 148 176 ret = osync_file_read(filename, data, size, error); 149 177 g_free(filename); trunk/src/opensync_member.h
r109 r112 3 3 4 4 osync_bool osync_member_instance_plugin(OSyncMember *member, OSyncPlugin *plugin, OSyncError **error); 5 osync_bool osync_member_set_name(OSyncMember *member, char *name);6 const char *osync_member_get_name(OSyncMember *member); 5 OSyncPlugin *osync_member_get_plugin(OSyncMember *member); 6 7 7 const char *osync_member_get_configdir(OSyncMember *member); 8 8 osync_bool osync_member_get_config(OSyncMember *member, char **data, int *size, OSyncError **error);
