Originally reported as part of bug 390406 (switching between ledger and investment views did not always show the same account) the issue here is that if you select the Ledger view without having selected and account (in some other view) it displays a "arbitrary" account. (Arbitrary in the sense I don't know how it chooses, but it might just be the account with the lowest internal ID.) In that bug, it displayed an old, closed account, which probably should not be shown at all. I suggest the preferred display should be an empty ledger, until an account it actually chosen, but if a random/arbitrary account is displayed, it should be one of the preferred accounts, if there are any, but in no case should a closed account be displayed. I don't suppose it really matters much if this is considered a minor bug or a wishlist, but it should rarely be an issue, once the other bug is fixed.
I never saw this problem since all my files have at least one preferred account setup and the first of them shown in the combo box is the one that is selected. Turning off all those preferred account settings I was able to duplicate the problem.
I just checked kmm 4.8.1, in my case the acct displayed does seem to be the one with the lowest internal ID. Could kmm5 just do the same? I think this is how Investments view implicitly selects the oldest account as the default. I have no preferred accounts.
Git commit 6a5731e0707a14924d80db3c2e9d8913cf593665 by Thomas Baumgart. Committed on 06/03/2018 at 20:04. Pushed by tbaumgart into branch '5.0'. Select first account in combo box drop down After program start the first non-invest account found in the accounts model was used to be loaded into the ledger if no account was selected otherwise. This has been changed so that the first non-closed, non-investment account in the combo-box at the top of the ledger view. FIXED-IN: 5.0.1 M +3 -4 kmymoney/views/kgloballedgerview_p.h https://commits.kde.org/kmymoney/6a5731e0707a14924d80db3c2e9d8913cf593665
I just cherry-picked your commit 6a5731e0 and it now looks good! Sorry for all the fuss about a minor issue. This was the last of my bugs, but I'll keep looking.