Bug 441530 - Make sort of search result list persistent
Summary: Make sort of search result list persistent
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: search (show other bugs)
Version: 5.18.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-25 13:43 UTC by Andreas
Modified: 2021-08-28 19:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas 2021-08-25 13:43:49 UTC
SUMMARY

When editing an event item in the korganizer search result list it gets updated and the chosen sort order is lost. It has probably always been like that, but from a usability point of view this seems highly discouraged since editing multiple search result entries becomes incredibly much more tedious (list needs to be sorted again and then the subsequent entry be identified).   

STEPS TO REPRODUCE
1. Activate at least one calendar with a couple of events. Press Ctrl+F and search for "*" to find all events in an interval. 
2. Click the "Summary" header in the search result list to sort by the event summary field.
3. Double-click one of the events to edit it. Confirm the change.

OBSERVED RESULT

Event is changed and the search result list is reloaded, but looses the sorting previously determined.

EXPECTED RESULT

Event is changed and the search result list is reloaded and retains the sorting previously determined.

ADDITIONAL INFORMATION

May be considered a usability bug.
Comment 1 Andreas 2021-08-27 10:57:34 UTC
The issue is evidently in EventViews::ListView here https://github.com/KDE/eventviews/blob/master/src/list/listview.cpp

There is a hard coded sort order via 
d->mTreeWidget->sortItems(StartDateTime_Column, Qt::AscendingOrder);
in ListView::updateView() probably causing this behaviour. 

The order should probably be set to StartDateTime_Column only initially.

I only do not know what else depends on this as it looks like a conscious decision.
Comment 2 Bug Janitor Service 2021-08-28 01:35:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/eventviews/-/merge_requests/38
Comment 3 gjditchfield 2021-08-28 17:17:07 UTC
Git commit 59afb8ff462a5da831a8daf3ebe064846f556504 by Glen Ditchfield.
Committed on 28/08/2021 at 00:56.
Pushed by gditchfield into branch 'release/21.08'.

Preserve sorting in the ListView

When an incidence editor changes an incidence, the ListViews in the
Event View and the Search Dialog update, and re-sort themselves by
the starting date in ascending order, overriding the user's choice.

This patch tracks changes to the view's sort column and order, and
also saves them in the application settings.

M  +15   -1    src/list/listview.cpp
M  +2    -0    src/list/listview.h

https://invent.kde.org/pim/eventviews/commit/59afb8ff462a5da831a8daf3ebe064846f556504
Comment 4 Andreas 2021-08-28 19:42:57 UTC
Tested and confirm that the patch fixes the issue.