Commit a7b8df3d authored by spiiroin's avatar spiiroin

[config] Ignore legacy mode=ask setting. JB#45869

For the purpose of preserving runtime modifications values in legacy
configuration files need to be given priority over new style static
configuration files. As a side effect this makes it impossible to
override default mode if it was done via defining mode=ask in the
legacy config file.

Ignore mode=ask if defined in a legacy config file.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 9673330a
......@@ -834,6 +834,23 @@ static bool config_load_legacy_config(GKeyFile *ini)
bool ack = false;
if( access(USB_MODED_STATIC_CONFIG_FILE, F_OK) != -1 )
ack = config_merge_from_file(ini, USB_MODED_STATIC_CONFIG_FILE);
/* A mode=ask setting in legacy config can be either
* something user has selected, or merely configured
* default. As the latter case interferes with evaluation
* of priority ordered static configuration files, ignore
* such settings.
*/
gchar *val = g_key_file_get_value(ini, MODE_SETTING_ENTRY,
MODE_SETTING_KEY, 0);
if( val ) {
if( !g_strcmp0(val, MODE_ASK) ) {
g_key_file_remove_key(ini, MODE_SETTING_ENTRY,
MODE_SETTING_KEY, 0);
}
g_free(val);
}
return ack;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment