Add G_DEBUG_FMT macro (bug 14401, bug 14403)

This commit is contained in:
rim
2018-05-26 23:27:03 +02:00
committed by Landry Breuil
parent c725dee6a9
commit 5be9587903
3 changed files with 15 additions and 18 deletions

View File

@@ -17,6 +17,7 @@
#include <libwnck/libwnck.h>
#include "app-manager.h"
#include "task-manager.h"
@@ -78,9 +79,7 @@ xtm_app_manager_init (XtmAppManager *manager)
apps_add_application (manager->apps, application);
}
#if DEBUG
g_debug ("Initial applications: %d", manager->apps->len);
#endif
G_DEBUG_FMT ("Initial applications: %d", manager->apps->len);
/* Connect signals */
g_signal_connect (screen, "application-opened", G_CALLBACK (application_opened), manager);
@@ -158,18 +157,14 @@ apps_lookup_pid (GArray *apps, gint pid)
static void
application_opened (WnckScreen *screen, WnckApplication *application, XtmAppManager *manager)
{
#if DEBUG
g_debug ("Application opened %p %d", application, wnck_application_get_pid (application));
#endif
G_DEBUG_FMT ("Application opened %p %d", application, wnck_application_get_pid (application));
apps_add_application (manager->apps, application);
}
static void
application_closed (WnckScreen *screen, WnckApplication *application, XtmAppManager *manager)
{
#if DEBUG
g_debug ("Application closed %p", application);
#endif
G_DEBUG_FMT ("Application closed %p", application);
apps_remove_application (manager->apps, application);
}

View File

@@ -543,9 +543,7 @@ treeview_clicked (XtmProcessTreeView *treeview, GdkEventButton *event)
gtk_tree_selection_select_path (selection, path);
gtk_tree_path_free (path);
#if DEBUG
g_debug ("Found iter with pid %d", pid);
#endif
G_DEBUG_FMT ("Found iter with pid %d", pid);
}
popup_menu (treeview, pid, event->time, TRUE);
@@ -601,9 +599,7 @@ column_clicked (GtkTreeViewColumn *column, XtmProcessTreeView *treeview)
GtkSortType sort_type;
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (treeview->model), &sort_column_id, &sort_type);
#if DEBUG
g_debug ("Last sort column %d; sort type: %d", sort_column_id, sort_type);
#endif
G_DEBUG_FMT ("Last sort column %d; sort type: %d", sort_column_id, sort_type);
if (treeview->sort_column != column)
{
@@ -617,9 +613,7 @@ column_clicked (GtkTreeViewColumn *column, XtmProcessTreeView *treeview)
sort_type = (sort_type == GTK_SORT_ASCENDING) ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING;
}
#if DEBUG
g_debug ("New sort column %d; sort type: %d", sort_column_id, sort_type);
#endif
G_DEBUG_FMT ("New sort column %d; sort type: %d", sort_column_id, sort_type);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (treeview->model), sort_column_id, sort_type);
gtk_tree_view_column_set_sort_order (column, sort_type);

View File

@@ -97,4 +97,12 @@ gchar * get_hostname (void);
gboolean send_signal_to_pid (guint pid, gint xtm_signal);
gboolean set_priority_to_pid (guint pid, gint priority);
#if DEBUG
# define G_DEBUG_FMT(fmt, args...) g_debug((fmt), ##args)
#else
# define G_DEBUG_FMT(fmt, args...)
#endif
#endif /* !TASK_MANAGER_H */