Bug 504726 - Removing timers in the "Tea List" deletes wrong entries.
Summary: Removing timers in the "Tea List" deletes wrong entries.
Status: RESOLVED FIXED
Alias: None
Product: kteatime
Classification: Applications
Component: general (other bugs)
Version First Reported In: 25.04.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Böhmann
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-24 10:11 UTC by strudelkuchen
Modified: 2025-06-18 07:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 25.04.3
Sentry Crash Report:


Attachments
Short video to demo the issue. (681.13 KB, video/mp4)
2025-05-24 10:11 UTC, strudelkuchen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description strudelkuchen 2025-05-24 10:11:18 UTC
Created attachment 181700 [details]
Short video to demo the issue.

SUMMARY

If you remove two entries from the "Tea List" it will remove a wrong entry on the second removal.

STEPS TO REPRODUCE
1. go to "Configure..."
2. select the first entry on the "Tea List" and remove it.
3. now "Custom Tea" will appear and be selected, but can't be removed.
4. next select the entry below and remove it, now it and the one below will be removed.

OBSERVED RESULT
The wrong entries are removed.

EXPECTED RESULT
Only entries you select should be removed.

SOFTWARE/OS VERSIONS
Operating System: CachyOS Linux
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.8-2-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor
Memory: 62.4 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 5080

ADDITIONAL INFORMATION
I have attached a short video that shows the issue.
Comment 1 Bug Janitor Service 2025-06-01 16:35:56 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kteatime/-/merge_requests/25
Comment 2 Nicolas Fella 2025-06-18 06:55:59 UTC
Git commit 6537191f3087ba86b7621682fe62630ba25cea9d by Nicolas Fella, on behalf of Efe Çiftci.
Committed on 18/06/2025 at 06:55.
Pushed by nicolasfella into branch 'master'.

Fix tea remove button in settings

This commit fixes an issue where the Remove button in the Settings window incorrectly modified entries in the tea list. When an item is removed from `m_model`, the list of selected indices briefly becomes empty. This triggers unintended actions, including a call to `Tea::setName()` with an empty `name`, which causes the next entry in `m_model` to be renamed.

This MR resolves the issue by ensuring `SettingsDialog::updateSelection()` does not alter the tea list when items exist but no indices are selected. The current solution may not be the most elegant but is functional. Tested by observing behavior of Add, Move, and Remove buttons.

M  +3    -0    src/settings.cpp

https://invent.kde.org/utilities/kteatime/-/commit/6537191f3087ba86b7621682fe62630ba25cea9d
Comment 3 Nicolas Fella 2025-06-18 06:59:03 UTC
Git commit fd62006dfd3d62cf2137e4c0ab1c75580191d938 by Nicolas Fella, on behalf of Efe Çiftci.
Committed on 18/06/2025 at 06:58.
Pushed by nicolasfella into branch 'release/25.04'.

Fix tea remove button in settings

This commit fixes an issue where the Remove button in the Settings window incorrectly modified entries in the tea list. When an item is removed from `m_model`, the list of selected indices briefly becomes empty. This triggers unintended actions, including a call to `Tea::setName()` with an empty `name`, which causes the next entry in `m_model` to be renamed.

This MR resolves the issue by ensuring `SettingsDialog::updateSelection()` does not alter the tea list when items exist but no indices are selected. The current solution may not be the most elegant but is functional. Tested by observing behavior of Add, Move, and Remove buttons.
(cherry picked from commit 6537191f3087ba86b7621682fe62630ba25cea9d)

M  +3    -0    src/settings.cpp

https://invent.kde.org/utilities/kteatime/-/commit/fd62006dfd3d62cf2137e4c0ab1c75580191d938