Merge lp:~laney/unity/launcher-check-same-file into lp:unity

Proposed by Iain Lane
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 4015
Proposed branch: lp:~laney/unity/launcher-check-same-file
Merge into: lp:unity
Diff against target: 21 lines (+3/-4)
1 file modified
launcher/ApplicationLauncherIcon.cpp (+3/-4)
To merge this branch: bzr merge lp:~laney/unity/launcher-check-same-file
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+271671@code.launchpad.net

Commit message

launcher: Always make sure we check the right file when seeing if .desktop files have been deleted. Fixes disappearing launcher icons when applications are upgraded when we are using glib > 2.44.

Description of the change

launcher: Always make sure we check the right file when seeing if .desktop files have been deleted.

We were checking the GFile which came in via the changed signal, but sometimes
(e.g. for paired delete/create events caused by moves), this can be a file that
is being moved onto our target.

Always check the target file that we watched initially.

This fixes disappearing launcher icons when applications are updated with glib > 2.44.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Iain Lane (laney) wrote :

On Fri, Sep 18, 2015 at 06:01:18PM -0000, PS Jenkins bot wrote:
> Review: Needs Fixing continuous-integration
>
> FAILED: Continuous integration, rev:4009
> http://jenkins.qa.ubuntu.com/job/unity-ci/1299/
> Executed test runs:
> FAILURE: http://jenkins.qa.ubuntu.com/job/unity-wily-amd64-ci/77/console
> SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-wily-armhf-ci/75
> FAILURE: http://jenkins.qa.ubuntu.com/job/unity-wily-i386-ci/75/console

Did I break those?

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Just a small fix.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> On Fri, Sep 18, 2015 at 06:01:18PM -0000, PS Jenkins bot wrote:
> > Review: Needs Fixing continuous-integration
> >
> > FAILED: Continuous integration, rev:4009
> > http://jenkins.qa.ubuntu.com/job/unity-ci/1299/
> > Executed test runs:
> > FAILURE: http://jenkins.qa.ubuntu.com/job/unity-wily-amd64-ci/77/console
> > SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-wily-armhf-ci/75
> > FAILURE: http://jenkins.qa.ubuntu.com/job/unity-wily-i386-ci/75/console
>
> Did I break those?

Nope... For some reason there are failures in CI which doesn't happen both locally and when building in silos, so we need to do something to fortify them.

Revision history for this message
Iain Lane (laney) wrote :

On Mon, Sep 21, 2015 at 02:38:56PM -0000, Marco Trevisan (Treviño) wrote:
> Just a small fix.

Thanks, I pushed a new one. Didn't build it myself though this time.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Thanks, just update the file to the proper naming...

review: Needs Fixing
Revision history for this message
Iain Lane (laney) wrote :

On Mon, Sep 21, 2015 at 04:57:42PM -0000, Marco Trevisan (Treviño) wrote:
> Review: Needs Fixing
>
> Thanks, just update the file to the proper naming...

SHOULD HAVE BUILT IT!

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

> On Mon, Sep 21, 2015 at 04:57:42PM -0000, Marco Trevisan (Treviño) wrote:
> > Review: Needs Fixing
> >
> > Thanks, just update the file to the proper naming...
>
> SHOULD HAVE BUILT IT!

Eheh, no worries :)

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

So... Thanks!

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 2015-07-10 10:31:46 +0000
3+++ launcher/ApplicationLauncherIcon.cpp 2015-09-21 17:05:34 +0000
4@@ -559,14 +559,13 @@
5 g_file_monitor_set_rate_limit(_desktop_file_monitor, 2000);
6
7 _gsignals.Add<void, GFileMonitor*, GFile*, GFile*, GFileMonitorEvent>(_desktop_file_monitor, "changed",
8- [this] (GFileMonitor*, GFile* f, GFile*, GFileMonitorEvent event_type) {
9+ [this, desktop_file] (GFileMonitor*, GFile*, GFile*, GFileMonitorEvent event_type) {
10 switch (event_type)
11 {
12 case G_FILE_MONITOR_EVENT_DELETED:
13 {
14- glib::Object<GFile> file(f, glib::AddRef());
15- _source_manager.AddTimeoutSeconds(1, [this, file] {
16- if (!g_file_query_exists(file, nullptr))
17+ _source_manager.AddTimeoutSeconds(1, [this, desktop_file] {
18+ if (!g_file_query_exists(desktop_file, nullptr))
19 {
20 UnStick();
21 LogUnityEvent(ApplicationEventType::DELETE);