[Xfce4-commits] [apps/xfdashboard] 02/02: Where possible replace NULL in XFDASHBOARD_DEBUG() macro with singleton object

noreply at xfce.org noreply at xfce.org
Tue Mar 28 07:33:42 CEST 2017


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

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit d6c48d5ad00c265ff81a2bb26c5a035b76ee4af9
Author: Stephan Haller <nomad at froevel.de>
Date:   Tue Mar 28 07:32:50 2017 +0200

    Where possible replace NULL in XFDASHBOARD_DEBUG() macro with singleton object
---
 libxfdashboard/application-tracker.c |  4 ++--
 libxfdashboard/bindings-pool.c       |  4 ++--
 libxfdashboard/desktop-app-info.c    |  9 +++++----
 libxfdashboard/window-tracker.c      | 14 +++++++-------
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/libxfdashboard/application-tracker.c b/libxfdashboard/application-tracker.c
index db20192..7e23e8a 100644
--- a/libxfdashboard/application-tracker.c
+++ b/libxfdashboard/application-tracker.c
@@ -297,7 +297,7 @@ static GHashTable* _xfdashboard_application_tracker_get_environment_from_pid(gin
 	procEnvFile=g_strdup_printf("/proc/%d/environ", inPID);
 	if(!g_file_get_contents(procEnvFile, &envContent, &envLength, &error))
 	{
-		XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
+		XFDASHBOARD_DEBUG(_xfdashboard_application_tracker, APPLICATIONS,
 							"Could not read enviroment varibles for PID %d at %s: %s",
 							inPID,
 							procEnvFile,
@@ -313,7 +313,7 @@ static GHashTable* _xfdashboard_application_tracker_get_environment_from_pid(gin
 		return(NULL);
 	}
 
-	XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
+	XFDASHBOARD_DEBUG(_xfdashboard_application_tracker, APPLICATIONS,
 						"Enviroment set for PID %d at %s is %lu bytes long",
 						inPID,
 						procEnvFile,
diff --git a/libxfdashboard/bindings-pool.c b/libxfdashboard/bindings-pool.c
index a40018f..14bcb02 100644
--- a/libxfdashboard/bindings-pool.c
+++ b/libxfdashboard/bindings-pool.c
@@ -195,7 +195,7 @@ static gboolean _xfdashboard_bindings_pool_parse_keycode(const gchar *inText,
 	key=0;
 	modifiers=0;
 
-	XFDASHBOARD_DEBUG(NULL, MISC,
+	XFDASHBOARD_DEBUG(_xfdashboard_bindings_pool, MISC,
 						"Trying to translating key-binding '%s' to keycode and modifiers",
 						inText);
 
@@ -315,7 +315,7 @@ static gboolean _xfdashboard_bindings_pool_parse_keycode(const gchar *inText,
 	if(outKey) *outKey=key;
 	if(outModifiers) *outModifiers=modifiers;
 
-	XFDASHBOARD_DEBUG(NULL, MISC,
+	XFDASHBOARD_DEBUG(_xfdashboard_bindings_pool, MISC,
 						"Translated key-binding '%s' to keycode %04x and modifiers %04x",
 						inText,
 						key,
diff --git a/libxfdashboard/desktop-app-info.c b/libxfdashboard/desktop-app-info.c
index 57fc1e6..6af9aa6 100644
--- a/libxfdashboard/desktop-app-info.c
+++ b/libxfdashboard/desktop-app-info.c
@@ -1278,10 +1278,6 @@ GAppInfo* xfdashboard_desktop_app_info_new_from_desktop_id(const gchar *inDeskto
 		g_warning(_("Desktop ID '%s' not found"), inDesktopID);
 		return(NULL);
 	}
-	XFDASHBOARD_DEBUG(NULL, APPLICATIONS,
-						"Found desktop file '%s' for desktop ID '%s'",
-						desktopFilename,
-						inDesktopID);
 
 	/* Create this class instance for desktop file found */
 	file=g_file_new_for_path(desktopFilename);
@@ -1289,6 +1285,11 @@ GAppInfo* xfdashboard_desktop_app_info_new_from_desktop_id(const gchar *inDeskto
 														"desktop-id", inDesktopID,
 														"file", file,
 														NULL));
+	XFDASHBOARD_DEBUG(instance, APPLICATIONS,
+						"Created %s desktop file '%s' for desktop ID '%s'",
+						G_OBJECT_TYPE_NAME(instance),
+						desktopFilename,
+						inDesktopID);
 	if(file) g_object_unref(file);
 
 	/* Release allocated resources */
diff --git a/libxfdashboard/window-tracker.c b/libxfdashboard/window-tracker.c
index 180dcbb..1504368 100644
--- a/libxfdashboard/window-tracker.c
+++ b/libxfdashboard/window-tracker.c
@@ -1360,23 +1360,23 @@ guint32 xfdashboard_window_tracker_get_time(void)
 	if(timestamp>0) return(timestamp);
 
 	/* Next we try to retrieve timestamp of last X11 event in clutter */
-	XFDASHBOARD_DEBUG(NULL, WINDOWS, "No timestamp for windows - trying timestamp of last X11 event in Clutter");
+	XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS, "No timestamp for windows - trying timestamp of last X11 event in Clutter");
 	timestamp=(guint32)clutter_x11_get_current_event_time();
 	if(timestamp!=0)
 	{
-		XFDASHBOARD_DEBUG(NULL, WINDOWS,
+		XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS,
 							"Got timestamp %u of last X11 event in Clutter",
 							timestamp);
 		return(timestamp);
 	}
 
 	/* Last resort is to get X11 server time via stage windows */
-	XFDASHBOARD_DEBUG(NULL, WINDOWS, "No timestamp for windows - trying last resort via stage windows");
+	XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS, "No timestamp for windows - trying last resort via stage windows");
 
 	display=gdk_display_get_default();
 	if(!display)
 	{
-		XFDASHBOARD_DEBUG(NULL, WINDOWS, "No default display found in GDK to get timestamp for windows");
+		XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS, "No default display found in GDK to get timestamp for windows");
 		return(0);
 	}
 
@@ -1393,7 +1393,7 @@ guint32 xfdashboard_window_tracker_get_time(void)
 			window=gdk_x11_window_lookup_for_display(display, clutter_x11_get_stage_window(stage));
 			if(!window)
 			{
-				XFDASHBOARD_DEBUG(NULL, WINDOWS,
+				XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS,
 									"No GDK window found for stage %p to get timestamp for windows",
 									stage);
 				continue;
@@ -1405,7 +1405,7 @@ guint32 xfdashboard_window_tracker_get_time(void)
 			eventMask=gdk_window_get_events(window);
 			if(!(eventMask & GDK_PROPERTY_CHANGE_MASK))
 			{
-				XFDASHBOARD_DEBUG(NULL, WINDOWS,
+				XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS,
 									"GDK window %p for stage %p does not support GDK_PROPERTY_CHANGE_MASK to get timestamp for windows",
 									window,
 									stage);
@@ -1418,7 +1418,7 @@ guint32 xfdashboard_window_tracker_get_time(void)
 	g_slist_free(stages);
 
 	/* Return timestamp of last resort */
-	XFDASHBOARD_DEBUG(NULL, WINDOWS,
+	XFDASHBOARD_DEBUG(_xfdashboard_window_tracker_singleton, WINDOWS,
 						"Last resort timestamp for windows %s (%u)",
 						timestamp ? "found" : "not found",
 						timestamp);

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


More information about the Xfce4-commits mailing list