From 9acb9fd2550d349d55a0f192a2a87cfcc9d43f45 Mon Sep 17 00:00:00 2001 From: George Angelopoulos Date: Sun, 30 Jul 2017 18:34:33 +0200 Subject: [PATCH] add backwards compatibility for icon_folders option Existing configurations will continue to work but now print a warning. New, icon_path option takes precedence if both options are used. If icon_folders option is used, its usage string also appears in --help output. --- src/settings.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/settings.c b/src/settings.c index 8dee163..c7d43e1 100644 --- a/src/settings.c +++ b/src/settings.c @@ -390,9 +390,23 @@ void load_settings(char *cmdline_config_path) "Scale larger icons down to this size, set to 0 to disable" ); + // If the deprecated icon_folders option is used, + // read it and generate its usage string. + if (ini_is_set("global", "icon_folders") || cmdline_is_set("-icon_folders")) { + settings.icon_path = option_get_string( + "global", + "icon_folders", "-icon_folders", icon_path, + "folders to default icons (deprecated, please use 'icon_path' instead)" + ); + fprintf(stderr, "Warning: 'icon_folders' is deprecated, please use 'icon_path' instead.\n"); + } + // Read value and generate usage string for icon_path. + // If icon_path is set, override icon_folder. + // if not, but icon_folder is set, use that instead of the compile time default. settings.icon_path = option_get_string( "global", - "icon_path", "-icon_path", icon_path, + "icon_path", "-icon_path", + settings.icon_path ? settings.icon_path : icon_path, "paths to default icons" );