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
=== modified file 'libindicator/indicator-desktop-shortcuts.c'
--- libindicator/indicator-desktop-shortcuts.c 2012-04-02 23:42:07 +0000
+++ libindicator/indicator-desktop-shortcuts.c 2013-04-05 11:23:33 +0000
@@ -567,7 +567,7 @@
567 Return value: #TRUE on success or #FALSE on error.567 Return value: #TRUE on success or #FALSE on error.
568*/568*/
569gboolean569gboolean
570indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick)570indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, const gchar * nick, GAppLaunchContext * launch_context)
571{571{
572 GError * error = NULL;572 GError * error = NULL;
573573
@@ -654,7 +654,7 @@
654 return FALSE;654 return FALSE;
655 }655 }
656656
657 gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, NULL, &error);657 gboolean launched = g_app_info_launch(G_APP_INFO(appinfo), NULL, launch_context, &error);
658658
659 if (error != NULL) {659 if (error != NULL) {
660 g_warning("Unable to launch file from nick '%s': %s", nick, error->message);660 g_warning("Unable to launch file from nick '%s': %s", nick, error->message);
@@ -668,3 +668,9 @@
668668
669 return launched;669 return launched;
670}670}
671
672gboolean
673indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick)
674{
675 return indicator_desktop_shortcuts_nick_exec_with_context (ids, nick, NULL);
676}
671677
=== modified file 'libindicator/indicator-desktop-shortcuts.h'
--- libindicator/indicator-desktop-shortcuts.h 2010-02-15 21:44:00 +0000
+++ libindicator/indicator-desktop-shortcuts.h 2013-04-05 11:23:33 +0000
@@ -24,6 +24,7 @@
24#ifndef __INDICATOR_DESKTOP_SHORTCUTS_H__24#ifndef __INDICATOR_DESKTOP_SHORTCUTS_H__
25#define __INDICATOR_DESKTOP_SHORTCUTS_H__25#define __INDICATOR_DESKTOP_SHORTCUTS_H__
2626
27#include <gio/gio.h>
27#include <glib.h>28#include <glib.h>
28#include <glib-object.h>29#include <glib-object.h>
2930
@@ -66,6 +67,9 @@
66const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids);67const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids);
67gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids,68gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids,
68 const gchar * nick);69 const gchar * nick);
70gboolean indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids,
71 const gchar * nick,
72 GAppLaunchContext * launch_context);
69gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids,73gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids,
70 const gchar * nick);74 const gchar * nick);
7175

Subscribers

People subscribed via source and target branches