Save settings immediately to disk when applied
* See https://github.com/Martchus/syncthingtray/issues/59 * QCoreApplication::aboutToQuit() does not work reliably but terminating only at the end of the session is a common use-case for the tray application. So workaround the problem by saving the settings immediately. * The plasmoid already does this anyways.
This commit is contained in:
parent
d50e78be29
commit
1a1b907f15
|
@ -10,7 +10,7 @@ set(META_APP_CATEGORIES "Network;FileTransfer")
|
|||
set(META_GUI_OPTIONAL false)
|
||||
set(META_VERSION_MAJOR 0)
|
||||
set(META_VERSION_MINOR 10)
|
||||
set(META_VERSION_PATCH 1)
|
||||
set(META_VERSION_PATCH 2)
|
||||
set(META_VERSION_EXACT_SONAME ON)
|
||||
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
||||
|
||||
|
|
|
@ -212,6 +212,12 @@ void TrayWidget::showSettingsDialog()
|
|||
if (!s_settingsDlg) {
|
||||
s_settingsDlg = new SettingsDialog(&m_connection, m_dialogParent.get());
|
||||
connect(s_settingsDlg, &SettingsDialog::applied, &TrayWidget::applySettingsOnAllInstances);
|
||||
|
||||
// save settings to disk when applied
|
||||
// note: QCoreApplication::aboutToQuit() does not work reliably but terminating only at the
|
||||
// end of the session is a common use-case for the tray application. So workaround this
|
||||
// by simply saving the settings immediately.
|
||||
connect(s_settingsDlg, &SettingsDialog::applied, &Settings::save);
|
||||
}
|
||||
centerWidget(s_settingsDlg);
|
||||
showDialog(s_settingsDlg);
|
||||
|
|
Loading…
Reference in New Issue