Merge lp:~azzar1/unity/fix-unpinned-nautilus into lp:unity

Proposed by Andrea Azzarone on 2016-07-01
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2016-07-01
Approved revision: 4133
Merged at revision: 4138
Proposed branch: lp:~azzar1/unity/fix-unpinned-nautilus
Merge into: lp:unity
Diff against target: 43 lines (+11/-1)
3 files modified
launcher/ApplicationLauncherIcon.cpp (+0/-1)
launcher/ApplicationLauncherIcon.h (+3/-0)
launcher/FileManagerLauncherIcon.cpp (+8/-0)
To merge this branch: bzr merge lp:~azzar1/unity/fix-unpinned-nautilus
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2016-07-01 Approve on 2016-07-01
PS Jenkins bot continuous-integration Pending
Review via email: mp+298888@code.launchpad.net

Commit message

Make sure file manager icon is not removed when unpinned.

To post a comment you must log in.
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks a lot!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/ApplicationLauncherIcon.cpp'
2--- launcher/ApplicationLauncherIcon.cpp 2016-01-20 15:12:49 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2016-07-01 12:15:20 +0000
4@@ -42,7 +42,6 @@
5 DECLARE_LOGGER(logger, "unity.launcher.icon.application");
6
7 // We use the "application-" prefix since the manager is protected, to avoid name clash
8-const std::string ICON_REMOVE_TIMEOUT = "application-icon-remove";
9 const std::string DEFAULT_ICON = "application-default-icon";
10
11 enum MenuItemType
12
13=== modified file 'launcher/ApplicationLauncherIcon.h'
14--- launcher/ApplicationLauncherIcon.h 2015-12-07 18:04:33 +0000
15+++ launcher/ApplicationLauncherIcon.h 2016-07-01 12:15:20 +0000
16@@ -54,6 +54,9 @@
17 void UnStick() override;
18
19 protected:
20+ // This must be defined here as it's used both in ApplicationLauncherIcon and in FileManagerLauncherIcon.
21+ static constexpr const char* ICON_REMOVE_TIMEOUT = "application-icon-remove";
22+
23 void SetApplication(ApplicationPtr const& app);
24 ApplicationPtr GetApplication() const;
25
26
27=== modified file 'launcher/FileManagerLauncherIcon.cpp'
28--- launcher/FileManagerLauncherIcon.cpp 2016-02-09 10:43:42 +0000
29+++ launcher/FileManagerLauncherIcon.cpp 2016-07-01 12:15:20 +0000
30@@ -67,6 +67,14 @@
31 icon_name = (icon.empty() ? DEFAULT_ICON : icon);
32 }));
33
34+ signals_conn_.Add(app_->running.changed.connect([this](bool running) {
35+ LOG_DEBUG(logger) << tooltip_text() << " running now " << (running ? "true" : "false");
36+
37+ if (running)
38+ _source_manager.Remove(ICON_REMOVE_TIMEOUT);
39+ }));
40+
41+
42 UpdateStorageWindows();
43 }
44