- Use new synchronized change-and-save-config methods

to eliminate races with ReadConfigJob
This commit is contained in:
zzz
2012-01-18 01:54:34 +00:00
parent 9755338f73
commit 95329803a9
20 changed files with 162 additions and 135 deletions

View File

@@ -22,11 +22,12 @@ public class ConfigUIHandler extends FormHandler {
if (_config == null)
return;
String oldTheme = _context.getProperty(CSSHelper.PROP_THEME_NAME, CSSHelper.DEFAULT_THEME);
boolean ok;
if (_config.equals("default")) // obsolete
_context.router().removeConfigSetting(CSSHelper.PROP_THEME_NAME);
ok = _context.router().saveConfig(CSSHelper.PROP_THEME_NAME, null);
else
_context.router().setConfigSetting(CSSHelper.PROP_THEME_NAME, _config);
if (_context.router().saveConfig()) {
ok = _context.router().saveConfig(CSSHelper.PROP_THEME_NAME, _config);
if (ok) {
if (!oldTheme.equals(_config))
addFormNotice(_("Theme change saved.") +
" <a href=\"configui\">" +