Merge lp:~3v1n0/unity/sticky-save-fix into lp:unity

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 2767
Proposed branch: lp:~3v1n0/unity/sticky-save-fix
Merge into: lp:unity
Diff against target: 40 lines (+5/-13)
2 files modified
launcher/BamfLauncherIcon.cpp (+5/-5)
tests/test_launcher_controller.cpp (+0/-8)
To merge this branch: bzr merge lp:~3v1n0/unity/sticky-save-fix
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+126926@code.launchpad.net

Commit message

BamfLauncherIcon: call Stick after that the icon is set sticky, so that the signal emission will work

And so the favorites will be correctly saved.

Description of the change

A BamfLauncherIcon needs to call the SimpleLauncherIcon::Stick as last thing, since if this won't happen, when the position_saved signal is emitted, IsSticky() call would still return false and then the icon would not been added to the favorite store.

Unit tests updated.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

Works here.

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/1404/console reported an error when processing this lp:~3v1n0/unity/sticky-save-fix branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/BamfLauncherIcon.cpp'
2--- launcher/BamfLauncherIcon.cpp 2012-09-25 23:09:59 +0000
3+++ launcher/BamfLauncherIcon.cpp 2012-09-28 14:59:29 +0000
4@@ -935,12 +935,12 @@
5
6 void BamfLauncherIcon::Stick(bool save)
7 {
8+ if (IsSticky())
9+ return;
10+
11+ bamf_view_set_sticky(BAMF_VIEW(_bamf_app.RawPtr()), true);
12+
13 SimpleLauncherIcon::Stick(save);
14-
15- if (IsSticky())
16- return;
17-
18- bamf_view_set_sticky(BAMF_VIEW(_bamf_app.RawPtr()), true);
19 }
20
21 void BamfLauncherIcon::UnStick()
22
23=== modified file 'tests/test_launcher_controller.cpp'
24--- tests/test_launcher_controller.cpp 2012-09-20 00:14:30 +0000
25+++ tests/test_launcher_controller.cpp 2012-09-28 14:59:29 +0000
26@@ -163,14 +163,6 @@
27 return FavoriteStore::URI_PREFIX_APP + remote_uri_;
28 }
29
30- bool IsSticky() const
31- {
32- if (remote_uri_.empty())
33- return BamfLauncherIcon::IsSticky();
34- else
35- return SimpleLauncherIcon::IsSticky();
36- }
37-
38 void ReallyStick(bool save) { BamfLauncherIcon::Stick(save); }
39
40 MOCK_METHOD1(Stick, void(bool));