diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2013-04-05 12:02:24 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-04-05 12:02:24 +0000 |
commit | 2d418a6199dce41dea87af2bccf3cd4ed65cfa48 (patch) | |
tree | 7f155ce4217241778c0e2b55de3b66e7b02bf2af | |
parent | ffbb3c1a57823568a8a5af27986624ff19b724b1 (diff) | |
parent | 07652a31900eb14e04b31ce38581958e12518ef3 (diff) | |
download | libayatana-indicator-2d418a6199dce41dea87af2bccf3cd4ed65cfa48.tar.gz libayatana-indicator-2d418a6199dce41dea87af2bccf3cd4ed65cfa48.tar.bz2 libayatana-indicator-2d418a6199dce41dea87af2bccf3cd4ed65cfa48.zip |
IndicatorDestkopShortcuts: add indicator_desktop_shortcuts_nick_exec_with_context
It allows to pass a GAppLaunchContext to pass platform-data when launching
actions. Deprecate old API. Fixes: https://bugs.launchpad.net/bugs/1164470, https://bugs.launchpad.net/bugs/1164483.
Approved by PS Jenkins bot, Lars Uebernickel.
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.c | 10 | ||||
-rw-r--r-- | libindicator/indicator-desktop-shortcuts.h | 22 |
2 files changed, 22 insertions, 10 deletions
diff --git a/libindicator/indicator-desktop-shortcuts.c b/libindicator/indicator-desktop-shortcuts.c index 0a4e026..12a9b0c 100644 --- a/libindicator/indicator-desktop-shortcuts.c +++ b/libindicator/indicator-desktop-shortcuts.c @@ -567,7 +567,7 @@ indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, cons Return value: #TRUE on success or #FALSE on error. */ gboolean -indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) +indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, const gchar * nick, GAppLaunchContext * launch_context) { GError * error = NULL; @@ -654,7 +654,7 @@ indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gc return FALSE; } - gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, NULL, &error); + gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, launch_context, &error); if (error != NULL) { g_warning("Unable to launch file from nick '%s': %s", nick, error->message); @@ -668,3 +668,9 @@ indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gc return launched; } + +gboolean +indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) +{ + return indicator_desktop_shortcuts_nick_exec_with_context (ids, nick, NULL); +} diff --git a/libindicator/indicator-desktop-shortcuts.h b/libindicator/indicator-desktop-shortcuts.h index 5ed490e..fb997ea 100644 --- a/libindicator/indicator-desktop-shortcuts.h +++ b/libindicator/indicator-desktop-shortcuts.h @@ -24,6 +24,7 @@ License along with this library. If not, see #ifndef __INDICATOR_DESKTOP_SHORTCUTS_H__ #define __INDICATOR_DESKTOP_SHORTCUTS_H__ +#include <gio/gio.h> #include <glib.h> #include <glib-object.h> @@ -60,14 +61,19 @@ struct _IndicatorDesktopShortcuts { GObject parent; }; -GType indicator_desktop_shortcuts_get_type (void); -IndicatorDesktopShortcuts * indicator_desktop_shortcuts_new (const gchar * file, - const gchar * identity); -const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids); -gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, - const gchar * nick); -gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, - const gchar * nick); +GType indicator_desktop_shortcuts_get_type (void); +IndicatorDesktopShortcuts * indicator_desktop_shortcuts_new (const gchar * file, + const gchar * identity); +const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids); +gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, + const gchar * nick); +gboolean indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, + const gchar * nick, + GAppLaunchContext * launch_context); + +GLIB_DEPRECATED_FOR(indicator_desktop_shortcuts_nick_exec_with_context) +gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, + const gchar * nick); G_END_DECLS |