From kde-finance-apps Mon Jul 12 14:48:22 2021 From: Ralf Habacker Date: Mon, 12 Jul 2021 14:48:22 +0000 To: kde-finance-apps Subject: Re: GSoC 21 KMyMoney: Replacing member functions of WebPriceQuote Message-Id: X-MARC-Message: https://marc.info/?l=kde-finance-apps&m=162610130023742 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 > > 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