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

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
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) Approve
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.
Revision history for this message
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
=== modified file 'launcher/ApplicationLauncherIcon.cpp'
--- launcher/ApplicationLauncherIcon.cpp 2016-01-20 15:12:49 +0000
+++ launcher/ApplicationLauncherIcon.cpp 2016-07-01 12:15:20 +0000
@@ -42,7 +42,6 @@
42DECLARE_LOGGER(logger, "unity.launcher.icon.application");42DECLARE_LOGGER(logger, "unity.launcher.icon.application");
4343
44// We use the "application-" prefix since the manager is protected, to avoid name clash44// We use the "application-" prefix since the manager is protected, to avoid name clash
45const std::string ICON_REMOVE_TIMEOUT = "application-icon-remove";
46const std::string DEFAULT_ICON = "application-default-icon";45const std::string DEFAULT_ICON = "application-default-icon";
4746
48enum MenuItemType47enum MenuItemType
4948
=== modified file 'launcher/ApplicationLauncherIcon.h'
--- launcher/ApplicationLauncherIcon.h 2015-12-07 18:04:33 +0000
+++ launcher/ApplicationLauncherIcon.h 2016-07-01 12:15:20 +0000
@@ -54,6 +54,9 @@
54 void UnStick() override;54 void UnStick() override;
5555
56protected:56protected:
57 // This must be defined here as it's used both in ApplicationLauncherIcon and in FileManagerLauncherIcon.
58 static constexpr const char* ICON_REMOVE_TIMEOUT = "application-icon-remove";
59
57 void SetApplication(ApplicationPtr const& app);60 void SetApplication(ApplicationPtr const& app);
58 ApplicationPtr GetApplication() const;61 ApplicationPtr GetApplication() const;
5962
6063
=== modified file 'launcher/FileManagerLauncherIcon.cpp'
--- launcher/FileManagerLauncherIcon.cpp 2016-02-09 10:43:42 +0000
+++ launcher/FileManagerLauncherIcon.cpp 2016-07-01 12:15:20 +0000
@@ -67,6 +67,14 @@
67 icon_name = (icon.empty() ? DEFAULT_ICON : icon);67 icon_name = (icon.empty() ? DEFAULT_ICON : icon);
68 }));68 }));
6969
70 signals_conn_.Add(app_->running.changed.connect([this](bool running) {
71 LOG_DEBUG(logger) << tooltip_text() << " running now " << (running ? "true" : "false");
72
73 if (running)
74 _source_manager.Remove(ICON_REMOVE_TIMEOUT);
75 }));
76
77
70 UpdateStorageWindows();78 UpdateStorageWindows();
71}79}
7280