@@ -351,25 +351,31 @@ void EditEntryWidget::updateBrowser()
351351 return ;
352352 }
353353
354+ auto changeValue = [&](const QString& option, const bool newValue) {
355+ // If value is false and no customData exists, make no edits
356+ if (!m_customData->hasKey (option) && !newValue) {
357+ return ;
358+ }
359+
360+ // If customData exists, set the value
361+ m_customData->set (option, (newValue ? TRUE_STR : FALSE_STR));
362+ };
363+
354364 // Only update the custom data if no group level settings are used (checkbox is enabled)
355365 if (m_browserUi->hideEntryCheckbox ->isEnabled ()) {
356- auto hide = m_browserUi->hideEntryCheckbox ->isChecked ();
357- m_customData->set (BrowserService::OPTION_HIDE_ENTRY, (hide ? TRUE_STR : FALSE_STR));
366+ changeValue (BrowserService::OPTION_HIDE_ENTRY, m_browserUi->hideEntryCheckbox ->isChecked ());
358367 }
359368
360369 if (m_browserUi->skipAutoSubmitCheckbox ->isEnabled ()) {
361- auto skip = m_browserUi->skipAutoSubmitCheckbox ->isChecked ();
362- m_customData->set (BrowserService::OPTION_SKIP_AUTO_SUBMIT, (skip ? TRUE_STR : FALSE_STR));
370+ changeValue (BrowserService::OPTION_SKIP_AUTO_SUBMIT, m_browserUi->skipAutoSubmitCheckbox ->isChecked ());
363371 }
364372
365373 if (m_browserUi->onlyHttpAuthCheckbox ->isEnabled ()) {
366- auto onlyHttpAuth = m_browserUi->onlyHttpAuthCheckbox ->isChecked ();
367- m_customData->set (BrowserService::OPTION_ONLY_HTTP_AUTH, (onlyHttpAuth ? TRUE_STR : FALSE_STR));
374+ changeValue (BrowserService::OPTION_ONLY_HTTP_AUTH, m_browserUi->onlyHttpAuthCheckbox ->isChecked ());
368375 }
369376
370377 if (m_browserUi->notHttpAuthCheckbox ->isEnabled ()) {
371- auto notHttpAuth = m_browserUi->notHttpAuthCheckbox ->isChecked ();
372- m_customData->set (BrowserService::OPTION_NOT_HTTP_AUTH, (notHttpAuth ? TRUE_STR : FALSE_STR));
378+ changeValue (BrowserService::OPTION_NOT_HTTP_AUTH, m_browserUi->notHttpAuthCheckbox ->isChecked ());
373379 }
374380}
375381
@@ -803,7 +809,6 @@ void EditEntryWidget::addKeyToAgent()
803809
804810 if (!sshAgent ()->addIdentity (key, settings, m_db->uuid ())) {
805811 showMessage (sshAgent ()->errorString (), MessageWidget::Error);
806- return ;
807812 }
808813}
809814
@@ -817,7 +822,6 @@ void EditEntryWidget::removeKeyFromAgent()
817822
818823 if (!sshAgent ()->removeIdentity (key)) {
819824 showMessage (sshAgent ()->errorString (), MessageWidget::Error);
820- return ;
821825 }
822826}
823827
@@ -1040,6 +1044,7 @@ void EditEntryWidget::setForms(Entry* entry, bool restore)
10401044 setupBrowser ();
10411045 }
10421046
1047+ m_browserSettingsChanged = false ;
10431048 auto hideEntriesCheckBoxEnabled = true ;
10441049 auto skipAutoSubmitCheckBoxEnabled = true ;
10451050 auto onlyHttpAuthCheckBoxEnabled = true ;
0 commit comments