Merge lp:~3v1n0/unity/avoid-duplicate-icons into lp:unity
| Status: | Merged |
|---|---|
| Approved by: | Didier Roche on 2012-04-26 |
| Approved revision: | 2348 |
| Merged at revision: | 2345 |
| Proposed branch: | lp:~3v1n0/unity/avoid-duplicate-icons |
| Merge into: | lp:unity |
| Diff against target: |
226 lines (+84/-17) 6 files modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+2/-1) plugins/unityshell/src/LauncherController.cpp (+4/-3) tests/autopilot/autopilot/emulators/bamf.py (+10/-0) tests/autopilot/autopilot/emulators/unity/launcher.py (+13/-11) tests/autopilot/autopilot/tests/__init__.py (+6/-2) tests/autopilot/autopilot/tests/test_launcher.py (+49/-0) |
| To merge this branch: | bzr merge lp:~3v1n0/unity/avoid-duplicate-icons |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michal Hruby (community) | Approve on 2012-04-26 | ||
| Tim Penhey (community) | Approve on 2012-04-26 | ||
| Marco Trevisan (Treviño) | Pending | ||
| Thomi Richards | 2012-04-26 | Pending | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2012-04-26.
Commit Message
We need to flag a bamf view that we control using an icon using the "unity-seen" qdata, or unity will duplicate it on bamfdaemon respawn. (LP: #928912)
Description of the Change
We need to flag a bamf view that we control using an icon using the "unity-seen" qdata, or unity will duplicate it on bamfdaemon respawn.
AP tests included.
This MP was superseeded to use thomi's test fixes from lp:~thomir/unity/avoid-duplicate-icons
| Thomi Richards (thomir) wrote : | # |
This has a few problems:
1) I can't verify this without the libbamf fix (remember this isn't my branch, I'm just fixing the AP tests).
2) (possibly the same as above) - unity keeps the xclock icon around forever.
| Unity Merger (unity-merger) wrote : | # |
No commit message specified.
| Michal Hruby (mhr3) wrote : | # |
The unity side looks safe, tests pass with the not-yet-merged bamf branch.


Hi,
Please try and replace the call() lines with this:
call("kill `pidof %s`" % (app['process- name']) , shell=True)
Don't use pkill -f - it's dangerous. Once making these changes, please ensure that all the tests still pass.
130 + self.start_ app("Calculator ") app("System Settings") os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh") (call, ["killall", "xterm"]) get_open_ windows( ) if w.name == "Autopilot XTerm"] (xterm_ win.is_ focused)
131 + self.start_
132 + os.spawnlp(
133 + self.addCleanup
134 +
135 + # FIXME bamf emulator should wait until a window is open
136 + sleep(1)
137 + [xterm_win] = [w for w in self.bamf.
138 + self.assertTrue
Please put all this in a method called "start_test_apps or something similar, then call it from your test.
154 + same_desktop = [i for i in bamf_icons if i.desktop_file == icon.desktop_file] (len(same_ desktop) , Equals(1))
155 + self.assertThat
Can you use 'get_icon_ by_desktop_ file' on the launcher model, to avoid this?
157 + same_appid = [i for i in bamf_icons if i.application_id == icon.applicatio n_id] (len(same_ appid), Equals(1))
158 + self.assertThat
Similar thing here... we should probable add something to the launcher model like this:
def get_icon_ by_filter( self, **kwargs):
"""Gets a launcher icon that matches the filter specified.
Returns None if there is no such launcher icon. children_ by_type( SimpleLauncherI con, **kwargs)
"""
icons = self.get_
if len(icons):
return icons[0]
return None