Bug 471210 - New transaction and split editor category widget fails to reselect same category correctly
Summary: New transaction and split editor category widget fails to reselect same categ...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-18 23:43 UTC by Cory F Cohen
Modified: 2024-04-08 19:26 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cory F Cohen 2023-06-18 23:43:55 UTC
SUMMARY
In the new transaction editor or split editor re-selecting the same category does not result in the correct category being selected.

STEPS TO REPRODUCE
1. Open or create and transaction and set a category.
2. Without saving, activate the category widget pull-down and select the same category again.

OBSERVED RESULT
The selected category is one of the standard categories (Income, Expense, Equity) etc.  And not the selected category. 

EXPECTED RESULT
The transaction would return the state before the category widget was activated (with the correct category selected).

ADDITIONAL INFORMATION
I'm reporting this bug because I found it while testing my previously opened ticket involving the AccountCombo widget.  I thought it might be relevant to design decisions involving that widget.  I investigated enough to conclude that neither NewTransactionEditor::Private::categoryChanged() nor KMyMoneyAccountComboSplitHelper::updateWidget() was being called in response to the non-changed category widget, so I'm not sure what that means about the cause of the bug.
Comment 1 Jack 2023-06-18 23:49:54 UTC
I don't have a reference handy, but there has been a previous report that once you select an item in one of the drop-downs (such as category) whether it is actually selected depends on how you proceed.  I believe hitting Enter does select correctly, but just hitting Tab does not.  I can't tell if that's what you are reporting here, or something else, and I suspect the distinction may be subtle.
Comment 2 Thomas Baumgart 2024-04-08 19:26:50 UTC
Git commit 53b9d1324a7074426aabb4b9b1fc68815aea27a4 by Thomas Baumgart.
Committed on 08/04/2024 at 19:26.
Pushed by tbaumgart into branch 'master'.

Keep account selection in case it is not changed

Since the QComboBox popup view in general only supports simple lists and
is based on the selection of rows, it did not pick up the row as part of
an item the subtree but used the item on the top level of the model with
the same row instead, but only if there was no change in selection.

This change takes care of supporting a tree view as popup with the
underlying account model.
FIXED-IN: 5.2

M  +15   -2    kmymoney/widgets/kmymoneyaccountcombo.cpp
M  +1    -0    kmymoney/widgets/kmymoneyaccountcombo.h

https://invent.kde.org/office/kmymoney/-/commit/53b9d1324a7074426aabb4b9b1fc68815aea27a4