aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2013-04-09 04:53:09 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2013-04-09 04:53:09 +0200
commitbd9abfc7d47ae16cf92632a6d9507150338e7cfc (patch)
treea38c42cf660e5cfd18c0fc645537b8429c4d54f7
parent2d418a6199dce41dea87af2bccf3cd4ed65cfa48 (diff)
downloadlibayatana-indicator-bd9abfc7d47ae16cf92632a6d9507150338e7cfc.tar.gz
libayatana-indicator-bd9abfc7d47ae16cf92632a6d9507150338e7cfc.tar.bz2
libayatana-indicator-bd9abfc7d47ae16cf92632a6d9507150338e7cfc.zip
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.
-rw-r--r--libindicator/indicator-desktop-shortcuts.c24
1 files 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)
{