From bd9abfc7d47ae16cf92632a6d9507150338e7cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 9 Apr 2013 04:53:09 +0200 Subject: IndicatorDestkopShortcuts: add StartupNotify parameter in our internal fake .desktop file Otherwise GAppInfo won't pass the relevant platform-data to the Application launched. Plus, fix the docs. --- libindicator/indicator-desktop-shortcuts.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 12a9b0c..70d964e 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -555,9 +555,10 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons } /** - indicator_desktop_shortcuts_nick_exec: + indicator_desktop_shortcuts_nick_exec_with_context: @ids: The #IndicatorDesktopShortcuts object to look in @nick: Which command that we're referencing. + @launch_context: The #GAppLaunchContext to use for launching the shortcut Here we take a @nick and try and execute the action that is associated with it. The @nick parameter should be gotten @@ -630,9 +631,9 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * gchar * desktopdata = g_strdup_printf("[" G_KEY_FILE_DESKTOP_GROUP "]\n" G_KEY_FILE_DESKTOP_KEY_TYPE "=" G_KEY_FILE_DESKTOP_TYPE_APPLICATION "\n" G_KEY_FILE_DESKTOP_KEY_NAME "=%s\n" - G_KEY_FILE_DESKTOP_KEY_EXEC "=%s\n", - name, exec); - + G_KEY_FILE_DESKTOP_KEY_EXEC "=%s\n" + G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY "=%s\n", + name, exec, launch_context ? "true" : "false"); g_free(name); g_free(exec); /* g_debug("Desktop file: \n%s", desktopdata); */ @@ -653,7 +654,6 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * g_key_file_free(launcher); return FALSE; } - gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, launch_context, &error); if (error != NULL) { @@ -669,6 +669,20 @@ indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * return launched; } +/** + indicator_desktop_shortcuts_nick_exec: + @ids: The #IndicatorDesktopShortcuts object to look in + @nick: Which command that we're referencing. + + Here we take a @nick and try and execute the action that is + associated with it. The @nick parameter should be gotten + from #indicator_desktop_shortcuts_get_nicks though it's not + required that the exact memory location be the same. + This function is deprecated and shouldn't be used in newly + written code. + + Return value: #TRUE on success or #FALSE on error. +*/ gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) { -- cgit v1.2.3