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

--- Comment #5 from Harald Sitter <[email protected]> ---
Git commit 1d95622767552f0f41a3c8f5ddcea2614dd0c164 by Harald Sitter.
Committed on 26/01/2026 at 15:05.
Pushed by sitter into branch 'master'.

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

M  +12   -8    discover/DiscoverObject.cpp

https://invent.kde.org/plasma/discover/-/commit/1d95622767552f0f41a3c8f5ddcea2614dd0c164

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

Reply via email to