[Xfce4-commits] <xfce4-panel:master> Add debug info about created items.

Nick Schermer noreply at xfce.org
Tue Jan 4 22:10:07 CET 2011


Updating branch refs/heads/master
         to 43a9ee405dd4c5a0abcdb0d18400b8bc65fbb390 (commit)
       from 1d17c4d20ae31426787621746008dce9179ea6f6 (commit)

commit 43a9ee405dd4c5a0abcdb0d18400b8bc65fbb390
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jan 4 22:07:53 2011 +0100

    Add debug info about created items.

 common/panel-debug.c |    3 ++-
 common/panel-debug.h |    3 ++-
 panel/panel-module.c |   13 ++++++++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/common/panel-debug.c b/common/panel-debug.c
index f626ddc..a78922b 100644
--- a/common/panel-debug.c
+++ b/common/panel-debug.c
@@ -49,7 +49,8 @@ static const GDebugKey panel_debug_keys[] =
   { "applicationsmenu", PANEL_DEBUG_APPLICATIONSMENU },
   { "systray", PANEL_DEBUG_SYSTRAY },
   { "gdb", PANEL_DEBUG_GDB },
-  { "valgrind", PANEL_DEBUG_VALGRIND }
+  { "valgrind", PANEL_DEBUG_VALGRIND },
+  { "module", PANEL_DEBUG_MODULE }
 };
 
 
diff --git a/common/panel-debug.h b/common/panel-debug.h
index 1c56f61..5c55cf1 100644
--- a/common/panel-debug.h
+++ b/common/panel-debug.h
@@ -36,7 +36,8 @@ typedef enum
   PANEL_DEBUG_APPLICATIONSMENU = 1 << 10,
   PANEL_DEBUG_GDB              = 1 << 11, /* run plugin in gdb */
   PANEL_DEBUG_VALGRIND         = 1 << 12, /* run plugin in valgrind */
-  PANEL_DEBUG_SYSTRAY          = 1 << 13
+  PANEL_DEBUG_SYSTRAY          = 1 << 13,
+  PANEL_DEBUG_MODULE           = 1 << 14
 }
 PanelDebugFlag;
 
diff --git a/panel/panel-module.c b/panel/panel-module.c
index 451d09e..f9e0e74 100644
--- a/panel/panel-module.c
+++ b/panel/panel-module.c
@@ -26,6 +26,7 @@
 #include <libxfce4util/libxfce4util.h>
 
 #include <common/panel-private.h>
+#include <common/panel-debug.h>
 #include <libxfce4panel/libxfce4panel.h>
 #include <libxfce4panel/xfce-panel-plugin-provider.h>
 
@@ -423,7 +424,8 @@ panel_module_new_plugin (PanelModule  *module,
                          gint          unique_id,
                          gchar       **arguments)
 {
-  GtkWidget *plugin = NULL;
+  GtkWidget   *plugin = NULL;
+  const gchar *debug_type = NULL;
 
   panel_return_val_if_fail (PANEL_IS_MODULE (module), NULL);
   panel_return_val_if_fail (G_IS_TYPE_MODULE (module), NULL);
@@ -450,6 +452,8 @@ panel_module_new_plugin (PanelModule  *module,
                                      "comment", module->comment,
                                      "arguments", arguments,
                                      NULL);
+
+              debug_type = "object-type";
             }
           else if (module->construct_func != NULL)
             {
@@ -460,6 +464,8 @@ panel_module_new_plugin (PanelModule  *module,
                                                   module->comment,
                                                   arguments,
                                                   screen);
+
+              debug_type = "construct-func";
             }
 
           if (G_LIKELY (plugin != NULL))
@@ -473,10 +479,12 @@ panel_module_new_plugin (PanelModule  *module,
 
     case WRAPPER:
       plugin = panel_plugin_external_wrapper_new (module, unique_id, arguments);
+      debug_type = "external-wrapper";
       break;
 
     case EXTERNAL_46:
       plugin = panel_plugin_external_46_new (module, unique_id, arguments);
+      debug_type = "external-46";
       break;
 
     default:
@@ -489,6 +497,9 @@ panel_module_new_plugin (PanelModule  *module,
       /* increase count */
       module->use_count++;
 
+      panel_debug (PANEL_DEBUG_MODULE, "new item (type=%s, name=%s, id=%d)",
+          debug_type, panel_module_get_name (module), unique_id);
+
       /* handle module use count and unloading */
       g_object_weak_ref (G_OBJECT (plugin),
           panel_module_plugin_destroyed, module);



More information about the Xfce4-commits mailing list