kget: create password store if required for saving the web interface password but not created yet

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-09-20 11:05:29 +03:00
parent 8348fc1702
commit a0a50f2180

View file

@ -49,9 +49,16 @@ void DlgWebinterface::readConfig()
void DlgWebinterface::saveSettings()
{
if (m_passwdstore && m_passwdstore->openStore(winId())) {
if (kcfg_WebinterfaceEnabled->isChecked()) {
if (!m_passwdstore) {
m_passwdstore = new KPasswdStore(this);
m_passwdstore->setStoreID("KGet");
}
if (m_passwdstore->openStore(winId())) {
m_passwdstore->storePasswd("Webinterface", webinterfacePwd->text(), winId());
}
}
emit saved();
}