Bug 493724 - TaskManager::TasksModel: use QDateTime instead of QTime for lastActivated
Summary: TaskManager::TasksModel: use QDateTime instead of QTime for lastActivated
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (show other bugs)
Version: 6.1.5
Platform: Neon Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-27 08:16 UTC by antroids
Modified: 2024-12-14 13:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.2.5
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description antroids 2024-09-27 08:16:37 UTC
SUMMARY
I've created a widget with window controls. 
It has a mode to show controls for last activated task instead of active, this option works well with multiple displays.
The mode based on TasksModel sorted by SortLastActivated.
However, if you have some tasks opened yesterday at some time, they will always be above any tasks opened today before this time. 
Formaly, everything is correct, sorted by timestamp according to the documentation.
But the model is not sorted in expected order.

STEPS TO REPRODUCE
1. Install "Application Title Bar" widget to a panel.
2. Switch "Active task source" option to "Last active task".
3. Open first task.
4. Wait until the next day.
5. Open second task.

OBSERVED RESULT
Controls are showed for the first task.

EXPECTED RESULT
Controls are showed for the second task.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.8.0-40-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 PRO 4650U with Radeon Graphics
Memory: 14.9 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: LENOVO
Product Name: 20UH001JRT
System Version: ThinkPad T14s Gen 1

ADDITIONAL INFORMATION
https://invent.kde.org/plasma/plasma-workspace/-/blob/master/libtaskmanager/waylandtasksmodel.cpp#L415
Comment 1 Nate Graham 2024-09-30 16:35:39 UTC
Nice investigation. Would you like to submit a patch?
Comment 2 Bug Janitor Service 2024-12-07 20:35:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4986
Comment 3 Fushan Wen 2024-12-14 12:57:30 UTC
Git commit 98469ba87c48b3c12b5947d6f7fbebf7f771d2bc by Fushan Wen, on behalf of Anton Kharuzhy.
Committed on 14/12/2024 at 12:57.
Pushed by fusionfuture into branch 'master'.

libtaskmanager: use QDateTime instead of QTime for lastActivated

TaskManager model can have rows sorted in wrong order if some tasks were activated yesterday and sort mode is SortLastActivated.
FIXED-IN: 6.2.5

M  +3    -3    libtaskmanager/autotests/xwindowtasksmodeltest.cpp
M  +3    -3    libtaskmanager/taskgroupingproxymodel.cpp
M  +12   -12   libtaskmanager/tasksmodel.cpp
M  +4    -3    libtaskmanager/waylandtasksmodel.cpp
M  +3    -2    libtaskmanager/xwindowtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/98469ba87c48b3c12b5947d6f7fbebf7f771d2bc
Comment 4 Fushan Wen 2024-12-14 13:52:24 UTC
Git commit 1b6359a4db1670b01f05aabb24735879ed629261 by Fushan Wen.
Committed on 14/12/2024 at 13:01.
Pushed by fusionfuture into branch 'Plasma/6.2'.

libtaskmanager: use QDateTime instead of QTime for lastActivated

TaskManager model can have rows sorted in wrong order if some tasks were activated yesterday and sort mode is SortLastActivated.
FIXED-IN: 6.2.5


(cherry picked from commit 98469ba87c48b3c12b5947d6f7fbebf7f771d2bc)

b3d7eb9c #493724: TaskManager::TasksModel: use QDateTime instead of QTime for lastActivated
fb4f2f06 Merge branch plasma-workspace:master into master

Co-authored-by: Anton Kharuzhy <publicantroids@gmail.com>

M  +3    -3    libtaskmanager/autotests/xwindowtasksmodeltest.cpp
M  +3    -3    libtaskmanager/taskgroupingproxymodel.cpp
M  +12   -12   libtaskmanager/tasksmodel.cpp
M  +4    -3    libtaskmanager/waylandtasksmodel.cpp
M  +3    -2    libtaskmanager/xwindowtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/1b6359a4db1670b01f05aabb24735879ed629261