Merge lp:~gary-lasker/software-center/tech-items-to-launcher-fix-lp1006483 into lp:software-center/5.2

Proposed by Gary Lasker
Status: Merged
Merged at revision: 3064
Proposed branch: lp:~gary-lasker/software-center/tech-items-to-launcher-fix-lp1006483
Merge into: lp:software-center/5.2
Prerequisite: lp:~gary-lasker/software-center/unity-launcher-integration-fixes
Diff against target: 25 lines (+5/-2)
1 file modified
softwarecenter/ui/gtk3/panes/availablepane.py (+5/-2)
To merge this branch: bzr merge lp:~gary-lasker/software-center/tech-items-to-launcher-fix-lp1006483
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+111135@code.launchpad.net

Commit message

* lp:~gary-lasker/software-center/tech-items-to-launcher-fix-lp1006483:
   - don't add an item to the launcher if its desktop file specifies
     NoDisplay=true (LP: #1006483)

Description of the change

This branch fixes bug 1006483 by checking an application's desktop file for NoDisplay=true, and if this value is set, the application is not added to the Unity launcher.

A convenient test case is the Deja Dup package, which sets NoDisplay=true in its desktop file.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this change looks fine.

It would be nice to have a test for this too, _add_application_to_unity_launcher() appears to be not covered
currently and it would be nice to test it with additional test files in data/app-install/desktop/ using a
mock launcher_info to test that send_application_to_launcher() is called for the right desktop files
(should be really straightforward to add I hope).

While looking at this a bit more (trying to figure out if it was covered for not) I noticed that it seems
like the "test_unity_launcher_integration.py" file needs updating to cover the new behavior that the launcher
item is added on "transaction-finished" instead of "transaction-started".

It currently sends a fake "transaction-started" signal in the test, but in order to test
if the signal is actually delivered to unity it also needs to send a "transaction-finished" signal too.
So I would suggest (probably in the original branch or as a seperate branch not here in this branch as this
branch is nice and short) to update the test to send the "transaction-finished" signal and also to add a mock
for available_pane._add_application_to_unity_launcher so that after
self._navigate_to_appdetails_and_install(test_pkgname)" in the test the test can check that
the call was made as expected.

This got a bit long, so the summary is: this branch is fine and approve once the test situation is
sorted out.

Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, please check the separate MP for the enhanced set of unit tests here:

  https://code.launchpad.net/~gary-lasker/software-center/launcher-integration-unit-tests/+merge/115236

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/panes/availablepane.py'
2--- softwarecenter/ui/gtk3/panes/availablepane.py 2012-06-20 02:12:19 +0000
3+++ softwarecenter/ui/gtk3/panes/availablepane.py 2012-06-20 02:12:19 +0000
4@@ -37,6 +37,7 @@
5 from softwarecenter.paths import APP_INSTALL_PATH
6 from softwarecenter.utils import (wait_for_apt_cache_ready,
7 get_exec_line_from_desktop,
8+ is_no_display_desktop_file,
9 get_file_path_from_iconname,
10 convert_desktop_file_to_installed_location)
11 from softwarecenter.db.appfilter import AppFilter
12@@ -428,9 +429,11 @@
13 return
14 # do not add apps that have no Exec entry in their desktop file
15 # (e.g. wine, see LP: #848437 or ubuntu-restricted-extras,
16- # see LP: #913756)
17+ # see LP: #913756), also, don't add the item if NoDisplay is
18+ # specified (see LP: #1006483)
19 if (os.path.exists(installed_desktop_file_path) and
20- not get_exec_line_from_desktop(installed_desktop_file_path)):
21+ (not get_exec_line_from_desktop(installed_desktop_file_path) or
22+ is_no_display_desktop_file(installed_desktop_file_path))):
23 return
24
25 # now gather up the unity launcher info items and send the app to the

Subscribers

People subscribed via source and target branches