From c95dd0e68581db4550beb5748511f9e4ef79b54e Mon Sep 17 00:00:00 2001
From: Lars Henriksen <LarsHenriksen@get2net.dk>
Date: Thu, 6 Sep 2018 23:00:59 +0200
Subject: Remove the configuraton variable conf.progress_bar

When loading/saving the configuration file the entry is silently ignored
(which means it is removed by the first save).

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
---
 src/calcurse.h |  1 -
 src/config.c   |  7 ++++++-
 src/custom.c   | 12 ------------
 src/vars.c     |  1 -
 4 files changed, 6 insertions(+), 15 deletions(-)

(limited to 'src')

diff --git a/src/calcurse.h b/src/calcurse.h
index 4f41deb..27337fd 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -268,7 +268,6 @@ struct conf {
 	enum win default_panel;
 	unsigned compact_panels;
 	unsigned system_dialogs;
-	unsigned progress_bar;
 	const char *editor;
 	const char *pager;
 	const char *mergetool;
diff --git a/src/config.c b/src/config.c
index ff66fce..9e13eaf 100644
--- a/src/config.c
+++ b/src/config.c
@@ -112,7 +112,6 @@ static const struct confvar confmap[] = {
 	{"general.confirmquit", CONFIG_HANDLER_BOOL(conf.confirm_quit)},
 	{"general.firstdayofweek", config_parse_first_day_of_week, config_serialize_first_day_of_week, NULL},
 	{"general.periodicsave", CONFIG_HANDLER_UNSIGNED(conf.periodic_save)},
-	{"general.progressbar", CONFIG_HANDLER_BOOL(conf.progress_bar)},
 	{"general.systemdialogs", CONFIG_HANDLER_BOOL(conf.system_dialogs)},
 	{"notification.command", CONFIG_HANDLER_STR(nbar.cmd)},
 	{"notification.notifyall", config_parse_notifyall, config_serialize_notifyall, NULL},
@@ -601,6 +600,12 @@ config_file_walk(config_fn_walk_cb_t fn_cb,
 			WARN_MSG(_("Pre-3.0.0 configuration file format detected, "
 				  "please upgrade running `calcurse-upgrade`."));
 		}
+		/*
+		 * Backwards compatibility for removed configuration options:
+		 * ignored on load, omitted on save.
+		 */
+		if (strcmp(key, "general.progressbar") == 0)
+			continue;
 
 		if (value && (*value == '\0' || *value == '\n')) {
 			/* Backward compatibility mode. */
diff --git a/src/custom.c b/src/custom.c
index 8aa714d..cf1cce5 100644
--- a/src/custom.c
+++ b/src/custom.c
@@ -532,7 +532,6 @@ enum {
 	CONFIRM_QUIT,
 	CONFIRM_DELETE,
 	SYSTEM_DIAGS,
-	PROGRESS_BAR,
 	FIRST_DAY_OF_WEEK,
 	OUTPUT_DATE_FMT,
 	INPUT_DATE_FMT,
@@ -554,7 +553,6 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
 		"general.confirmquit = ",
 		"general.confirmdelete = ",
 		"general.systemdialogs = ",
-		"general.progressbar = ",
 		"general.firstdayofweek = ",
 		"format.outputdate = ",
 		"format.inputdate = ",
@@ -629,13 +627,6 @@ static void print_general_option(int i, WINDOW *win, int y, int hilt, void *cb_d
 			  _("(if set to YES, messages about loaded "
 			    "and saved data will be displayed)"));
 		break;
-	case PROGRESS_BAR:
-		print_bool_option_incolor(win, conf.progress_bar, y,
-					  XPOS + strlen(opt[PROGRESS_BAR]));
-		mvwaddstr(win, y + 1, XPOS,
-			  _("(if set to YES, progress bar will be displayed "
-			    "when saving data)"));
-		break;
 	case FIRST_DAY_OF_WEEK:
 		custom_apply_attr(win, ATTR_HIGHEST);
 		mvwaddstr(win, y, XPOS + strlen(opt[FIRST_DAY_OF_WEEK]),
@@ -761,9 +752,6 @@ static void general_option_edit(int i)
 	case SYSTEM_DIAGS:
 		conf.system_dialogs = !conf.system_dialogs;
 		break;
-	case PROGRESS_BAR:
-		conf.progress_bar = !conf.progress_bar;
-		break;
 	case FIRST_DAY_OF_WEEK:
 		ui_calendar_change_first_day_of_week();
 		break;
diff --git a/src/vars.c b/src/vars.c
index d3bc676..3a8019a 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -127,7 +127,6 @@ void vars_init(void)
 	conf.default_panel = CAL;
 	conf.compact_panels = 0;
 	conf.system_dialogs = 1;
-	conf.progress_bar = 1;
 	strncpy(conf.output_datefmt, "%D", 3);
 	conf.input_datefmt = 1;
 	conf.heading_pos = RIGHT;
-- 
cgit v1.2.3-70-g09d2