Merge lp:~unity-team/unity/unity.fix-removing-nofavs into lp:unity

Proposed by Gord Allott
Status: Merged
Merged at revision: 479
Proposed branch: lp:~unity-team/unity/unity.fix-removing-nofavs
Merge into: lp:unity
Diff against target: 42 lines (+17/-3)
2 files modified
unity-private/launcher/application-controller.vala (+1/-1)
unity-private/launcher/scroller-controller.vala (+16/-2)
To merge this branch: bzr merge lp:~unity-team/unity/unity.fix-removing-nofavs
Reviewer Review Type Date Requested Status
Mikkel Kamstrup Erlandsen (community) Approve
Review via email: mp+34399@code.launchpad.net

Description of the change

fixes lp:623953 -
summery; launch an application that is not in your launcher, right click the launcher, select keep in launcher, close the application. it should stay on your launcher.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/launcher/application-controller.vala'
2--- unity-private/launcher/application-controller.vala 2010-08-25 09:17:16 +0000
3+++ unity-private/launcher/application-controller.vala 2010-09-02 11:03:43 +0000
4@@ -38,7 +38,7 @@
5 private Dbusmenu.Menuitem cached_menu;
6 private int menu_items_realized_counter;
7
8- private bool is_favorite = false;
9+ public bool is_favorite = false;
10
11 public ApplicationController (string? desktop_file_, ScrollerChild child_)
12 {
13
14=== modified file 'unity-private/launcher/scroller-controller.vala'
15--- unity-private/launcher/scroller-controller.vala 2010-09-01 13:26:46 +0000
16+++ unity-private/launcher/scroller-controller.vala 2010-09-02 11:03:43 +0000
17@@ -135,9 +135,23 @@
18 childcontrollers.add (controller);
19 controller.request_removal.connect (on_scroller_controller_closed);
20 controller.notify["hide"].connect (() => {
21+
22+ // weird logic here i know, basically more if's than needed because
23+ // i don't want to access the controller as a subclass until
24+ // i know it is of that subclass type.
25 if (controller.hide && controller.child in model)
26- model.remove (controller.child);
27- if (!controller.hide && (controller.child in model) == false)
28+ {
29+ if (controller is ApplicationController)
30+ {
31+ if ((controller as ApplicationController).is_favorite == false)
32+ model.remove (controller.child);
33+ }
34+ else
35+ {
36+ model.remove (controller.child);
37+ }
38+ }
39+ else if (!controller.hide && (controller.child in model) == false)
40 model.add (controller.child);
41 });
42 }