[Xfce4-commits] [apps/xfdashboard] 04/05: On reload of a desktop entry (XfdashboardDesktopAppInfo) also update path to binary executable file of the application
noreply at xfce.org
noreply at xfce.org
Fri Oct 20 12:43:03 CEST 2017
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 2784f55276608deadbdcb9145bebcabaf13a50f5
Author: Stephan Haller <nomad at froevel.de>
Date: Fri Oct 20 09:37:22 2017 +0200
On reload of a desktop entry (XfdashboardDesktopAppInfo) also update path to binary executable file of the application
---
libxfdashboard/desktop-app-info.c | 68 ++++++++++++++++++++++++---------------
1 file changed, 42 insertions(+), 26 deletions(-)
diff --git a/libxfdashboard/desktop-app-info.c b/libxfdashboard/desktop-app-info.c
index 988fce9..b058ec6 100644
--- a/libxfdashboard/desktop-app-info.c
+++ b/libxfdashboard/desktop-app-info.c
@@ -98,6 +98,43 @@ typedef struct
gchar *desktopFile;
} XfdashboardDesktopAppInfoChildSetupData;
+/* Get or update path to executable file for this application */
+static void __xfdashboard_desktop_app_info_update_binary_executable(XfdashboardDesktopAppInfo *self)
+{
+ XfdashboardDesktopAppInfoPrivate *priv;
+
+ g_return_if_fail(XFDASHBOARD_IS_DESKTOP_APP_INFO(self));
+
+ priv=self->priv;
+
+ /* Get path to executable file for this application by striping white-space from
+ * the beginning of the command to execute when launching up to first white-space
+ * after the first command-line argument (which is the command).
+ */
+ if(priv->binaryExecutable)
+ {
+ g_free(priv->binaryExecutable);
+ priv->binaryExecutable=NULL;
+ }
+
+ if(priv->item)
+ {
+ const gchar *command;
+ const gchar *commandStart;
+ const gchar *commandEnd;
+
+ command=garcon_menu_item_get_command(priv->item);
+
+ while(*command==' ') command++;
+ commandStart=command;
+
+ while(*command && *command!=' ') command++;
+ commandEnd=command;
+
+ priv->binaryExecutable=g_strndup(commandStart, commandEnd-commandStart);
+ }
+}
+
/* (Re-)Load application actions */
static void _xfdashboard_desktop_app_info_update_actions(XfdashboardDesktopAppInfo *self)
{
@@ -255,32 +292,8 @@ static void _xfdashboard_desktop_app_info_set_file(XfdashboardDesktopAppInfo *se
self);
}
- /* Get path to executable file for this application by striping white-space from
- * the beginning of the command to execute when launching up to first white-space
- * after the first command-line argument (which is the command).
- */
- if(priv->binaryExecutable)
- {
- g_free(priv->binaryExecutable);
- priv->binaryExecutable=NULL;
- }
-
- if(priv->item)
- {
- const gchar *command;
- const gchar *commandStart;
- const gchar *commandEnd;
-
- command=garcon_menu_item_get_command(priv->item);
-
- while(*command==' ') command++;
- commandStart=command;
-
- while(*command && *command!=' ') command++;
- commandEnd=command;
-
- priv->binaryExecutable=g_strndup(commandStart, commandEnd-commandStart);
- }
+ /* Get path to executable file for this application */
+ __xfdashboard_desktop_app_info_update_binary_executable(self);
/* Get application actions */
_xfdashboard_desktop_app_info_update_actions(self);
@@ -1482,6 +1495,9 @@ gboolean xfdashboard_desktop_app_info_reload(XfdashboardDesktopAppInfo *self)
if(error) g_error_free(error);
}
+ /* Update path to executable file for this application */
+ __xfdashboard_desktop_app_info_update_binary_executable(self);
+
/* Reload application actions */
_xfdashboard_desktop_app_info_update_actions(self);
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list