Fix another regression with rearranging launchers in an activities world.

Authored by hein on Feb 23 2017, 5:27 PM.



The new activity-aware implementation of
LauncherTasksModel::setLauncherList() would only accept the passed list
when it changed any activities associations, not when the order changed.
This would effectively turn TasksModel::move involving launcher tasks
into a no-op.

Rearranging launchers works like this:

  1. A client calls TasksModel::move one or many times. TasksModel::move updates TasksModel's internal sort mapping and implements it, causing a visible order change in any views.
  2. When it is done calling move(), the client calls TasksModel::syncLaunchers. TasksModel::syncLaunchers calls LauncherTasksModel::setLauncherList with a new list derived from its sort mapping, and updates its sort mapping in expectation of row indices changing in the launcher tasks source model.

Due to the above bug, the sort mapping would be adjusted in expectation
of changes the launcher tasks model would not actually do, appearing to
undo the moves the next time a view is updated from source data.

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.Feb 23 2017, 5:27 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 23 2017, 5:27 PM
hein added a comment.Feb 23 2017, 5:36 PM

Note: This is a critical bug, and it's important this fix get into 5.9.3.

fvogt added a subscriber: fvogt.Feb 23 2017, 5:56 PM

With the typo fixed, I can now re-arrange launchers and it sticks when I launch the app.


Superfluous parenthesis, doesn't compile.

mart requested changes to this revision.Feb 24 2017, 10:15 AM

+1 after the fix

This revision now requires changes to proceed.Feb 24 2017, 10:15 AM
hein updated this revision to Diff 11766.Feb 24 2017, 2:44 PM
hein edited edge metadata.

Fix typo that happened when recreating the commit after a git accident ...

mart accepted this revision.Feb 24 2017, 2:45 PM
This revision is now accepted and ready to land.Feb 24 2017, 2:45 PM
This revision was automatically updated to reflect the committed changes.