Skip to content

Commit

Permalink
conf-file-merge: Also merge hidden modes
Browse files Browse the repository at this point in the history
Keep the hidden modes info so the information does not
get lost between merges of the conf file. Will also keep
from them popping up in the UI when not expected.

Signed-off-by: Philippe De Swert <philippedeswert@gmail.com>
  • Loading branch information
philippedeswert committed Dec 15, 2015
1 parent a613cd6 commit 1fd247a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/usb_moded-config.c
Expand Up @@ -535,7 +535,7 @@ int conf_file_merge(void)
{
GDir *confdir;
struct stat fileinfo, dir;
char *mode = 0, *ip = 0, *gateway = 0, *udev = 0;
char *mode = 0, *ip = 0, *gateway = 0, *udev = 0, *hide = 0;
gchar *filename_full;
const gchar *filename;
GString *keyfile_string = NULL;
Expand Down Expand Up @@ -595,8 +595,11 @@ int conf_file_merge(void)
mode = get_mode_setting();
/* store udev path (especially important for the upgrade path */
udev = find_udev_path();
/* store network info */
ip = get_conf_string(NETWORK_ENTRY, NETWORK_IP_KEY);
gateway = get_conf_string(NETWORK_ENTRY, NETWORK_GATEWAY_KEY);
/* store hidden modes */
hide = get_hidden_modes();
continue;
}
/* load contents of file, if it fails skip to next one */
Expand Down Expand Up @@ -637,6 +640,9 @@ int conf_file_merge(void)
set_network_setting(NETWORK_IP_KEY, ip);
if(gateway)
set_network_setting(NETWORK_GATEWAY_KEY, gateway);
/* re-add hidden modes info */
if(hide)
set_hide_mode_setting(hide);
}
else
ret = 1;
Expand Down

0 comments on commit 1fd247a

Please sign in to comment.