Merge lp:~3v1n0/libindicator/launch-shortucts-nicks-with-ctx into lp:libindicator/13.04

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Lars Karlitski
Approved revision: 485
Merged at revision: 483
Proposed branch: lp:~3v1n0/libindicator/launch-shortucts-nicks-with-ctx
Merge into: lp:libindicator/13.04
Diff against target: 52 lines (+12/-2)
2 files modified
libindicator/indicator-desktop-shortcuts.c (+8/-2)
libindicator/indicator-desktop-shortcuts.h (+4/-0)
To merge this branch: bzr merge lp:~3v1n0/libindicator/launch-shortucts-nicks-with-ctx
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+157094@code.launchpad.net

Commit message

IndicatorDestkopShortcuts: add indicator_desktop_shortcuts_nick_exec_with_context

It allows to pass a GAppLaunchContext to pass platform-data when launching
actions.

Description of the change

Added indicator_desktop_shortcuts_nick_exec_with_context function to indicator-desktop-shortcuts, not to break the API I've kept the old indicator_desktop_shortcuts_nick_exec, that now only calls indicator_desktop_shortcuts_nick_exec_with_context with a NULL context (as it was doing before).
Now we'll be able to use the correct context in unity, though.

This is merging only with 13.04 branch, let me know if it's the case to propose this for trunk as well or not.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Lars Karlitski (larsu) wrote :

Thanks! This is definitely a change worth having in trunk as well.

Just one problem: you renamed the original function to indicator_desktop_shortcuts_nick_exec_ctx. Probably by accident?

review: Needs Fixing
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> Thanks! This is definitely a change worth having in trunk as well.

Nice, for trunk I'd like to set the old one as deprecated though.
(or to be removed at all, since we're using it only in unity AFAIK)

> Just one problem: you renamed the original function to
> indicator_desktop_shortcuts_nick_exec_ctx. Probably by accident?

Ooops, sorry for this, fixed!

484. By Marco Trevisan (Treviño)

IndicatorDestkopShortcuts: fixed typo

485. By Marco Trevisan (Treviño)

IndicatorDestkopShortcuts: add missing include

Revision history for this message
Lars Karlitski (larsu) wrote :

Cool, thanks.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libindicator/indicator-desktop-shortcuts.c'
2--- libindicator/indicator-desktop-shortcuts.c 2012-04-02 23:42:07 +0000
3+++ libindicator/indicator-desktop-shortcuts.c 2013-04-05 11:23:33 +0000
4@@ -567,7 +567,7 @@
5 Return value: #TRUE on success or #FALSE on error.
6 */
7 gboolean
8-indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick)
9+indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, const gchar * nick, GAppLaunchContext * launch_context)
10 {
11 GError * error = NULL;
12
13@@ -654,7 +654,7 @@
14 return FALSE;
15 }
16
17- gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, NULL, &error);
18+ gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, launch_context, &error);
19
20 if (error != NULL) {
21 g_warning("Unable to launch file from nick '%s': %s", nick, error->message);
22@@ -668,3 +668,9 @@
23
24 return launched;
25 }
26+
27+gboolean
28+indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick)
29+{
30+ return indicator_desktop_shortcuts_nick_exec_with_context (ids, nick, NULL);
31+}
32
33=== modified file 'libindicator/indicator-desktop-shortcuts.h'
34--- libindicator/indicator-desktop-shortcuts.h 2010-02-15 21:44:00 +0000
35+++ libindicator/indicator-desktop-shortcuts.h 2013-04-05 11:23:33 +0000
36@@ -24,6 +24,7 @@
37 #ifndef __INDICATOR_DESKTOP_SHORTCUTS_H__
38 #define __INDICATOR_DESKTOP_SHORTCUTS_H__
39
40+#include <gio/gio.h>
41 #include <glib.h>
42 #include <glib-object.h>
43
44@@ -66,6 +67,9 @@
45 const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids);
46 gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids,
47 const gchar * nick);
48+gboolean indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids,
49+ const gchar * nick,
50+ GAppLaunchContext * launch_context);
51 gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids,
52 const gchar * nick);
53

Subscribers

People subscribed via source and target branches