[Xfce4-commits] [xfce/xfdesktop] 01/01: --enable-debug option added to xfdesktop-settings

noreply at xfce.org noreply at xfce.org
Mon Sep 8 18:26:50 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit c3b288864a634c75e3de7a65fcbf22913bdd16c9
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Mon Sep 8 19:22:11 2014 +0300

    --enable-debug option added to xfdesktop-settings
---
 common/xfdesktop-common.c           |    2 +-
 common/xfdesktop-thumbnailer.c      |   14 +++++++-------
 settings/main.c                     |   29 +++++++++++++++++------------
 src/xfce-desktop.c                  |    8 ++++----
 src/xfdesktop-file-icon-manager.c   |    6 +++---
 src/xfdesktop-regular-file-icon.c   |    4 ++--
 src/xfdesktop-special-file-icon.c   |   14 +++++++-------
 src/xfdesktop-volume-icon.c         |   10 +++++-----
 src/xfdesktop-window-icon-manager.c |   11 ++++++-----
 9 files changed, 52 insertions(+), 46 deletions(-)

diff --git a/common/xfdesktop-common.c b/common/xfdesktop-common.c
index 767ad50..5d2c255 100644
--- a/common/xfdesktop-common.c
+++ b/common/xfdesktop-common.c
@@ -63,7 +63,7 @@ xfdesktop_compare_paths(GFile *a, GFile *b)
     path_a = g_file_get_path(a);
     path_b = g_file_get_path(b);
 
-    DBG("a %s, b %s", path_a, path_b);
+    XF_DEBUG("a %s, b %s", path_a, path_b);
 
     ret = g_strcmp0(path_a, path_b);
 
diff --git a/common/xfdesktop-thumbnailer.c b/common/xfdesktop-thumbnailer.c
index 9ef8036..494884d 100644
--- a/common/xfdesktop-thumbnailer.c
+++ b/common/xfdesktop-thumbnailer.c
@@ -330,8 +330,8 @@ xfdesktop_thumbnailer_queue_thumbnail(XfdesktopThumbnailer *thumbnailer,
             {
                 /* If this fails it usually means there's a thumbnail already
                  * being processed, no big deal */
-                DBG("Dequeue of thumbnailer->priv->handle: %d failed",
-                    thumbnailer->priv->handle);
+                XF_DEBUG("Dequeue of thumbnailer->priv->handle: %d failed",
+                         thumbnailer->priv->handle);
             }
 
             thumbnailer->priv->handle = 0;
@@ -387,8 +387,8 @@ xfdesktop_thumbnailer_dequeue_thumbnail(XfdesktopThumbnailer *thumbnailer,
             {
                 /* If this fails it usually means there's a thumbnail already
                  * being processed, no big deal */
-                DBG("Dequeue of thumbnailer->priv->handle: %d failed",
-                    thumbnailer->priv->handle);
+                XF_DEBUG("Dequeue of thumbnailer->priv->handle: %d failed",
+                         thumbnailer->priv->handle);
             }
         }
         thumbnailer->priv->handle = 0;
@@ -561,9 +561,9 @@ xfdesktop_thumbnailer_thumbnail_ready_dbus(DBusGProxy *proxy,
                                                   filename, NULL);
             }
 
-            DBG("thumbnail-ready src: %s thumbnail: %s",
-                (char*)iter->data,
-                thumbnail_location);
+            XF_DEBUG("thumbnail-ready src: %s thumbnail: %s",
+                     (char*)iter->data,
+                     thumbnail_location);
 
             if(g_file_test(thumbnail_location, G_FILE_TEST_EXISTS)) {
                 g_signal_emit(G_OBJECT(thumbnailer),
diff --git a/settings/main.c b/settings/main.c
index 6312be1..0a28913 100644
--- a/settings/main.c
+++ b/settings/main.c
@@ -786,7 +786,7 @@ xfdesktop_settings_generate_per_workspace_binding_string(AppearancePanel *panel,
                               property);
     }
 
-    DBG("name %s", buf);
+    XF_DEBUG("name %s", buf);
 
     return buf;
 }
@@ -800,7 +800,7 @@ xfdesktop_settings_generate_old_binding_string(AppearancePanel *panel,
     buf = g_strdup_printf("/backdrop/screen%d/monitor%d/%s",
                           panel->screen, panel->monitor, property);
 
-    DBG("name %s", buf);
+    XF_DEBUG("name %s", buf);
 
     return buf;
 }
@@ -870,18 +870,18 @@ cb_image_selection_changed(GtkIconView *icon_view,
     /* check to see if the selection actually did change */
     if(g_strcmp0(current_filename, filename) != 0) {
         if(panel->monitor_name == NULL) {
-            DBG("got %s, applying to screen %d monitor %d workspace %d", filename,
-                panel->screen, panel->monitor, panel->workspace);
+            XF_DEBUG("got %s, applying to screen %d monitor %d workspace %d", filename,
+                     panel->screen, panel->monitor, panel->workspace);
         } else {
-            DBG("got %s, applying to screen %d monitor %s workspace %d", filename,
-                panel->screen, panel->monitor_name, panel->workspace);
+            XF_DEBUG("got %s, applying to screen %d monitor %s workspace %d", filename,
+                     panel->screen, panel->monitor_name, panel->workspace);
         }
 
         /* Get the property location to save our changes, always save to new
          * location */
         buf = xfdesktop_settings_generate_per_workspace_binding_string(panel,
                                                                        "last-image");
-        DBG("Saving to %s/%s", buf, filename);
+        XF_DEBUG("Saving to %s/%s", buf, filename);
         xfconf_channel_set_string(panel->channel, buf, filename);
     }
 
@@ -1118,7 +1118,7 @@ cb_folder_selection_changed(GtkWidget *button,
          * button to something then it can't be changed with a set folder
          * call anymore. */
         if(g_strcmp0(filename, dirname) == 0) {
-            DBG("folder didn't change");
+            XF_DEBUG("folder didn't change");
             g_free(dirname);
             g_free(filename);
             g_free(previous_filename);
@@ -1231,7 +1231,7 @@ xfdesktop_settings_update_iconview_folder(AppearancePanel *panel)
     current_folder = xfdesktop_settings_get_backdrop_image(panel);
     dirname = g_path_get_dirname(current_folder);
 
-    DBG("current_folder %s, dirname %s", current_folder, dirname);
+    XF_DEBUG("current_folder %s, dirname %s", current_folder, dirname);
 
     gtk_file_chooser_set_current_folder((GtkFileChooser*)panel->btn_folder, dirname);
 
@@ -1497,7 +1497,7 @@ cb_update_background_tab(WnckWindow *wnck_window,
 
     /* remove the old bindings if there are any */
     if(panel->color1_btn_id || panel->color2_btn_id) {
-        DBG("removing old bindings");
+        XF_DEBUG("removing old bindings");
         xfdesktop_settings_background_tab_change_bindings(panel,
                                                           TRUE);
     }
@@ -1552,7 +1552,7 @@ cb_workspace_changed(WnckScreen *screen,
     if(new_num != -1)
         panel->active_workspace = new_num;
 
-    DBG("active_workspace now %d", panel->active_workspace);
+    XF_DEBUG("active_workspace now %d", panel->active_workspace);
 
     /* Call cb_update_background_tab in case this is a pinned window */
     if(panel->wnck_window != NULL)
@@ -1591,7 +1591,7 @@ cb_window_opened(WnckScreen *screen,
     if(wnck_window_get_xid(window) != GDK_WINDOW_XID(gtk_widget_get_window(toplevel)))
         return;
 
-    DBG("Found our window");
+    XF_DEBUG("Found our window");
     panel->wnck_window = window;
 
     /* These callbacks are for updating the image_iconview when the window
@@ -2009,9 +2009,11 @@ xfdesktop_settings_response(GtkWidget *dialog, gint response_id, gpointer user_d
 
 static GdkNativeWindow opt_socket_id = 0;
 static gboolean opt_version = FALSE;
+static gboolean opt_enable_debug = FALSE;
 static GOptionEntry option_entries[] = {
     { "socket-id", 's', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_INT, &opt_socket_id, N_("Settings manager socket"), N_("SOCKET ID") },
     { "version", 'V', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &opt_version, N_("Version information"), NULL },
+    { "enable-debug", 'e', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_NONE, &opt_enable_debug, N_("Enable debug messages"), NULL },
     { NULL, },
 };
 
@@ -2082,6 +2084,9 @@ main(int argc, char **argv)
 
     channel = xfconf_channel_new(XFDESKTOP_CHANNEL);
 
+    if(opt_enable_debug)
+        xfdesktop_debug_set(TRUE);
+
     if(opt_socket_id == 0) {
         GtkWidget *dialog;
         dialog = GTK_WIDGET(gtk_builder_get_object(gxml, "prefs_dialog"));
diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c
index 8e77440..0e10d7a 100644
--- a/src/xfce-desktop.c
+++ b/src/xfce-desktop.c
@@ -201,7 +201,7 @@ xfce_desktop_ensure_system_font_size(XfceDesktop *desktop)
     desktop->priv->system_font_size = pango_font_description_get_size(pfd);
     /* FIXME: this seems backwards from the documentation */
     if(!pango_font_description_get_size_is_absolute(pfd)) {
-        DBG("dividing by PANGO_SCALE");
+        XF_DEBUG("dividing by PANGO_SCALE");
         desktop->priv->system_font_size /= PANGO_SCALE;
     }
     XF_DEBUG("system font size is %.05f", desktop->priv->system_font_size);
@@ -333,7 +333,7 @@ create_bg_pixmap(GdkScreen *gscreen, gpointer user_data)
     /* If the workspaces haven't been created yet there's no need to do the
      * background pixmap */
     if(desktop->priv->workspaces == NULL) {
-        DBG("exiting, desktop->priv->workspaces == NULL");
+        XF_DEBUG("exiting, desktop->priv->workspaces == NULL");
         return NULL;
     }
 
@@ -1598,7 +1598,7 @@ xfce_desktop_set_single_workspace_mode(XfceDesktop *desktop,
 
     desktop->priv->single_workspace_mode = single_workspace;
 
-    DBG("single_workspace_mode now %s", single_workspace ? "TRUE" : "FALSE");
+    XF_DEBUG("single_workspace_mode now %s", single_workspace ? "TRUE" : "FALSE");
 
 
     /* If the desktop has been realized then fake a screen size change to
@@ -1616,7 +1616,7 @@ xfce_desktop_set_single_workspace_number(XfceDesktop *desktop,
     if(workspace_num == desktop->priv->single_workspace_num)
         return;
 
-    DBG("single_workspace_num now %d", workspace_num);
+    XF_DEBUG("single_workspace_num now %d", workspace_num);
 
     desktop->priv->single_workspace_num = workspace_num;
 
diff --git a/src/xfdesktop-file-icon-manager.c b/src/xfdesktop-file-icon-manager.c
index 4a2215b..3d02d51 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -1963,7 +1963,7 @@ _icon_notify_destroy(gpointer data,
     g_assert(g_list_find(_alive_icon_list, obj));
     _alive_icon_list = g_list_remove(_alive_icon_list, obj);
     
-    DBG("icon finalized: '%s'", xfdesktop_icon_peek_label(XFDESKTOP_ICON(obj)));
+    XF_DEBUG("icon finalized: '%s'", xfdesktop_icon_peek_label(XFDESKTOP_ICON(obj)));
 }
 #endif
 
@@ -2652,7 +2652,7 @@ xfdesktop_file_icon_manager_metadata_changed(GFileMonitor     *monitor,
 
     switch(event) {
         case G_FILE_MONITOR_EVENT_CHANGED:
-            DBG("metadata file changed event");
+            XF_DEBUG("metadata file changed event");
 
             /* cool down timer so we don't call this due to multiple file
              * changes at the same time. */
@@ -2741,7 +2741,7 @@ xfdesktop_file_icon_manager_files_ready(GFileEnumerator *enumerator,
             const gchar *name = g_file_info_get_name(l->data);
             GFile *file = g_file_get_child(fmanager->priv->folder, name);
 
-            DBG("got a GFileInfo: %s", g_file_info_get_display_name(l->data));
+            XF_DEBUG("got a GFileInfo: %s", g_file_info_get_display_name(l->data));
 
             xfdesktop_file_icon_manager_add_regular_icon(fmanager,
                                                          file, l->data,
diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c
index 503a7c2..497c3ff 100644
--- a/src/xfdesktop-regular-file-icon.c
+++ b/src/xfdesktop-regular-file-icon.c
@@ -263,7 +263,7 @@ cb_show_thumbnails_notify(GObject *gobject,
     g_object_get(regular_file_icon->priv->fmanager, "show-thumbnails", &show_thumbnails, NULL);
 
     if(regular_file_icon->priv->show_thumbnails != show_thumbnails) {
-        DBG("show-thumbnails changed! now: %s", show_thumbnails ? "TRUE" : "FALSE");
+        XF_DEBUG("show-thumbnails changed! now: %s", show_thumbnails ? "TRUE" : "FALSE");
         regular_file_icon->priv->show_thumbnails = show_thumbnails;
         xfdesktop_file_icon_invalidate_icon(XFDESKTOP_FILE_ICON(regular_file_icon));
         xfdesktop_icon_invalidate_pixbuf(XFDESKTOP_ICON(regular_file_icon));
@@ -638,7 +638,7 @@ xfdesktop_regular_file_icon_do_drop_dest(XfdesktopIcon *icon,
     GFile *src_file;
     gboolean result = FALSE;
     
-    DBG("entering");
+    TRACE("entering");
     
     g_return_val_if_fail(regular_file_icon && src_file_icon, FALSE);
     g_return_val_if_fail(xfdesktop_regular_file_icon_get_allowed_drop_actions(icon, NULL) != 0,
diff --git a/src/xfdesktop-special-file-icon.c b/src/xfdesktop-special-file-icon.c
index 0cf7d37..6578f7f 100644
--- a/src/xfdesktop-special-file-icon.c
+++ b/src/xfdesktop-special-file-icon.c
@@ -355,14 +355,14 @@ xfdesktop_special_file_icon_get_allowed_drop_actions(XfdesktopIcon *icon,
             if(g_file_info_get_attribute_boolean(info,
                                                  G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
             {
-                DBG("can move, copy and link");
+                XF_DEBUG("can move, copy and link");
                 actions = GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK;
                 if(suggested_action)
                     *suggested_action = GDK_ACTION_MOVE;
             }
         }
     } else {
-        DBG("can move");
+        XF_DEBUG("can move");
         actions = GDK_ACTION_MOVE; /* everything else is just silly */
         if(suggested_action)
             *suggested_action = GDK_ACTION_MOVE;
@@ -386,7 +386,7 @@ xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
     GFile *dest_file = NULL;
     gboolean result = FALSE;
     
-    DBG("entering");
+    TRACE("entering");
     
     g_return_val_if_fail(special_file_icon && src_file_icon, FALSE);
     g_return_val_if_fail(xfdesktop_special_file_icon_get_allowed_drop_actions(icon, NULL),
@@ -401,7 +401,7 @@ xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
     if(special_file_icon->priv->type == XFDESKTOP_SPECIAL_FILE_ICON_TRASH) {
         GList files;
 
-        DBG("doing trash");
+        XF_DEBUG("doing trash");
 
         /* fake a file list */
         files.data = src_file;
@@ -416,15 +416,15 @@ xfdesktop_special_file_icon_do_drop_dest(XfdesktopIcon *icon,
     
         switch(action) {
             case GDK_ACTION_MOVE:
-                DBG("doing move");
+                XF_DEBUG("doing move");
                 dest_file = g_object_ref(special_file_icon->priv->file);
                 break;
             case GDK_ACTION_COPY:
-                DBG("doing copy");
+                XF_DEBUG("doing copy");
                 dest_file = g_file_get_child(special_file_icon->priv->file, name);
                 break;
             case GDK_ACTION_LINK:
-                DBG("doing link");
+                XF_DEBUG("doing link");
                 dest_file = g_object_ref(special_file_icon->priv->file);
                 break;
             default:
diff --git a/src/xfdesktop-volume-icon.c b/src/xfdesktop-volume-icon.c
index 11d9d1e..00631f2 100644
--- a/src/xfdesktop-volume-icon.c
+++ b/src/xfdesktop-volume-icon.c
@@ -398,7 +398,7 @@ xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
     gboolean result = FALSE;
     gchar *name;
     
-    DBG("entering");
+    TRACE("entering");
     
     g_return_val_if_fail(volume_icon && src_file_icon, FALSE);
     g_return_val_if_fail(xfdesktop_volume_icon_get_allowed_drop_actions(icon, NULL),
@@ -424,17 +424,17 @@ xfdesktop_volume_icon_do_drop_dest(XfdesktopIcon *icon,
     
     switch(action) {
         case GDK_ACTION_MOVE:
-            DBG("doing move");
+            XF_DEBUG("doing move");
             dest_file = g_object_ref(volume_icon->priv->file);
             break;
         
         case GDK_ACTION_COPY:
-            DBG("doing copy");
+            XF_DEBUG("doing copy");
             dest_file = g_file_get_child(volume_icon->priv->file, name);
             break;
         
         case GDK_ACTION_LINK:
-            DBG("doing link");
+            XF_DEBUG("doing link");
             dest_file = g_object_ref(volume_icon->priv->file);
             break;
         
@@ -895,7 +895,7 @@ xfdesktop_volume_icon_update_file_info(XfdesktopFileIcon *icon,
 
     g_return_if_fail(XFDESKTOP_IS_VOLUME_ICON(icon));
 
-    DBG("entering");
+    TRACE("entering");
 
     /* just replace the file info here */
     if(volume_icon->priv->file_info)
diff --git a/src/xfdesktop-window-icon-manager.c b/src/xfdesktop-window-icon-manager.c
index 680ee62..f1c4ea9 100644
--- a/src/xfdesktop-window-icon-manager.c
+++ b/src/xfdesktop-window-icon-manager.c
@@ -39,6 +39,7 @@
 #include "xfdesktop-window-icon.h"
 #include "xfdesktop-window-icon-manager.h"
 #include "xfce-desktop.h"
+#include "xfdesktop-common.h"
 
 static void xfdesktop_window_icon_manager_set_property(GObject *object,
                                                        guint property_id,
@@ -229,7 +230,7 @@ workspace_changed_cb(WnckScreen *wnck_screen,
 
     ws = wnck_screen_get_active_workspace(wmanager->priv->wnck_screen);
     if(!WNCK_IS_WORKSPACE(ws)) {
-        DBG("got weird failure of wnck_screen_get_active_workspace(), bailing");
+        XF_DEBUG("got weird failure of wnck_screen_get_active_workspace(), bailing");
         return;
     }
     
@@ -343,7 +344,7 @@ window_state_changed_cb(WnckWindow *window,
         return;
     }
     
-    DBG("changed_mask indicates an action");
+    XF_DEBUG("changed_mask indicates an action");
     
     ws = wnck_window_get_workspace(window);
     if(ws)
@@ -357,7 +358,7 @@ window_state_changed_cb(WnckWindow *window,
         is_add = TRUE;
     }
     
-    DBG("is_add == %s", is_add?"TRUE":"FALSE");
+    XF_DEBUG("is_add == %s", is_add?"TRUE":"FALSE");
     
     /* this is a cute way of handling adding/removing from *all* workspaces
      * when we're dealing with a sticky windows, and just adding/removing
@@ -382,7 +383,7 @@ window_state_changed_cb(WnckWindow *window,
                 continue;
             }
             
-            DBG("adding to WS %d", i);
+            XF_DEBUG("adding to WS %d", i);
             xfdesktop_window_icon_manager_add_icon(wmanager, window, i);
         }
     } else {
@@ -397,7 +398,7 @@ window_state_changed_cb(WnckWindow *window,
                 if(wmanager->priv->icon_workspaces[i]->selected_icon == icon)
                     wmanager->priv->icon_workspaces[i]->selected_icon = NULL;
                 if(i == wmanager->priv->active_ws_num) {
-                    DBG("removing from WS %d", i);
+                    XF_DEBUG("removing from WS %d", i);
                     xfdesktop_icon_view_remove_item(wmanager->priv->icon_view,
                                                     XFDESKTOP_ICON(icon));
                     g_hash_table_remove(wmanager->priv->icon_workspaces[i]->icons,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list