Merge lp:~ochosi/indicator-power/xfce4-powermanager-settings into lp:indicator-power/14.04

Proposed by Simon Steinbeiß
Status: Merged
Merged at revision: 222
Proposed branch: lp:~ochosi/indicator-power/xfce4-powermanager-settings
Merge into: lp:indicator-power/14.04
Diff against target: 25 lines (+10/-6)
1 file modified
src/service.c (+10/-6)
To merge this branch: bzr merge lp:~ochosi/indicator-power/xfce4-powermanager-settings
Reviewer Review Type Date Requested Status
Sebastien Bacher Needs Fixing
Lars Karlitski Pending
Review via email: mp+202514@code.launchpad.net

Description of the change

This tiny patch (along the lines of indicator-sound: http://bazaar.launchpad.net/~indicator-applet-developers/indicator-sound/trunk.14.04/view/head:/src/service.vala#L120) adds support for opening xfce4-powermanager-settings if indicator-power is in a Xubuntu session. It will also make it easier to add other desktops, e.g. if ubuntu-studio decide they want to use it as well.

This would be very useful, as we (Xubuntu team) plan to use indicator-power by default in 14.04.

(Rebased version of the patch on top of Robert's u-c-c branch that just got merged.)

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the work there, that seems slightly buggy though, in the case where the session is not Unity you do

" gchar *path
...
 g_free (path);"

that's likely to lead to invalid frees since you don't init path to NULL

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

Thanks for the patch. I've fixed the free() and rearranged the logic a bit to have a proper fallback on non-unity sessions at lp:~larsu/indicator-power/xfce-control-center

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/service.c'
--- src/service.c 2014-01-10 02:02:31 +0000
+++ src/service.c 2014-01-21 17:44:49 +0000
@@ -693,12 +693,16 @@
693 gpointer gself G_GNUC_UNUSED)693 gpointer gself G_GNUC_UNUSED)
694{694{
695 gchar *path;695 gchar *path;
696696 if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity"))
697 path = g_find_program_in_path ("unity-control-center");697 {
698 if (path != NULL)698 path = g_find_program_in_path ("unity-control-center");
699 execute_command ("unity-control-center power");699 if (path != NULL)
700 else700 execute_command ("unity-control-center power");
701 execute_command ("gnome-control-center power");701 else
702 execute_command ("gnome-control-center power");
703 }
704 else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu"))
705 execute_command ("xfce4-power-manager-settings");
702 g_free (path);706 g_free (path);
703}707}
704708

Subscribers

People subscribed via source and target branches