<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>David,</p>
<p>Note I'm working in 5.1 with the old ledger, and as far as I can
tell, that property isn't there, or at least not used. I'm
working on <a class="moz-txt-link-freetext"
href="https://bugs.kde.org/show_bug.cgi?id=349767">https://bugs.kde.org/show_bug.cgi?id=349767</a>
- a way to easily switch the ledger between Investment and
Brokerage account. I was thinking of adding something like that,
but there is still one problem in that while an investment account
can have only one brokerage account, a checking account can be the
brokerage account for several different investment accounts. (In
reality, not currently possible in 5.1.) I'm not sure how this
should be handled, unless there will be a LIST of zero or more
investment accounts.<br>
</p>
<div class="moz-cite-prefix">On 6/22/22 10:47, Dawid Wrobel via
KMyMoney-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CANO8mVLNvOSseOARE_ZCKVBuR00ucNDyPugAZUwGn08Lvw5JLg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Jack,
<div><br>
</div>
<div>I believe that originally the 'kmm-brokerage-account'
property was supposed to be used to look-up the linked-up
brokerage account id.<br>
<div>This, however, does not seem to work, see:</div>
<div><a href="https://bugs.kde.org/show_bug.cgi?id=329701"
moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.kde.org/show_bug.cgi?id=329701</a></div>
<div>and <a
href="https://bugs.kde.org/show_bug.cgi?id=350360"
moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.kde.org/show_bug.cgi?id=350360</a></div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jun 22, 2022 at 4:13
PM Jack via KMyMoney-devel <<a
href="mailto:kmymoney-devel@kde.org" moz-do-not-send="true"
class="moz-txt-link-freetext">kmymoney-devel@kde.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On
6/22/22 02:18, Thomas Baumgart via KMyMoney-devel wrote:<br>
> On Dienstag, 21. Juni 2022 22:46:35 CEST Jack via
KMyMoney-devel wrote:<br>
>> I'm trying to find an way to easily switch between an
investment<br>
>> account and it's brokerage account. I have figured
out how to test for<br>
>> the two types of accounts (testing the .accountType()
or looking for "<br>
>> (Brokerage)" at the end of the name.) However, I
don't see any way to<br>
>> look up an account by name. Does this actually
require looping through<br>
>> all accounts and testing if the name matches?<br>
> In master you can do this:<br>
><br>
> QString accountName;<br>
> auto account =
MyMoneyFile::instance()->accountsModel()->itemByName(accountName);<br>
><br>
> or if you want to stick with the model type access to
the data:<br>
><br>
> auto idx =
MyMoneyFile::instance()->accountsModel()->indexByName(accountName);<br>
> auto name =
idx.data(eMyMoney::Model::AccountNameRole).toString();<br>
><br>
> which in fact does the looping for you in
AccountsModel::indexListByName().<br>
><br>
> Hope that helps.<br>
<br>
Thanks. Either of those is shorter than what I came up with,
although <br>
mine does seem to work (looking with gdb.)<br>
<br>
My current problem is that I'm trying to add a "go to
brokerage" line <br>
after the "go to account" and "go to payee" menu choices, but
it is not <br>
appearing in any of the menus (either main menu or context
menu.) I <br>
can't find anywhere in the code where either of the old ones
appears <br>
where I haven't added the new one, so I don't know what I am
missing.<br>
<br>
Jack<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">Best Regards,
<div>Dawid Wrobel</div>
</div>
</div>
</blockquote>
</body>
</html>