Merge lp://qastaging/~3v1n0/unity/avoid-duplicate-icons into lp://qastaging/unity

Proposed by Marco Trevisan (Treviño)
Status: Superseded
Proposed branch: lp://qastaging/~3v1n0/unity/avoid-duplicate-icons
Merge into: lp://qastaging/unity
Diff against target: 172 lines (+59/-6)
5 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/tests/__init__.py (+6/-2)
tests/autopilot/autopilot/tests/test_launcher.py (+37/-0)
To merge this branch: bzr merge lp://qastaging/~3v1n0/unity/avoid-duplicate-icons
Reviewer Review Type Date Requested Status
Thomi Richards (community) Needs Fixing
Review via email: mp+103594@code.qastaging.launchpad.net

This proposal has been superseded by a proposal from 2012-04-26.

Commit message

LauncherController: flag any bamf view that we control with an icon using the "unity-seen" qdata to avoid icons duplication

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.

This needs lp:~3v1n0/bamf/lib-factory-xids-matching to properly work.

AP tests included.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

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")
131 + self.start_app("System Settings")
132 + os.spawnlp(os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh")
133 + self.addCleanup(call, ["killall", "xterm"])
134 +
135 + # FIXME bamf emulator should wait until a window is open
136 + sleep(1)
137 + [xterm_win] = [w for w in self.bamf.get_open_windows() if w.name == "Autopilot XTerm"]
138 + self.assertTrue(xterm_win.is_focused)

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]
155 + self.assertThat(len(same_desktop), Equals(1))

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.application_id]
158 + self.assertThat(len(same_appid), Equals(1))

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.
        """
        icons = self.get_children_by_type(SimpleLauncherIcon, **kwargs)
        if len(icons):
            return icons[0]

        return None

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.