[seahorse] libseahorse: Use g_debug instead of seahorse_debug



commit aa9418f24938267b56cb54eea9fc2db7dfa71cae
Author: Stef Walter <stefw redhat com>
Date:   Thu Jul 31 21:57:01 2014 +0200

    libseahorse: Use g_debug instead of seahorse_debug
    
    Now that g_debug() is useful, use it instead of seahorse_debug

 Makefile.am                              |    1 +
 libseahorse/Makefile.am                  |    1 -
 libseahorse/seahorse-debug.c             |  112 ------------------------------
 libseahorse/seahorse-debug.h             |   91 ------------------------
 libseahorse/seahorse-key-manager-store.c |   28 ++++----
 pgp/seahorse-discovery.c                 |    7 +--
 pgp/seahorse-gpgme-key-op.c              |   23 +++----
 pgp/seahorse-gpgme-keyring.c             |   20 +++---
 pgp/seahorse-gpgme.c                     |   17 +++--
 pgp/seahorse-hkp-source.c                |    9 +--
 pgp/seahorse-ldap-source.c               |   28 +++-----
 pgp/seahorse-pgp-key-properties.c        |    7 +--
 pgp/seahorse-transfer.c                  |   19 +++---
 ssh/seahorse-ssh-operation.c             |   27 ++++----
 ssh/seahorse-ssh-source.c                |   13 ++--
 15 files changed, 92 insertions(+), 311 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 87ee271..1f40432 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -93,6 +93,7 @@ AM_CPPFLAGS = \
        -DLOCALEDIR=\"$(localedir)\" \
        -DGETTEXT_PACKAGE=\""seahorse\"" \
        -DEXECDIR=\""$(seahorselibexecbindir)"\" \
+       -DG_LOG_DOMAIN=\"seahorse\" \
        $(SEAHORSE_CFLAGS) \
        $(NULL)
 
diff --git a/libseahorse/Makefile.am b/libseahorse/Makefile.am
index 0a9bd59..8936395 100644
--- a/libseahorse/Makefile.am
+++ b/libseahorse/Makefile.am
@@ -31,7 +31,6 @@ libseahorse_a_SOURCES = \
        libseahorse/seahorse-application.c libseahorse/seahorse-application.h \
        libseahorse/seahorse-bind.c libseahorse/seahorse-bind.h \
        libseahorse/seahorse-collection.c libseahorse/seahorse-collection.h \
-       libseahorse/seahorse-debug.c libseahorse/seahorse-debug.h \
        libseahorse/seahorse-interaction.c libseahorse/seahorse-interaction.h \
        libseahorse/seahorse-key-manager-store.c libseahorse/seahorse-key-manager-store.h \
        libseahorse/seahorse-object.c libseahorse/seahorse-object.h \
diff --git a/libseahorse/seahorse-key-manager-store.c b/libseahorse/seahorse-key-manager-store.c
index 7cdff11..afd95a3 100644
--- a/libseahorse/seahorse-key-manager-store.c
+++ b/libseahorse/seahorse-key-manager-store.c
@@ -21,6 +21,9 @@
 
 #include "config.h"
 
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "seahorse-drag"
+
 #include "seahorse-key-manager-store.h"
 #include "seahorse-prefs.h"
 #include "seahorse-validity.h"
@@ -34,9 +37,6 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_DRAG
-#include "seahorse-debug.h"
-
 #include "libegg/eggtreemultidnd.h"
 
 #define KEY_MANAGER_SORT_KEY "/apps/seahorse/listing/sort_by"
@@ -317,7 +317,7 @@ drag_begin (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore
        GtkTreeView *view = GTK_TREE_VIEW (widget);
        GdkWindow *source_window;
 
-       seahorse_debug ("drag_begin -->");
+       g_debug ("drag_begin -->");
 
        g_free (skstore->priv->drag_destination);
        skstore->priv->drag_destination = NULL;
@@ -334,7 +334,7 @@ drag_begin (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore
                                     strlen (XDS_FILENAME));
        }
 
-       seahorse_debug ("drag_begin <--");
+       g_debug ("drag_begin <--");
        return skstore->priv->drag_objects ? TRUE : FALSE;
 }
 
@@ -355,7 +355,7 @@ export_to_text (SeahorseKeyManagerStore *self,
        guint count;
 
        g_return_val_if_fail (self->priv->drag_objects, FALSE);
-       seahorse_debug ("exporting to text");
+       g_debug ("exporting to text");
 
        count = seahorse_exportable_export_to_text_wait (self->priv->drag_objects,
                                                         &output, &size, &self->priv->drag_error);
@@ -363,7 +363,7 @@ export_to_text (SeahorseKeyManagerStore *self,
        /* TODO: Need to print status if only partially exported */
 
        if (count > 0) {
-               seahorse_debug ("setting selection text");
+               g_debug ("setting selection text");
                gtk_selection_data_set_text (selection_data, (gchar *)output, (gint)size);
                ret = TRUE;
        } else if (self->priv->drag_error) {
@@ -382,7 +382,7 @@ static gboolean
 export_to_directory (SeahorseKeyManagerStore *self,
                      const gchar *directory)
 {
-       seahorse_debug ("exporting to %s", directory);
+       g_debug ("exporting to %s", directory);
 
        return seahorse_exportable_export_to_directory_wait (self->priv->drag_objects,
                                                             directory,
@@ -396,13 +396,13 @@ drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *sel
        gchar *destination;
        gboolean ret;
 
-       seahorse_debug ("drag_data_get %d -->", info);
+       g_debug ("drag_data_get %d -->", info);
 
        g_return_val_if_fail (skstore->priv->drag_objects, FALSE);
 
        /* The caller wants plain text */
        if (info == DRAG_INFO_TEXT) {
-               seahorse_debug ("returning object text");
+               g_debug ("returning object text");
                export_to_text (skstore, selection_data);
 
        /* The caller wants XDS */
@@ -420,17 +420,17 @@ drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *sel
 
        /* Unrecognized format */
        } else {
-               seahorse_debug ("Unrecognized format: %d", info);
+               g_debug ("Unrecognized format: %d", info);
        }
 
-       seahorse_debug ("drag_data_get <--");
+       g_debug ("drag_data_get <--");
        return ret;
 }
 
 static void
 drag_end (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore *skstore)
 {
-       seahorse_debug ("drag_end -->");
+       g_debug ("drag_end -->");
 
        if (skstore->priv->drag_destination && !skstore->priv->drag_error)
                export_to_directory (skstore, skstore->priv->drag_destination);
@@ -447,7 +447,7 @@ drag_end (GtkWidget *widget, GdkDragContext *context, SeahorseKeyManagerStore *s
        g_free (skstore->priv->drag_destination);
        skstore->priv->drag_destination = NULL;
 
-       seahorse_debug ("drag_end <--");
+       g_debug ("drag_end <--");
 }
 
 static gint
diff --git a/pgp/seahorse-discovery.c b/pgp/seahorse-discovery.c
index ea30334..5d263c1 100644
--- a/pgp/seahorse-discovery.c
+++ b/pgp/seahorse-discovery.c
@@ -33,9 +33,6 @@
 
 #include "libseahorse/seahorse-util.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_DNSSD
-#include "libseahorse/seahorse-debug.h"
-
 #define HKP_SERVICE_TYPE "_pgpkey-hkp._tcp."
 
 /*
@@ -167,7 +164,7 @@ resolve_callback (AvahiServiceResolver *resolver, AvahiIfIndex iface, AvahiProto
                        g_object_unref (ssrc);
                }
 
-               seahorse_debug ("added: %s %s\n", service_name, service_uri);
+               g_debug ("added: %s %s\n", service_name, service_uri);
                break;
 
        default:
@@ -232,7 +229,7 @@ browse_callback(AvahiServiceBrowser *browser, AvahiIfIndex iface, AvahiProtocol
                /* And remove it from our tables */
                g_hash_table_remove (self->services, name);
                g_signal_emit (self, signals[REMOVED], 0, name);
-               seahorse_debug ("removed: %s\n", name);
+               g_debug ("removed: %s\n", name);
                break;
 
        default:
diff --git a/pgp/seahorse-gpgme-key-op.c b/pgp/seahorse-gpgme-key-op.c
index 813dbe8..a765033 100644
--- a/pgp/seahorse-gpgme-key-op.c
+++ b/pgp/seahorse-gpgme-key-op.c
@@ -32,9 +32,6 @@
 #include "libseahorse/seahorse-progress.h"
 #include "libseahorse/seahorse-util.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_KEYS
-#include "libseahorse/seahorse-debug.h"
-
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 
@@ -336,8 +333,8 @@ seahorse_gpgme_key_op_edit (gpointer data, gpgme_status_code_t status,
            status == GPGME_STATUS_ALREADY_SIGNED || status == GPGME_STATUS_MISSING_PASSPHRASE)         
                return parms->err;
 
-       seahorse_debug ("[edit key] state: %d / status: %d / args: %s",
-                       parms->state, status, args);
+       g_debug ("[edit key] state: %d / status: %d / args: %s",
+                parms->state, status, args);
 
        /* Choose the next state based on the current one and the input */
        parms->state = parms->transit (parms->state, status, args, parms->data, &parms->err);
@@ -917,7 +914,7 @@ seahorse_gpgme_key_op_set_trust (SeahorseGpgmeKey *pkey, SeahorseValidity trust)
        SeahorseEditParm *parms;
        gint menu_choice;
 
-       seahorse_debug ("[GPGME_KEY_OP] set_trust: trust = %i", trust);
+       g_debug ("[GPGME_KEY_OP] set_trust: trust = %i", trust);
 
        g_return_val_if_fail (SEAHORSE_IS_GPGME_KEY (pkey), GPG_E (GPG_ERR_WRONG_KEY_USAGE));
        g_return_val_if_fail (trust >= SEAHORSE_VALIDITY_NEVER, GPG_E (GPG_ERR_INV_VALUE));
@@ -2476,7 +2473,7 @@ photoid_load_transit (guint current_state, gpgme_status_code_t status,
        case PHOTO_ID_LOAD_DESELECT:
                if (parm->uid < parm->num_uids) {
                        parm->uid = parm->uid + 1;
-                       seahorse_debug ("PhotoIDLoad Next UID %i", parm->uid);
+                       g_debug ("PhotoIDLoad Next UID %i", parm->uid);
                        if (status == GPGME_STATUS_GET_LINE && g_str_equal (args, PROMPT)) {
                                next_state = PHOTO_ID_LOAD_SELECT;
                        } else {
@@ -2486,7 +2483,7 @@ photoid_load_transit (guint current_state, gpgme_status_code_t status,
                } else {
                        if (status == GPGME_STATUS_GET_LINE && g_str_equal (args, PROMPT)) {
                                next_state = PHOTO_ID_LOAD_QUIT;
-                               seahorse_debug ("PhotoIDLoad Quiting Load");
+                               g_debug ("PhotoIDLoad Quiting Load");
                        } else {
                                *err = GPG_E (GPG_ERR_GENERAL);
                                g_return_val_if_reached (PHOTO_ID_LOAD_ERROR);
@@ -2497,7 +2494,7 @@ photoid_load_transit (guint current_state, gpgme_status_code_t status,
        case PHOTO_ID_LOAD_QUIT:
                /* Shouldn't be reached */
                *err = GPG_E (GPG_ERR_GENERAL);
-               seahorse_debug ("PhotoIDLoad Reached Quit");
+               g_debug ("PhotoIDLoad Reached Quit");
                g_return_val_if_reached (PHOTO_ID_LOAD_ERROR);
                break;
                
@@ -2532,7 +2529,7 @@ seahorse_gpgme_key_op_photos_load (SeahorseGpgmeKey *pkey)
        g_return_val_if_fail (key->subkeys && key->subkeys->keyid, GPG_E (GPG_ERR_INV_VALUE));
        keyid = key->subkeys->keyid;
 
-       seahorse_debug ("PhotoIDLoad Start");
+       g_debug ("PhotoIDLoad Start");
 
        fd = g_mkstemp (image_path);
        if(fd == -1) { 
@@ -2550,9 +2547,9 @@ seahorse_gpgme_key_op_photos_load (SeahorseGpgmeKey *pkey)
                photoid_load_parm.output_file = image_path;
                photoid_load_parm.key = key;
 
-               seahorse_debug ("PhotoIdLoad KeyID %s", keyid);
+               g_debug ("PhotoIdLoad KeyID %s", keyid);
                gerr = seahorse_gpg_op_num_uids (NULL, keyid, &(photoid_load_parm.num_uids));
-               seahorse_debug ("PhotoIDLoad Number of UIDs %i", photoid_load_parm.num_uids);
+               g_debug ("PhotoIDLoad Number of UIDs %i", photoid_load_parm.num_uids);
 
                if (GPG_IS_OK (gerr)) {
             
@@ -2577,7 +2574,7 @@ seahorse_gpgme_key_op_photos_load (SeahorseGpgmeKey *pkey)
                seahorse_object_list_free (photoid_load_parm.photos);
        }
 
-       seahorse_debug ("PhotoIDLoad Done");
+       g_debug ("PhotoIDLoad Done");
 
        return gerr;
 }
diff --git a/pgp/seahorse-gpgme-keyring.c b/pgp/seahorse-gpgme-keyring.c
index 179c915..1f8e67d 100644
--- a/pgp/seahorse-gpgme-keyring.c
+++ b/pgp/seahorse-gpgme-keyring.c
@@ -20,6 +20,9 @@
 
 #include "config.h"
 
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "operation"
+
 #include "seahorse-gpgme-keyring.h"
 
 #include "seahorse-gpgme-data.h"
@@ -45,9 +48,6 @@
 #include <libintl.h>
 #include <locale.h>
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_OPERATION
-#include "libseahorse/seahorse-debug.h"
-
 enum {
        PROP_0,
        PROP_LABEL,
@@ -412,7 +412,7 @@ static void
 cancel_scheduled_refresh (SeahorseGpgmeKeyring *self)
 {
        if (self->pv->scheduled_refresh != 0) {
-               seahorse_debug ("cancelling scheduled refresh event");
+               g_debug ("cancelling scheduled refresh event");
                g_source_remove (self->pv->scheduled_refresh);
                self->pv->scheduled_refresh = 0;
        }
@@ -422,7 +422,7 @@ static gboolean
 scheduled_dummy (gpointer user_data)
 {
        SeahorseGpgmeKeyring *self = SEAHORSE_GPGME_KEYRING (user_data);
-       seahorse_debug ("dummy refresh event occurring now");
+       g_debug ("dummy refresh event occurring now");
        self->pv->scheduled_refresh = 0;
        return FALSE; /* don't run again */
 }
@@ -486,9 +486,9 @@ seahorse_gpgme_keyring_load_full_async (SeahorseGpgmeKeyring *self,
        /* Schedule a dummy refresh. This blocks all monitoring for a while */
        cancel_scheduled_refresh (self);
        self->pv->scheduled_refresh = g_timeout_add (500, scheduled_dummy, self);
-       seahorse_debug ("scheduled a dummy refresh");
+       g_debug ("scheduled a dummy refresh");
 
-       seahorse_debug ("refreshing keys...");
+       g_debug ("refreshing keys...");
 
        res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
                                         seahorse_gpgme_keyring_load_full_async);
@@ -733,7 +733,7 @@ scheduled_refresh (gpointer user_data)
 {
        SeahorseGpgmeKeyring *self = SEAHORSE_GPGME_KEYRING (user_data);
 
-       seahorse_debug ("scheduled refresh event ocurring now");
+       g_debug ("scheduled refresh event ocurring now");
        cancel_scheduled_refresh (self);
        seahorse_gpgme_keyring_load_async (SEAHORSE_PLACE (self), NULL, NULL, NULL);
 
@@ -754,7 +754,7 @@ monitor_gpg_homedir (GFileMonitor *handle, GFile *file, GFile *other_file,
                name = g_file_get_basename (file);
                if (g_str_has_suffix (name, ".gpg")) {
                        if (self->pv->scheduled_refresh == 0) {
-                               seahorse_debug ("scheduling refresh event due to file changes");
+                               g_debug ("scheduling refresh event due to file changes");
                                self->pv->scheduled_refresh = g_timeout_add (500, scheduled_refresh, self);
                        }
                }
@@ -907,7 +907,7 @@ seahorse_gpgme_keyring_class_init (SeahorseGpgmeKeyringClass *klass)
 {
        GObjectClass *gobject_class;
 
-       g_message ("init gpgme version %s", gpgme_check_version (NULL));
+       g_debug ("init gpgme version %s", gpgme_check_version (NULL));
 
 #ifdef ENABLE_NLS
        gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
diff --git a/pgp/seahorse-gpgme.c b/pgp/seahorse-gpgme.c
index 9a621ec..52d2428 100644
--- a/pgp/seahorse-gpgme.c
+++ b/pgp/seahorse-gpgme.c
@@ -21,12 +21,13 @@
 
 #include "config.h"
 
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "operation"
+
 #include "seahorse-gpgme.h"
 
 #include "seahorse-common.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_OPERATION
-#include "libseahorse/seahorse-debug.h"
 #include "libseahorse/seahorse-util.h"
 
 #include <glib/gi18n.h>
@@ -318,7 +319,7 @@ seahorse_gpgme_gsource_dispatch (GSource *gsource,
        for (l = watches; l != NULL; l = g_list_next (l)) {
                watch = l->data;
                if (watch->registered && watch->poll_fd.revents) {
-                       seahorse_debug ("GPGME OP: io for GPGME on %d", watch->poll_fd.fd);
+                       g_debug ("GPGME OP: io for GPGME on %d", watch->poll_fd.fd);
                        g_assert (watch->fnc);
                        watch->poll_fd.revents = 0;
                        (watch->fnc) (watch->fnc_data, watch->poll_fd.fd);
@@ -355,7 +356,7 @@ register_watch (WatchData *watch)
        if (watch->registered)
                return;
 
-       seahorse_debug ("GPGME OP: registering watch %d", watch->poll_fd.fd);
+       g_debug ("GPGME OP: registering watch %d", watch->poll_fd.fd);
 
        watch->registered = TRUE;
        g_source_add_poll (watch->gsource, &watch->poll_fd);
@@ -367,7 +368,7 @@ unregister_watch (WatchData *watch)
        if (!watch->registered)
                return;
 
-       seahorse_debug ("GPGME OP: unregistering watch %d", watch->poll_fd.fd);
+       g_debug ("GPGME OP: unregistering watch %d", watch->poll_fd.fd);
 
        watch->registered = FALSE;
        g_source_remove_poll (watch->gsource, &watch->poll_fd);
@@ -385,7 +386,7 @@ on_gpgme_add_watch (void *user_data,
        SeahorseGpgmeGSource *gpgme_gsource = user_data;
        WatchData *watch;
 
-       seahorse_debug ("PGPOP: request to register watch %d", fd);
+       g_debug ("PGPOP: request to register watch %d", fd);
 
        watch = g_new0 (WatchData, 1);
        watch->registered = FALSE;
@@ -437,7 +438,7 @@ on_gpgme_event (void *user_data,
        case GPGME_EVENT_START:
                gpgme_gsource->busy = TRUE;
                gpgme_gsource->finished = FALSE;
-               seahorse_debug ("PGPOP: start event");
+               g_debug ("PGPOP: start event");
 
                /* Since we weren't supposed to register these before, do it now */
                for (l = gpgme_gsource->watches; l != NULL; l= g_list_next (l))
@@ -448,7 +449,7 @@ on_gpgme_event (void *user_data,
        case GPGME_EVENT_DONE:
                gpgme_gsource->busy = FALSE;
                gerr = (gpgme_error_t *)type_data;
-               seahorse_debug ("PGPOP: done event (err: %d)", *gerr);
+               g_debug ("PGPOP: done event (err: %d)", *gerr);
 
                /* Make sure we have no extra watches left over */
                for (l = gpgme_gsource->watches; l != NULL; l = g_list_next (l))
diff --git a/pgp/seahorse-hkp-source.c b/pgp/seahorse-hkp-source.c
index a9bc612..a3ab63c 100644
--- a/pgp/seahorse-hkp-source.c
+++ b/pgp/seahorse-hkp-source.c
@@ -38,9 +38,6 @@
 
 #include <libsoup/soup.h>
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_HKP
-#include "libseahorse/seahorse-debug.h"
-
 /**
  * SECTION: seahorse-hkp-source
  * @short_description: Implements the HKP (HTTP Keyserver protocol) Source object
@@ -118,6 +115,7 @@ create_hkp_soup_session (void)
        SoupSession *session;
 #if WITH_DEBUG
        SoupLogger *logger;
+       const gchar *env;
 #endif
 
         session = soup_session_async_new_with_options (SOUP_SESSION_ADD_FEATURE_BY_TYPE,
@@ -126,7 +124,8 @@ create_hkp_soup_session (void)
 
 
 #if WITH_DEBUG
-       if (seahorse_debugging) {
+        env = g_getenv ("G_MESSAGES_DEBUG");
+        if (env && strstr (env, "seahorse")) {
                logger = soup_logger_new (SOUP_LOGGER_LOG_BODY, -1);
                soup_session_add_feature (session, SOUP_SESSION_FEATURE (logger));
                g_object_unref (logger);
@@ -295,7 +294,7 @@ parse_hkp_index (const gchar *response)
                line = *l;      
                dehtmlize (line);
 
-               seahorse_debug ("%s", line);
+               g_debug ("%s", line);
 
                /* Start a new key */
                if (g_ascii_strncasecmp (line, "pub ", 4) == 0) {
diff --git a/pgp/seahorse-ldap-source.c b/pgp/seahorse-ldap-source.c
index 0991131..a511f1f 100644
--- a/pgp/seahorse-ldap-source.c
+++ b/pgp/seahorse-ldap-source.c
@@ -47,9 +47,6 @@
 
 #ifdef WITH_LDAP
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_LDAP
-#include "libseahorse/seahorse-debug.h"
-
 /* Amount of keys to load in a batch */
 #define DEFAULT_LOAD_BATCH 30
 
@@ -140,7 +137,7 @@ dump_ldap_entry (LDAP *ld, LDAPMessage *res)
     char *t;
     
     t = ldap_get_dn (ld, res);
-    g_printerr ("dn: %s\n", t);
+    g_debug ("dn: %s\n", t);
     ldap_memfree (t);
     
     for (t = ldap_first_attribute (ld, res, &pos); t; 
@@ -148,8 +145,8 @@ dump_ldap_entry (LDAP *ld, LDAPMessage *res)
              
         values = get_ldap_values (ld, res, t);
         for (v = values; *v; v++) 
-            g_printerr ("%s: %s\n", t, *v);
-             
+            g_debug ("%s: %s\n", t, *v);
+
         g_strfreev (values);
         ldap_memfree (t);
     }
@@ -477,10 +474,9 @@ on_connect_server_info_completed (LDAPMessage *result,
        /* If we have results then fill in the server info */
        if (type == LDAP_RES_SEARCH_ENTRY) {
 
-               seahorse_debug ("Server Info Result:");
+               g_debug ("Server Info Result");
 #ifdef WITH_DEBUG
-               if (seahorse_debugging)
-                       dump_ldap_entry (closure->ldap, result);
+               dump_ldap_entry (closure->ldap, result);
 #endif
 
                /* NOTE: When adding attributes here make sure to add them to kServerAttributes */
@@ -871,10 +867,9 @@ on_search_search_completed (LDAPMessage *result,
 
        /* An LDAP entry */
        if (type == LDAP_RES_SEARCH_ENTRY) {
-               seahorse_debug ("Retrieved Key Entry:");
+               g_debug ("Retrieved Key Entry");
 #ifdef WITH_DEBUG
-               if (seahorse_debugging)
-                       dump_ldap_entry (closure->ldap, result);
+               dump_ldap_entry (closure->ldap, result);
 #endif
 
                search_parse_key_from_ldap_entry (self, closure->results,
@@ -932,8 +927,8 @@ on_search_connect_completed (GObject *source,
 
        sinfo = get_ldap_server_info (self, TRUE);
 
-       seahorse_debug ("Searching Server ... base: %s, filter: %s",
-                       sinfo->base_dn, closure->filter);
+       g_debug ("Searching Server ... base: %s, filter: %s",
+                sinfo->base_dn, closure->filter);
 
        rc = ldap_search_ext (closure->ldap, sinfo->base_dn, LDAP_SCOPE_SUBTREE,
                              closure->filter, (char **)PGP_ATTRIBUTES, 0,
@@ -1243,10 +1238,9 @@ on_export_search_completed (LDAPMessage *result,
        /* An LDAP Entry */
        if (type == LDAP_RES_SEARCH_ENTRY) {
 
-               seahorse_debug ("Server Info Result:");
+               g_debug ("Server Info Result");
 #ifdef WITH_DEBUG
-               if (seahorse_debugging)
-                       dump_ldap_entry (closure->ldap, result);
+               dump_ldap_entry (closure->ldap, result);
 #endif
 
                key = get_string_attribute (closure->ldap, result, sinfo->key_attr);
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index 49c773b..8cc1b9f 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -44,9 +44,6 @@
 #include "libseahorse/seahorse-object-widget.h"
 #include "libseahorse/seahorse-util.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_KEYS
-#include "libseahorse/seahorse-debug.h"
-
 #include <glib/gi18n.h>
 
 #include <string.h>
@@ -1231,7 +1228,7 @@ setup_details_trust (SeahorseWidget *swidget)
     GtkTreeIter iter;
     GtkCellRenderer *text_cell = gtk_cell_renderer_text_new ();
 
-    seahorse_debug ("KeyProperties: Setting up Trust Combo Box Store");
+    g_debug ("KeyProperties: Setting up Trust Combo Box Store");
 
     object = SEAHORSE_OBJECT (SEAHORSE_OBJECT_WIDGET (swidget)->object);
     etype = seahorse_object_get_usage (object);
@@ -1283,7 +1280,7 @@ setup_details_trust (SeahorseWidget *swidget)
     
     gtk_combo_box_set_model (GTK_COMBO_BOX (widget), GTK_TREE_MODEL (model));                                
        
 
-    seahorse_debug ("KeyProperties: Finished Setting up Trust Combo Box Store");
+    g_debug ("KeyProperties: Finished Setting up Trust Combo Box Store");
 }
 
 static void
diff --git a/pgp/seahorse-transfer.c b/pgp/seahorse-transfer.c
index 5875d0e..65e79b3 100644
--- a/pgp/seahorse-transfer.c
+++ b/pgp/seahorse-transfer.c
@@ -20,6 +20,9 @@
 
 #include "config.h"
 
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "operation"
+
 #include "seahorse-transfer.h"
 
 #include "seahorse-server-source.h"
@@ -28,8 +31,6 @@
 
 #include "seahorse-common.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_OPERATION
-#include "libseahorse/seahorse-debug.h"
 #include "libseahorse/seahorse-object-list.h"
 #include "libseahorse/seahorse-progress.h"
 #include "libseahorse/seahorse-util.h"
@@ -68,7 +69,7 @@ on_source_import_ready (GObject *object,
        GError *error = NULL;
        GList *results;
 
-       seahorse_debug ("[transfer] import done");
+       g_debug ("[transfer] import done");
        seahorse_progress_end (closure->cancellable, &closure->to);
 
        if (SEAHORSE_IS_GPGME_KEYRING (closure->to)) {
@@ -103,7 +104,7 @@ on_source_export_ready (GObject *object,
        gsize stream_size;
        GInputStream *input;
 
-       seahorse_debug ("[transfer] export done");
+       g_debug ("[transfer] export done");
        seahorse_progress_end (closure->cancellable, &closure->from);
 
        if (SEAHORSE_IS_SERVER_SOURCE (closure->from)) {
@@ -125,7 +126,7 @@ on_source_export_ready (GObject *object,
                seahorse_progress_begin (closure->cancellable, &closure->to);
 
                if (!stream_size) {
-                       seahorse_debug ("[transfer] nothing to import");
+                       g_debug ("[transfer] nothing to import");
                        seahorse_progress_end (closure->cancellable, &closure->to);
                        g_simple_async_result_complete (res);
 
@@ -134,7 +135,7 @@ on_source_export_ready (GObject *object,
                        stream_data = NULL;
                        stream_size = 0;
 
-                       seahorse_debug ("[transfer] starting import");
+                       g_debug ("[transfer] starting import");
                        if (SEAHORSE_IS_GPGME_KEYRING (closure->to)) {
                                seahorse_gpgme_keyring_import_async (SEAHORSE_GPGME_KEYRING (closure->to),
                                                                     input, closure->cancellable,
@@ -150,7 +151,7 @@ on_source_export_ready (GObject *object,
                }
 
        } else {
-               seahorse_debug ("[transfer] stopped after export");
+               g_debug ("[transfer] stopped after export");
                g_simple_async_result_take_error (res, error);
                g_simple_async_result_complete (res);
        }
@@ -239,7 +240,7 @@ seahorse_transfer_keys_async (SeahorsePlace *from,
                                SEAHORSE_IS_GPGME_KEYRING (closure->to) ?
                                _("Importing data") : _("Sending data"));
 
-       seahorse_debug ("starting export");
+       g_debug ("starting export");
 
        /* We delay and continue from a callback */
        g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 0,
@@ -286,7 +287,7 @@ seahorse_transfer_keyids_async (SeahorseServerSource *from,
                                SEAHORSE_IS_GPGME_KEYRING (closure->to) ?
                                _("Importing data") : _("Sending data"));
 
-       seahorse_debug ("starting export");
+       g_debug ("starting export");
 
        /* We delay and continue from a callback */
        g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 0,
diff --git a/ssh/seahorse-ssh-operation.c b/ssh/seahorse-ssh-operation.c
index 9f0e8b3..8663766 100644
--- a/ssh/seahorse-ssh-operation.c
+++ b/ssh/seahorse-ssh-operation.c
@@ -20,12 +20,13 @@
 
 #include "config.h"
 
+#undef G_LOG_DOMAIN
+#define G_LOG_DOMAIN "operation"
+
 #include "seahorse-ssh-operation.h"
 
 #include "seahorse-common.h"
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_OPERATION
-#include "libseahorse/seahorse-debug.h"
 #include "libseahorse/seahorse-util.h"
 
 #include <sys/wait.h>
@@ -185,7 +186,7 @@ on_watch_ssh_process (GPid pid,
        ssh_operation_closure *closure = g_simple_async_result_get_op_res_gpointer (res);
        const gchar *message;
 
-       seahorse_debug ("SSHOP: SSH process done");
+       g_debug ("SSHOP: SSH process done");
 
        /* Already have an error? */
        if (closure->previous_error) {
@@ -251,10 +252,10 @@ on_io_ssh_read (GIOChannel *source,
        /* Figure out which buffer we're writing into */
        if (source == closure->iout) {
                str = closure->sout;
-               seahorse_debug ("SSHOP: SSH output: ");
+               g_debug ("SSHOP: SSH output: ");
        } else if(source == closure->ierr) {
                str = closure->serr;
-               seahorse_debug ("SSHOP: SSH errout: ");
+               g_debug ("SSHOP: SSH errout: ");
        } else
                g_assert_not_reached ();
 
@@ -275,7 +276,7 @@ on_io_ssh_read (GIOChannel *source,
                        break;
                default:
                        g_string_append_len (str, buf, read);
-                       seahorse_debug ("%s", str->str + (str->len - read));
+                       g_debug ("%s", str->str + (str->len - read));
                        break;
                }
        } while (read == sizeof (buf));
@@ -296,7 +297,7 @@ on_io_ssh_write (GIOChannel *source,
        gboolean ret = TRUE;
 
        if (closure->sin) {
-               seahorse_debug ("SSHOP: SSH ready for input");
+               g_debug ("SSHOP: SSH ready for input");
 
                if (!closure->previous_error)
                        error = &closure->previous_error;
@@ -311,20 +312,20 @@ on_io_ssh_write (GIOChannel *source,
                case G_IO_STATUS_AGAIN:
                        break;
                default:
-                       seahorse_debug ("SSHOP: Wrote %d bytes to SSH", (gint)written);
+                       g_debug ("SSHOP: Wrote %d bytes to SSH", (gint)written);
                        g_string_erase (closure->sin, 0, written);
                        break;
                }
        }
 
        if (closure->sin && !closure->sin->len) {
-               seahorse_debug ("SSHOP: Finished writing SSH input");
+               g_debug ("SSHOP: Finished writing SSH input");
                g_string_free (closure->sin, TRUE);
                closure->sin = NULL;
        }
 
        if (!closure->sin) {
-               seahorse_debug ("SSHOP: Closing SSH input channel");
+               g_debug ("SSHOP: Closing SSH input channel");
                g_io_channel_unref (closure->iin);
                closure->iin = NULL;
                g_source_remove (closure->win);
@@ -409,7 +410,7 @@ seahorse_ssh_operation_async (SeahorseSSHSource *source,
 
        g_simple_async_result_set_op_res_gpointer (res, closure, ssh_operation_free);
 
-       seahorse_debug ("SSHOP: Executing SSH command: %s", command);
+       g_debug ("SSHOP: Executing SSH command: %s", command);
 
        /* And off we go to run the program */
        r = g_spawn_async_with_pipes (NULL, argv, NULL,
@@ -428,7 +429,7 @@ seahorse_ssh_operation_async (SeahorseSSHSource *source,
        /* Copy the input for later writing */
        if (input) {
                 closure->sin = g_string_new_len (input, length < 0 ? (gssize) strlen (input) : length);
-               seahorse_debug ("SSHOP: Will send SSH input: %s", closure->sin->str);
+               g_debug ("SSHOP: Will send SSH input: %s", closure->sin->str);
 
                fcntl (fin, F_SETFL, O_NONBLOCK | fcntl (fin, F_GETFL));
                closure->iin = g_io_channel_unix_new (fin);
@@ -1055,7 +1056,7 @@ seahorse_ssh_op_rename_async (SeahorseSSHSource *source,
        if (!change_raw_comment (keydata, newcomment ? newcomment : ""))
                g_return_if_reached ();
 
-       seahorse_debug ("renaming key to: %s", newcomment);
+       g_debug ("renaming key to: %s", newcomment);
 
        /* Just part of a file for this key */
        if (keydata->partial) {
diff --git a/ssh/seahorse-ssh-source.c b/ssh/seahorse-ssh-source.c
index e8f6c2c..a4f342d 100644
--- a/ssh/seahorse-ssh-source.c
+++ b/ssh/seahorse-ssh-source.c
@@ -39,9 +39,6 @@
 #include <fcntl.h>
 #include <errno.h>
 
-#define DEBUG_FLAG SEAHORSE_DEBUG_LOAD
-#include "libseahorse/seahorse-debug.h"
-
 enum {
        PROP_0,
        PROP_LABEL,
@@ -123,7 +120,7 @@ static void
 cancel_scheduled_refresh (SeahorseSSHSource *ssrc)
 {
     if (ssrc->priv->scheduled_refresh != 0) {
-        seahorse_debug ("cancelling scheduled refresh event");
+        g_debug ("cancelling scheduled refresh event");
         g_source_remove (ssrc->priv->scheduled_refresh);
         ssrc->priv->scheduled_refresh = 0;
     }
@@ -145,7 +142,7 @@ remove_key_from_context (gpointer key,
 static gboolean
 scheduled_refresh (SeahorseSSHSource *ssrc)
 {
-    seahorse_debug ("scheduled refresh event ocurring now");
+    g_debug ("scheduled refresh event ocurring now");
     cancel_scheduled_refresh (ssrc);
     seahorse_place_load (SEAHORSE_PLACE (ssrc), NULL, NULL, NULL);
     return FALSE; /* don't run again */    
@@ -154,7 +151,7 @@ scheduled_refresh (SeahorseSSHSource *ssrc)
 static gboolean
 scheduled_dummy (SeahorseSSHSource *ssrc)
 {
-    seahorse_debug ("dummy refresh event occurring now");
+    g_debug ("dummy refresh event occurring now");
     ssrc->priv->scheduled_refresh = 0;
     return FALSE; /* don't run again */    
 }
@@ -197,7 +194,7 @@ monitor_ssh_homedir (GFileMonitor *handle, GFile *file, GFile *other_file,
        }
 
        g_free (path);
-       seahorse_debug ("scheduling refresh event due to file changes");
+       g_debug ("scheduling refresh event due to file changes");
        ssrc->priv->scheduled_refresh = g_timeout_add (500, (GSourceFunc)scheduled_refresh, ssrc);
 }
 
@@ -632,7 +629,7 @@ seahorse_ssh_source_load_async (SeahorsePlace *place,
        /* Schedule a dummy refresh. This blocks all monitoring for a while */
        cancel_scheduled_refresh (self);
        self->priv->scheduled_refresh = g_timeout_add (500, (GSourceFunc)scheduled_dummy, self);
-       seahorse_debug ("scheduled a dummy refresh");
+       g_debug ("scheduled a dummy refresh");
 
        /* List the .ssh directory for private keys */
        dir = g_dir_open (self->priv->ssh_homedir, 0, &error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]