GSoC 21 KMyMoney: Replacing member functions of WebPriceQuote
Ralf Habacker
ralf.habacker at freenet.de
Mon Jul 12 15:48:22 BST 2021
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
More information about the Kde-finance-apps
mailing list