https://bugs.kde.org/show_bug.cgi?id=513676

--- Comment #7 from Nate Graham <[email protected]> ---
Git commit a801b7a50d33a02a0e2b4c7fc54e7f93dc234e09 by Nate Graham, on behalf
of Harald Sitter.
Committed on 27/01/2026 at 17:40.
Pushed by ngraham into branch 'Plasma/6.6'.

discoverobject: do not change amounts during start() & refine assertion

we actually have somewhat different expectations depending on how the
refresh was called. when called as part of start we strictly expect no
change. when called by the remove function we strictly expect a decrease
of exactly one.

this actually works in our favor because we can now untangle the +1
mess.

start() now calls refreshInfo(nullptr) to bypass the amount update.
meanwhile the actual remove signal will pass a valid transaction and
allow us to subtract **exactly** 1 from the oldAmount. this then means
we can simply assert that the oldAmount isn't 0 to prevent an underflow.

this does now require additional tracking of transaction adding! to be
added in a follow-up commit
(cherry picked from commit 1d95622767552f0f41a3c8f5ddcea2614dd0c164)

M  +12   -8    discover/DiscoverObject.cpp

https://invent.kde.org/plasma/discover/-/commit/a801b7a50d33a02a0e2b4c7fc54e7f93dc234e09

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to