Merge lp:~jassmith/unity/unity.fix-drag-over-trash into lp:unity

Proposed by Jason Smith
Status: Merged
Approved by: Jason Smith
Approved revision: no longer in the source branch.
Merged at revision: 1997
Proposed branch: lp:~jassmith/unity/unity.fix-drag-over-trash
Merge into: lp:unity
Diff against target: 39 lines (+12/-3)
1 file modified
plugins/unityshell/src/LauncherModel.cpp (+12/-3)
To merge this branch: bzr merge lp:~jassmith/unity/unity.fix-drag-over-trash
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+93926@code.launchpad.net

Description of the change

fix bug where icons would jump around when resorting over an icon not in their own group

Launcher still lacks any significant method of being tested for these kinds of changes. Significant refactoring is still required.

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

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/LauncherModel.cpp'
2--- plugins/unityshell/src/LauncherModel.cpp 2012-02-14 00:26:48 +0000
3+++ plugins/unityshell/src/LauncherModel.cpp 2012-02-21 06:53:18 +0000
4@@ -215,7 +215,10 @@
5 void
6 LauncherModel::ReorderAfter(AbstractLauncherIcon::Ptr icon, AbstractLauncherIcon::Ptr other)
7 {
8- if (icon == other)
9+ if (icon == other || icon.IsNull() || other.IsNull())
10+ return;
11+
12+ if (icon->GetIconType() != other->GetIconType())
13 return;
14
15 int i = 0;
16@@ -245,7 +248,10 @@
17 void
18 LauncherModel::ReorderBefore(AbstractLauncherIcon::Ptr icon, AbstractLauncherIcon::Ptr other, bool save)
19 {
20- if (icon == other)
21+ if (icon == other || icon.IsNull() || other.IsNull())
22+ return;
23+
24+ if (icon->GetIconType() != other->GetIconType())
25 return;
26
27 int i = 0;
28@@ -286,7 +292,10 @@
29 void
30 LauncherModel::ReorderSmart(AbstractLauncherIcon::Ptr icon, AbstractLauncherIcon::Ptr other, bool save)
31 {
32- if (icon == other)
33+ if (icon == other || icon.IsNull() || other.IsNull())
34+ return;
35+
36+ if (icon->GetIconType() != other->GetIconType())
37 return;
38
39 int i = 0;