[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:       Ralf Habacker <ralf.habacker () freenet ! de>
Date:       2021-07-12 14:48:22
Message-ID: f6978476-541c-882a-c4dd-f0943b83da9a () freenet ! de
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

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