[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-finance-apps
Subject:    Re: GSoC 21 KMyMoney: Replacing member functions of WebPriceQuote
From:       Suraj Kumar Mahto via Kde-finance-apps <kde-finance-apps () kde ! org>
Date:       2021-07-30 8:41:17
Message-ID: CAEDvbQC-H-eaS3VEPZzrxT4rnoAegn4Qw7vpZ=1VeQvWRMz_Bw () mail ! gmail ! com
[Download RAW message or body]

Hello, I am unable to figure out why I can't access public members(
https://invent.kde.org/surajsloth/alkimia/-/blob/gsoc21/src/alkonlinequotesource.cpp#L195)
of AlkOnlineQuoteSource::Private in kmymoney (kequitypriceupdatedlg.cpp)
for an AlkOnlineQuoteSource object.

Regards
Suraj Kumar Mahto

On Mon, Jul 12, 2021 at 8:18 PM Ralf Habacker <ralf.habacker@freenet.de>
wrote:

> Am 10.07.21 um 19:43 schrieb Suraj Kumar Mahto:
> > Hello,
> >
> https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274
> > <
> https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274
> >
> > Here |kmm-online-source is of type QString but AlkOnlineQuoteSource ctor
> > accepts const AlkOnlineQuoteSource& as argument(other ctors either
> > accepts no argument or more than one argument). For that should I write
> > a new ctor for that use case or modify the existing one or am I missing
> > something else?
>
> You should use the the constructor with two parameters and provide the
> currently used profile as second parameter
>
>
>  AlkOnlineQuoteSource onlineSource(inv.value("kmm-online-source"),
> AlkOnlineQuotesProfileManager::instance().profiles().first());
>
>
> You need to ensure, that the used profile has been added to the
> AlkOnlineQuoteProfileManager. I suggest to do this in the KMyMoneyApp
> constructor
>
> https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/kmymoney.cpp#L1336
>
> as
>
> KMyMoneyApp::KMyMoneyApp(QWidget* parent) :
>     KXmlGuiWindow(parent),
>     d(new Private(this))
> {
> +  AlkOnlineQuotesProfileManager::instance().addProfile(new
> AlkOnlineQuotesProfile("kmymoney5",
> AlkOnlineQuotesProfile::Type::KMyMoney5, "kmymoney-quotes.knsrc"));
> +  AlkOnlineQuotesProfileManager::instance().setWebPageEnabled(true);
>
> Ralf
>

[Attachment #3 (text/html)]

<div dir="ltr"><div><div>Hello, I am unable to figure out why I can&#39;t access \
public members(<a href="https://invent.kde.org/surajsloth/alkimia/-/blob/gsoc21/src/al \
konlinequotesource.cpp#L195">https://invent.kde.org/surajsloth/alkimia/-/blob/gsoc21/src/alkonlinequotesource.cpp#L195</a>) \
of AlkOnlineQuoteSource::Private in kmymoney (kequitypriceupdatedlg.cpp) for an \
AlkOnlineQuoteSource object.<br><br></div>Regards<br></div>Suraj Kumar \
Mahto<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, \
Jul 12, 2021 at 8:18 PM Ralf Habacker &lt;<a \
href="mailto:ralf.habacker@freenet.de">ralf.habacker@freenet.de</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am 10.07.21 um 19:43 \
schrieb Suraj Kumar Mahto:<br> &gt; Hello,<br>
&gt; <a href="https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274" \
rel="noreferrer" target="_blank">https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274</a><br>
 &gt; &lt;<a href="https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274" \
rel="noreferrer" target="_blank">https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/dialogs/kequitypriceupdatedlg.cpp#L274</a>&gt;<br>
 &gt; Here |kmm-online-source is of type QString but AlkOnlineQuoteSource ctor<br>
&gt; accepts const AlkOnlineQuoteSource&amp; as argument(other ctors either<br>
&gt; accepts no argument or more than one argument). For that should I write<br>
&gt; a new ctor for that use case or modify the existing one or am I missing<br>
&gt; something else?<br>
<br>
You should use the the constructor with two parameters and provide the<br>
currently used profile as second parameter<br>
<br>
<br>
  AlkOnlineQuoteSource onlineSource(inv.value(&quot;kmm-online-source&quot;),<br>
AlkOnlineQuotesProfileManager::instance().profiles().first());<br>
<br>
<br>
You need to ensure, that the used profile has been added to the<br>
AlkOnlineQuoteProfileManager. I suggest to do this in the KMyMoneyApp<br>
constructor<br>
<a href="https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/kmymoney.cpp#L1336" \
rel="noreferrer" target="_blank">https://invent.kde.org/office/kmymoney/-/blob/master/kmymoney/kmymoney.cpp#L1336</a><br>
 <br>
as<br>
<br>
KMyMoneyApp::KMyMoneyApp(QWidget* parent) :<br>
      KXmlGuiWindow(parent),<br>
      d(new Private(this))<br>
{<br>
+   AlkOnlineQuotesProfileManager::instance().addProfile(new<br>
AlkOnlineQuotesProfile(&quot;kmymoney5&quot;,<br>
AlkOnlineQuotesProfile::Type::KMyMoney5, &quot;kmymoney-quotes.knsrc&quot;));<br>
+   AlkOnlineQuotesProfileManager::instance().setWebPageEnabled(true);<br>
<br>
Ralf<br>
</blockquote></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic