[Xfce4-commits] [apps/xfdashboard] 01/01: Silence critical warnings when requsting a desktop file for a non-desktop ID but add debug messages.

noreply at xfce.org noreply at xfce.org
Mon Feb 10 09:53:30 CET 2020


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

n   o   m   a   d       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfdashboard.

commit ee2c3b3bfadfa6bbd328ecee4aced1ad49446df4
Author: Stephan Haller <nomad at froevel.de>
Date:   Mon Feb 10 09:51:27 2020 +0100

    Silence critical warnings when requsting a desktop file for a non-desktop ID but add debug messages.
---
 libxfdashboard/application-database.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libxfdashboard/application-database.c b/libxfdashboard/application-database.c
index 077cf75..fc7d6e7 100644
--- a/libxfdashboard/application-database.c
+++ b/libxfdashboard/application-database.c
@@ -1600,7 +1600,7 @@ GAppInfo* xfdashboard_application_database_lookup_desktop_id(XfdashboardApplicat
 }
 
 /* Get path to desktop file for requested desktop ID.
- * Returns NULL if no desktop file at any search path can be found.
+ * Returns NULL if no desktop file is invalid or was not found at any search path.
  */
 gchar* xfdashboard_application_database_get_file_from_desktop_id(const gchar *inDesktopID)
 {
@@ -1609,7 +1609,15 @@ gchar* xfdashboard_application_database_get_file_from_desktop_id(const gchar *in
 	gchar							*foundDesktopFile;
 
 	g_return_val_if_fail(inDesktopID && *inDesktopID, NULL);
-	g_return_val_if_fail(g_str_has_suffix(inDesktopID, ".desktop"), NULL);
+
+	/* Requested desktop ID must have ".desktop" suffix */
+	if(!g_str_has_suffix(inDesktopID, ".desktop"))
+	{
+		XFDASHBOARD_DEBUG(self, APPLICATIONS,
+							"Skipping non-desktop file '%s'",
+							inDesktopID);
+		return(NULL);
+	}
 
 	/* Find the desktop file for a desktop ID isn't as easy as it sounds.
 	 * Especially if the desktop file contains at least one dash. The dash

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


More information about the Xfce4-commits mailing list