diff options
author | Not Zed <NotZed@Ximian.com> | 2003-04-08 01:06:37 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-04-08 01:06:37 +0800 |
commit | ca1f07cab33bbe9a9bb6cd03399191782b0dc950 (patch) | |
tree | 495da296ff7a4742aa145ebf8cfad6cd060ffd8a /calendar/conduits/todo/todo-conduit.c | |
parent | 4d87126636de746a8a4a03618a4557106069c910 (diff) | |
download | gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar.gz gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar.bz2 gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar.lz gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar.xz gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.tar.zst gsoc2013-evolution-ca1f07cab33bbe9a9bb6cd03399191782b0dc950.zip |
Fixes #40252
2003-04-07 Not Zed <NotZed@Ximian.com>
Fixes #40252
* conduits/todo/todo-conduit.c: Same as below.
* conduits/calendar/calendar-conduit.c: Change the LOG macro to a
single arg macro which copies its arg. Fix all callers. Change
WARN and INFO to simply g_warning/g_message. Init G_LOG_DOMAIN
before including anything.
svn path=/trunk/; revision=20714
Diffstat (limited to 'calendar/conduits/todo/todo-conduit.c')
-rw-r--r-- | calendar/conduits/todo/todo-conduit.c | 92 |
1 files changed, 45 insertions, 47 deletions
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index a07ed35706..a27beffb9d 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -23,6 +23,8 @@ #include <config.h> +#define G_LOG_DOMAIN "etodoconduit" + #include <cal-client/cal-client-types.h> #include <cal-client/cal-client.h> #include <cal-util/timeutil.h> @@ -44,22 +46,18 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define CONDUIT_VERSION "0.1.4" -#ifdef G_LOG_DOMAIN -#undef G_LOG_DOMAIN -#endif -#define G_LOG_DOMAIN "etodoconduit" #define DEBUG_TODOCONDUIT 1 /* #undef DEBUG_TODOCONDUIT */ #ifdef DEBUG_TODOCONDUIT -#define LOG(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, e) +#define LOG(x) x #else -#define LOG(e...) +#define LOG(x) #endif -#define WARN(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, e) -#define INFO(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, e) +#define WARN g_warning +#define INFO g_message typedef struct _EToDoLocalRecord EToDoLocalRecord; typedef struct _EToDoConduitCfg EToDoConduitCfg; @@ -549,7 +547,7 @@ local_record_to_pilot_record (EToDoLocalRecord *local, g_assert (local->comp != NULL); g_assert (local->todo != NULL ); - LOG ("local_record_to_pilot_record\n"); + LOG (g_message ( "local_record_to_pilot_record\n" )); p.ID = local->local.ID; p.category = local->local.category; @@ -580,7 +578,7 @@ local_record_from_comp (EToDoLocalRecord *local, CalComponent *comp, EToDoCondui CalComponentClassification classif; icaltimezone *default_tz = get_default_timezone (); - LOG ("local_record_from_comp\n"); + LOG (g_message ( "local_record_from_comp\n" )); g_return_if_fail (local != NULL); g_return_if_fail (comp != NULL); @@ -846,7 +844,7 @@ check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt) /* Or if the URI's don't match */ uri = cal_client_get_uri (ctxt->client); - LOG(" Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>"); + LOG (g_message ( " Current URI %s (%s)\n", uri, ctxt->cfg->last_uri ? ctxt->cfg->last_uri : "<NONE>" )); if (ctxt->cfg->last_uri != NULL && strcmp (ctxt->cfg->last_uri, uri)) { gnome_pilot_conduit_standard_set_slow (conduit, TRUE); e_pilot_map_clear (ctxt->map); @@ -854,9 +852,9 @@ check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt) if (gnome_pilot_conduit_standard_get_slow (conduit)) { ctxt->map->write_touched_only = TRUE; - LOG (" doing slow sync\n"); + LOG (g_message ( " doing slow sync\n" )); } else { - LOG (" doing fast sync\n"); + LOG (g_message ( " doing fast sync\n" )); } } @@ -875,8 +873,8 @@ pre_sync (GnomePilotConduit *conduit, abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit); - LOG ("---------------------------------------------------------\n"); - LOG ("pre_sync: ToDo Conduit v.%s", CONDUIT_VERSION); + LOG (g_message ( "---------------------------------------------------------\n" )); + LOG (g_message ( "pre_sync: ToDo Conduit v.%s", CONDUIT_VERSION )); g_message ("ToDo Conduit v.%s", CONDUIT_VERSION); ctxt->dbi = dbi; @@ -892,7 +890,7 @@ pre_sync (GnomePilotConduit *conduit, ctxt->timezone = get_default_timezone (); if (ctxt->timezone == NULL) return -1; - LOG (" Using timezone: %s", icaltimezone_get_tzid (ctxt->timezone)); + LOG (g_message ( " Using timezone: %s", icaltimezone_get_tzid (ctxt->timezone) )); /* Set the default timezone on the backend. */ if (ctxt->timezone) @@ -978,7 +976,7 @@ post_sync (GnomePilotConduit *conduit, GList *changed; gchar *filename, *change_id; - LOG ("post_sync: ToDo Conduit v.%s", CONDUIT_VERSION); + LOG (g_message ( "post_sync: ToDo Conduit v.%s", CONDUIT_VERSION )); g_free (ctxt->cfg->last_uri); ctxt->cfg->last_uri = g_strdup (cal_client_get_uri (ctxt->client)); @@ -996,7 +994,7 @@ post_sync (GnomePilotConduit *conduit, cal_client_change_list_free (changed); g_free (change_id); - LOG ("---------------------------------------------------------\n"); + LOG (g_message ( "---------------------------------------------------------\n" )); return 0; } @@ -1009,7 +1007,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, { const char *uid; - LOG ("set_pilot_id: setting to %d\n", ID); + LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, ID, uid, FALSE); @@ -1024,7 +1022,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, { const char *uid; - LOG ("set_status_cleared: clearing status\n"); + LOG (g_message ( "set_status_cleared: clearing status\n" )); cal_component_get_uid (local->comp, &uid); g_hash_table_remove (ctxt->changed_hash, uid); @@ -1043,13 +1041,13 @@ for_each (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, -1); if (*local == NULL) { - LOG ("beginning for_each"); + LOG (g_message ( "beginning for_each" )); uids = ctxt->uids; count = 0; if (uids != NULL) { - LOG ("iterating over %d records", g_list_length (uids)); + LOG (g_message ( "iterating over %d records", g_list_length (uids) )); *local = g_new0 (EToDoLocalRecord, 1); local_record_from_uid (*local, uids->data, ctxt); @@ -1057,7 +1055,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, iterator = uids; } else { - LOG ("no events"); + LOG (g_message ( "no events" )); (*local) = NULL; return 0; } @@ -1070,7 +1068,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, local_record_from_uid (*local, iterator->data, ctxt); g_list_prepend (ctxt->locals, *local); } else { - LOG ("for_each ending"); + LOG (g_message ( "for_each ending" )); /* Tell the pilot the iteration is over */ *local = NULL; @@ -1093,13 +1091,13 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, 0); if (*local == NULL) { - LOG ("for_each_modified beginning\n"); + LOG (g_message ( "for_each_modified beginning\n" )); iterator = ctxt->changed; count = 0; - LOG ("iterating over %d records", g_hash_table_size (ctxt->changed_hash)); + LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) )); iterator = next_changed_item (ctxt, iterator); if (iterator != NULL) { @@ -1109,7 +1107,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, local_record_from_comp (*local, ccc->comp, ctxt); g_list_prepend (ctxt->locals, *local); } else { - LOG ("no events"); + LOG (g_message ( "no events" )); *local = NULL; } @@ -1123,7 +1121,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, local_record_from_comp (*local, ccc->comp, ctxt); g_list_prepend (ctxt->locals, *local); } else { - LOG ("for_each_modified ending"); + LOG (g_message ( "for_each_modified ending" )); /* Signal the iteration is over */ *local = NULL; @@ -1143,8 +1141,8 @@ compare (GnomePilotConduitSyncAbs *conduit, GnomePilotRecord local_pilot; int retval = 0; - LOG ("compare: local=%s remote=%s...\n", - print_local (local), print_remote (remote)); + LOG (g_message ("compare: local=%s remote=%s...\n", + print_local (local), print_remote (remote))); g_return_val_if_fail (local!=NULL,-1); g_return_val_if_fail (remote!=NULL,-1); @@ -1156,9 +1154,9 @@ compare (GnomePilotConduitSyncAbs *conduit, retval = 1; if (retval == 0) - LOG (" equal"); + LOG (g_message ( " equal" )); else - LOG (" not equal"); + LOG (g_message ( " not equal" )); return retval; } @@ -1174,7 +1172,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (remote != NULL, -1); - LOG ("add_record: adding %s to desktop\n", print_remote (remote)); + LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) )); comp = comp_from_remote_record (conduit, remote, ctxt->default_comp, ctxt->timezone); @@ -1201,8 +1199,8 @@ replace_record (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (remote != NULL, -1); - LOG ("replace_record: replace %s with %s\n", - print_local (local), print_remote (remote)); + LOG (g_message ("replace_record: replace %s with %s\n", + print_local (local), print_remote (remote))); new_comp = comp_from_remote_record (conduit, remote, local->comp, ctxt->timezone); g_object_unref (local->comp); @@ -1224,7 +1222,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, cal_component_get_uid (local->comp, &uid); - LOG ("delete_record: deleting %s\n", uid); + LOG (g_message ( "delete_record: deleting %s\n", uid )); e_pilot_map_remove_by_uid (ctxt->map, uid); cal_client_remove_object (ctxt->client, uid); @@ -1243,7 +1241,7 @@ archive_record (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, -1); - LOG ("archive_record: %s\n", archive ? "yes" : "no"); + LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" )); cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive); @@ -1259,8 +1257,8 @@ match (GnomePilotConduitSyncAbs *conduit, { const char *uid; - LOG ("match: looking for local copy of %s\n", - print_remote (remote)); + LOG (g_message ("match: looking for local copy of %s\n", + print_remote (remote))); g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (remote != NULL, -1); @@ -1271,7 +1269,7 @@ match (GnomePilotConduitSyncAbs *conduit, if (!uid) return 0; - LOG (" matched\n"); + LOG (g_message ( " matched\n" )); *local = g_new0 (EToDoLocalRecord, 1); local_record_from_uid (*local, uid, ctxt); @@ -1284,7 +1282,7 @@ free_match (GnomePilotConduitSyncAbs *conduit, EToDoLocalRecord *local, EToDoConduitContext *ctxt) { - LOG ("free_match: freeing\n"); + LOG (g_message ( "free_match: freeing\n" )); g_return_val_if_fail (local != NULL, -1); @@ -1299,7 +1297,7 @@ prepare (GnomePilotConduitSyncAbs *conduit, GnomePilotRecord *remote, EToDoConduitContext *ctxt) { - LOG ("prepare: encoding local %s\n", print_local (local)); + LOG (g_message ( "prepare: encoding local %s\n", print_local (local) )); *remote = local_record_to_pilot_record (local, ctxt); @@ -1321,7 +1319,7 @@ create_settings_window (GnomePilotConduit *conduit, GtkWidget *parent, EToDoConduitContext *ctxt) { - LOG ("create_settings_window"); + LOG (g_message ( "create_settings_window" )); ctxt->ps = e_pilot_settings_new (); ctxt->gui = e_todo_gui_new (E_PILOT_SETTINGS (ctxt->ps)); @@ -1336,7 +1334,7 @@ create_settings_window (GnomePilotConduit *conduit, static void display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) { - LOG ("display_settings"); + LOG (g_message ( "display_settings" )); fill_widgets (ctxt); } @@ -1344,7 +1342,7 @@ display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) static void save_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) { - LOG ("save_settings"); + LOG (g_message ( "save_settings" )); ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); e_todo_gui_fill_config (ctxt->gui, ctxt->new_cfg); @@ -1355,7 +1353,7 @@ save_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) static void revert_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) { - LOG ("revert_settings"); + LOG (g_message ( "revert_settings" )); todoconduit_save_configuration (ctxt->cfg); todoconduit_destroy_configuration (ctxt->new_cfg); @@ -1368,7 +1366,7 @@ conduit_get_gpilot_conduit (guint32 pilot_id) GtkObject *retval; EToDoConduitContext *ctxt; - LOG ("in todo's conduit_get_gpilot_conduit\n"); + LOG (g_message ( "in todo's conduit_get_gpilot_conduit\n" )); retval = gnome_pilot_conduit_sync_abs_new ("ToDoDB", 0x746F646F); g_assert (retval != NULL); |