mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Fix setting browser related values to customData (#13026)
Co-authored-by: varjolintu <sami.vanttinen@ahmala.org>
This commit is contained in:
parent
ec034eaf7d
commit
6f6076ab81
2 changed files with 16 additions and 12 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2024 KeePassXC Team <team@keepassxc.org>
|
||||
* Copyright (C) 2026 KeePassXC Team <team@keepassxc.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -158,7 +158,6 @@ void CustomData::copyDataFrom(const CustomData* other)
|
|||
|
||||
m_data = other->m_data;
|
||||
|
||||
updateLastModified();
|
||||
emit reset();
|
||||
emitModified();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -350,25 +350,31 @@ void EditEntryWidget::updateBrowser()
|
|||
return;
|
||||
}
|
||||
|
||||
auto changeValue = [&](const QString& option, const bool newValue) {
|
||||
// If value is false and no customData exists, make no edits
|
||||
if (!m_customData->hasKey(option) && !newValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If customData exists, set the value
|
||||
m_customData->set(option, (newValue ? TRUE_STR : FALSE_STR));
|
||||
};
|
||||
|
||||
// Only update the custom data if no group level settings are used (checkbox is enabled)
|
||||
if (m_browserUi->hideEntryCheckbox->isEnabled()) {
|
||||
auto hide = m_browserUi->hideEntryCheckbox->isChecked();
|
||||
m_customData->set(BrowserService::OPTION_HIDE_ENTRY, (hide ? TRUE_STR : FALSE_STR));
|
||||
changeValue(BrowserService::OPTION_HIDE_ENTRY, m_browserUi->hideEntryCheckbox->isChecked());
|
||||
}
|
||||
|
||||
if (m_browserUi->skipAutoSubmitCheckbox->isEnabled()) {
|
||||
auto skip = m_browserUi->skipAutoSubmitCheckbox->isChecked();
|
||||
m_customData->set(BrowserService::OPTION_SKIP_AUTO_SUBMIT, (skip ? TRUE_STR : FALSE_STR));
|
||||
changeValue(BrowserService::OPTION_SKIP_AUTO_SUBMIT, m_browserUi->skipAutoSubmitCheckbox->isChecked());
|
||||
}
|
||||
|
||||
if (m_browserUi->onlyHttpAuthCheckbox->isEnabled()) {
|
||||
auto onlyHttpAuth = m_browserUi->onlyHttpAuthCheckbox->isChecked();
|
||||
m_customData->set(BrowserService::OPTION_ONLY_HTTP_AUTH, (onlyHttpAuth ? TRUE_STR : FALSE_STR));
|
||||
changeValue(BrowserService::OPTION_ONLY_HTTP_AUTH, m_browserUi->onlyHttpAuthCheckbox->isChecked());
|
||||
}
|
||||
|
||||
if (m_browserUi->notHttpAuthCheckbox->isEnabled()) {
|
||||
auto notHttpAuth = m_browserUi->notHttpAuthCheckbox->isChecked();
|
||||
m_customData->set(BrowserService::OPTION_NOT_HTTP_AUTH, (notHttpAuth ? TRUE_STR : FALSE_STR));
|
||||
changeValue(BrowserService::OPTION_NOT_HTTP_AUTH, m_browserUi->notHttpAuthCheckbox->isChecked());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -810,7 +816,6 @@ void EditEntryWidget::addKeyToAgent()
|
|||
|
||||
if (!sshAgent()->addIdentity(key, settings, m_db->uuid())) {
|
||||
showMessage(sshAgent()->errorString(), MessageWidget::Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -824,7 +829,6 @@ void EditEntryWidget::removeKeyFromAgent()
|
|||
|
||||
if (!sshAgent()->removeIdentity(key)) {
|
||||
showMessage(sshAgent()->errorString(), MessageWidget::Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1080,6 +1084,7 @@ void EditEntryWidget::setForms(Entry* entry, bool restore)
|
|||
setupBrowser();
|
||||
}
|
||||
|
||||
m_browserSettingsChanged = false;
|
||||
auto hideEntriesCheckBoxEnabled = true;
|
||||
auto skipAutoSubmitCheckBoxEnabled = true;
|
||||
auto onlyHttpAuthCheckBoxEnabled = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue