[Xfce4-commits] [apps/xfdashboard] 01/01: Do not return with failure result if file monitor for a path could not be created with an error. That means that only failures on file monitor creations *with* a GError will return failure result.

noreply at xfce.org noreply at xfce.org
Wed Nov 25 21:35:13 CET 2015


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

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

commit 62db87af0df4e7504d48b190c0a8a7bc5814f9bc
Author: Stephan Haller <nomad at froevel.de>
Date:   Wed Nov 25 21:33:11 2015 +0100

    Do not return with failure result if file monitor for a path could not be created with an error. That means that only failures on file monitor creations *with* a GError will return failure result.
    
    This is a try for a workaround for FreeBSD with "broken" Glib.
---
 xfdashboard/application-database.c |   20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/xfdashboard/application-database.c b/xfdashboard/application-database.c
index 2e8caa4..4411600 100644
--- a/xfdashboard/application-database.c
+++ b/xfdashboard/application-database.c
@@ -904,8 +904,7 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 	monitorData=_xfdashboard_application_database_monitor_data_new(inCurrentPath);
 	if(!monitorData)
 	{
-		g_debug("Failed to create data object for file monitor for path '%s'",
-				path);
+		g_debug("Failed to create data object for file monitor for path '%s'", path);
 
 		/* Set error */
 		g_set_error(outError,
@@ -923,10 +922,9 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 	}
 
 	monitorData->monitor=g_file_monitor(inCurrentPath, G_FILE_MONITOR_NONE, NULL, &error);
-	if(!monitorData->monitor)
+	if(!monitorData->monitor && error)
 	{
-		g_debug("Failed to initialize file monitor for path '%s'",
-				path);
+		g_debug("Failed to initialize file monitor for path '%s'", path);
 
 		/* Propagate error */
 		g_propagate_error(outError, error);
@@ -940,7 +938,17 @@ static gboolean _xfdashboard_application_database_load_applications_recursive(Xf
 		return(FALSE);
 	}
 
-	*ioFileMonitors=g_list_prepend(*ioFileMonitors, monitorData);
+	if(monitorData->monitor)
+	{
+		*ioFileMonitors=g_list_prepend(*ioFileMonitors, monitorData);
+
+		g_debug("Added file monitor for path '%s'", path);
+	}
+		else
+		{
+			g_warning(_("Could not create file monitor for path '%s' so no changes will be detected"),
+						path);
+		}
 
 	g_debug("Finished scanning directory '%s' for search path '%s'",
 				path,

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


More information about the Xfce4-commits mailing list