diff options
author | Not Zed <NotZed@Ximian.com> | 2003-04-08 01:08:27 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2003-04-08 01:08:27 +0800 |
commit | d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94 (patch) | |
tree | c1f380a2e73d750691154bf6a53f0b34eb7e1ddb /addressbook/conduit | |
parent | ca1f07cab33bbe9a9bb6cd03399191782b0dc950 (diff) | |
download | gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar.gz gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar.bz2 gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar.lz gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar.xz gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.tar.zst gsoc2013-evolution-d08d5d0fab99ca5fb77f95bcb0da2d1ab7503c94.zip |
Fixes #40252.
2003-04-07 Not Zed <NotZed@Ximian.com>
Fixes #40252.
* conduit/address-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=20715
Diffstat (limited to 'addressbook/conduit')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 88 |
1 files changed, 43 insertions, 45 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 504aed4301..5f95287b98 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -23,6 +23,8 @@ #include <config.h> +#define G_LOG_DOMAIN "eaddrconduit" + #include <bonobo.h> #include <libxml/parser.h> #include <pi-source.h> @@ -48,22 +50,18 @@ GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define CONDUIT_VERSION "0.1.2" -#ifdef G_LOG_DOMAIN -#undef G_LOG_DOMAIN -#endif -#define G_LOG_DOMAIN "eaddrconduit" #define DEBUG_CONDUIT 1 /* #undef DEBUG_CONDUIT */ #ifdef DEBUG_CONDUIT -#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 { EBookStatus status; @@ -867,7 +865,7 @@ local_record_to_pilot_record (EAddrLocalRecord *local, g_assert (local->addr != 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; @@ -1231,7 +1229,7 @@ check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *ctxt) /* Or if the URI's don't match */ uri = e_book_get_uri (ctxt->ebook); - 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); @@ -1239,9 +1237,9 @@ check_for_slow_setting (GnomePilotConduit *c, EAddrConduitContext *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" )); } } @@ -1367,8 +1365,8 @@ pre_sync (GnomePilotConduit *conduit, abs_conduit = GNOME_PILOT_CONDUIT_SYNC_ABS (conduit); - LOG ("---------------------------------------------------------\n"); - LOG ("pre_sync: Addressbook Conduit v.%s", CONDUIT_VERSION); + LOG (g_message ( "---------------------------------------------------------\n" )); + LOG (g_message ( "pre_sync: Addressbook Conduit v.%s", CONDUIT_VERSION )); /* g_message ("Addressbook Conduit v.%s", CONDUIT_VERSION); */ ctxt->dbi = dbi; @@ -1430,7 +1428,7 @@ post_sync (GnomePilotConduit *conduit, { gchar *filename, *change_id; - LOG ("post_sync: Address Conduit v.%s", CONDUIT_VERSION); + LOG (g_message ( "post_sync: Address Conduit v.%s", CONDUIT_VERSION )); g_free (ctxt->cfg->last_uri); ctxt->cfg->last_uri = g_strdup (e_book_get_uri (ctxt->ebook)); @@ -1448,7 +1446,7 @@ post_sync (GnomePilotConduit *conduit, g_free (change_id); gtk_main (); - LOG ("---------------------------------------------------------\n"); + LOG (g_message ( "---------------------------------------------------------\n" )); return 0; } @@ -1459,7 +1457,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, guint32 ID, EAddrConduitContext *ctxt) { - LOG ("set_pilot_id: setting to %d\n", ID); + LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); e_pilot_map_insert (ctxt->map, ID, local->ecard->id, FALSE); @@ -1471,7 +1469,7 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord *local, EAddrConduitContext *ctxt) { - LOG ("set_status_cleared: clearing status\n"); + LOG (g_message ( "set_status_cleared: clearing status\n" )); g_hash_table_remove (ctxt->changed_hash, e_card_get_id (local->ecard)); @@ -1489,13 +1487,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" )); cards = ctxt->cards; count = 0; if (cards != NULL) { - LOG ("iterating over %d records", g_list_length (cards)); + LOG (g_message ( "iterating over %d records", g_list_length (cards) )); *local = g_new0 (EAddrLocalRecord, 1); local_record_from_ecard (*local, cards->data, ctxt); @@ -1503,7 +1501,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, iterator = cards; } else { - LOG ("no events"); + LOG (g_message ( "no events" )); (*local) = NULL; return 0; } @@ -1516,7 +1514,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, local_record_from_ecard (*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; @@ -1539,7 +1537,7 @@ 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; @@ -1549,13 +1547,13 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, if (iterator != NULL) { CardObjectChange *coc = iterator->data; - 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) )); *local = g_new0 (EAddrLocalRecord, 1); local_record_from_ecard (*local, coc->card, ctxt); g_list_prepend (ctxt->locals, *local); } else { - LOG ("no events"); + LOG (g_message ( "no events" )); *local = NULL; } @@ -1569,7 +1567,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, local_record_from_ecard (*local, coc->card, 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; @@ -1590,8 +1588,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); @@ -1603,9 +1601,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; } @@ -1621,7 +1619,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) )); ecard = ecard_from_remote_record (ctxt, remote, NULL); @@ -1658,8 +1656,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))); old_id = g_strdup (e_card_get_id (local->ecard)); coc = g_hash_table_lookup (ctxt->changed_hash, old_id); @@ -1711,7 +1709,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (local->ecard != NULL, -1); - LOG ("delete_record: delete %s\n", print_local (local)); + LOG (g_message ( "delete_record: delete %s\n", print_local (local) )); e_pilot_map_remove_by_uid (ctxt->map, local->ecard->id); e_book_remove_card_by_id (ctxt->ebook, local->ecard->id, status_cb, &commit_status); @@ -1734,7 +1732,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" )); e_pilot_map_insert (ctxt->map, local->local.ID, local->ecard->id, archive); @@ -1749,8 +1747,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); @@ -1761,7 +1759,7 @@ match (GnomePilotConduitSyncAbs *conduit, if (!uid) return 0; - LOG (" matched\n"); + LOG (g_message ( " matched\n" )); *local = g_new0 (EAddrLocalRecord, 1); local_record_from_uid (*local, uid, ctxt); @@ -1774,7 +1772,7 @@ free_match (GnomePilotConduitSyncAbs *conduit, EAddrLocalRecord *local, EAddrConduitContext *ctxt) { - LOG ("free_match: freeing\n"); + LOG (g_message ( "free_match: freeing\n" )); g_return_val_if_fail (local != NULL, -1); @@ -1789,7 +1787,7 @@ prepare (GnomePilotConduitSyncAbs *conduit, GnomePilotRecord *remote, EAddrConduitContext *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); @@ -1811,7 +1809,7 @@ create_settings_window (GnomePilotConduit *conduit, GtkWidget *parent, EAddrConduitContext *ctxt) { - LOG ("create_settings_window"); + LOG (g_message ( "create_settings_window" )); ctxt->ps = e_pilot_settings_new (); ctxt->gui = e_addr_gui_new (E_PILOT_SETTINGS (ctxt->ps)); @@ -1826,7 +1824,7 @@ create_settings_window (GnomePilotConduit *conduit, static void display_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt) { - LOG ("display_settings"); + LOG (g_message ( "display_settings" )); fill_widgets (ctxt); } @@ -1834,7 +1832,7 @@ display_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt) static void save_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt) { - LOG ("save_settings"); + LOG (g_message ( "save_settings" )); ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); @@ -1846,7 +1844,7 @@ save_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt) static void revert_settings (GnomePilotConduit *conduit, EAddrConduitContext *ctxt) { - LOG ("revert_settings"); + LOG (g_message ( "revert_settings" )); addrconduit_save_configuration (ctxt->cfg); addrconduit_destroy_configuration (ctxt->new_cfg); @@ -1859,7 +1857,7 @@ conduit_get_gpilot_conduit (guint32 pilot_id) GtkObject *retval; EAddrConduitContext *ctxt; - LOG ("in address's conduit_get_gpilot_conduit\n"); + LOG (g_message ( "in address's conduit_get_gpilot_conduit\n" )); retval = gnome_pilot_conduit_sync_abs_new ("AddressDB", 0x61646472); g_assert (retval != NULL); |