[PATCH 3/4] wmaker/WPrefs: Remove legacy support for deprecated apercus.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Replaced by minipreviews in December 2014.  Over two years have passed.
---
 WPrefs.app/Icons.c | 33 ---------------------------------
 src/defaults.c     | 48 ------------------------------------------------
 2 files changed, 81 deletions(-)

diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c
index e68da56..ad4cfc6 100644
--- a/WPrefs.app/Icons.c
+++ b/WPrefs.app/Icons.c
@@ -60,8 +60,6 @@ typedef struct _Panel {
 
 	CallbackRec callbacks;
 
-	Bool have_legacy_apercu;
-
 	WMWidget *parent;
 
 	WMFrame *posF;
@@ -201,14 +199,6 @@ static void showData(_Panel * panel)
 
 	/* Mini-Previews for Icons */
 
-	/*
-	 * Backward Compatibility:
-	 * These settings changed names after 0.95.6, so to avoid breaking user's
-	 * config we still support the old names, and silently convert them to the
-	 * new settings
-	 * This hack should be kept for at least 2 years, that means >= 2017.
-	 */
-	panel->have_legacy_apercu = False;
 	str = GetStringForKey("MiniwindowPreviewBalloons");
 	if (str != NULL) {
 		/* New names found, use them in priority */
@@ -220,25 +210,6 @@ static void showData(_Panel * panel)
 		} else {
 			i = minipreview_minimum_size;
 		}
-	} else {
-		/* No new names, try the legacy names */
-		b = GetBoolForKey("MiniwindowApercuBalloons");
-		if (b) {
-			panel->have_legacy_apercu = True;
-			i = GetIntegerForKey("ApercuSize");
-
-			/*
-			 * In the beginning, the option was coded as a multiple of the icon
-			 * size; then it was converted to pixel size
-			 */
-			if (i < 24)
-				i *= GetIntegerForKey("IconSize");
-
-			if (i <= minipreview_minimum_size)
-				i = minipreview_minimum_size + 1;	/* +1 to not display as "off" */
-		} else {
-			i = minipreview_minimum_size;
-		}
 	}
 	WMSetSliderValue(panel->minipreview.slider, i);
 	minipreview_slider_changed(panel->minipreview.slider, panel);
@@ -478,10 +449,6 @@ static void storeData(_Panel * panel)
 		}
 		SetIntegerForKey(i, "MiniPreviewSize");
 	}
-	if (panel->have_legacy_apercu) {
-		RemoveObjectForKey("MiniwindowApercuBalloons");
-		RemoveObjectForKey("ApercuSize");
-	}
 
 	for (i = 0; i < wlengthof(icon_animation); i++) {
 		if (WMGetButtonSelected(panel->animB[i])) {
diff --git a/src/defaults.c b/src/defaults.c
index f83f6a5..19d230c 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -313,17 +313,6 @@ static WOptionEnumeration seDragMaximizedWindow[] = {
 };
 
 /*
- * Backward Compatibility:
- * The Mini-Previews were introduced in 0.95.6 under the name "Apercu".
- * For compatibility, we still support the old names in configuration files,
- * which are loaded in this structure, so this should stay for at least
- * 2 years (that means until 2017) */
-static struct {
-	char enable;
-	int  size;
-} legacy_minipreview_config;
-
-/*
  * ALL entries in the tables bellow, NEED to have a default value
  * defined, and this value needs to be correct.
  */
@@ -527,17 +516,6 @@ WDefaultEntry optionList[] = {
 	{"IgnoreGtkHints", "NO", NULL,
 	    &wPreferences.ignore_gtk_decoration_hints, getBool, NULL, NULL, NULL},
 
-	/*
-	 * Backward Compatibility:
-	 * The Mini-Previews were introduced in 0.95.6 under the name "Apercu".
-	 * For compatibility, we still support the old names in configuration files,
-	 * so this should stay for at least 2 years (that means until 2017)
-	 */
-	{"MiniwindowApercuBalloons", "NO", NULL,
-	    &legacy_minipreview_config.enable, getBool, NULL, NULL, NULL},
-	{"ApercuSize", "0", NULL,
-	    &legacy_minipreview_config.size, getInt, NULL, NULL, NULL},
-
 	/* style options */
 
 	{"MenuStyle", "normal", seMenuStyles,
@@ -1222,32 +1200,6 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
 		}
 	}
 
-	/*
-	 * Backward Compatibility:
-	 * Support the old setting names for Apercu, now called Mini-Preview
-	 *
-	 * This code should probably stay for at least 2 years, you should not consider removing
-	 * it before year 2017
-	 */
-	if (legacy_minipreview_config.enable) {
-		wwarning(_("your configuration is using old syntax for Mini-Preview settings; consider running WPrefs.app to update"));
-		wPreferences.miniwin_preview_balloon = legacy_minipreview_config.enable;
-
-		if (legacy_minipreview_config.size > 0) {
-			/*
-			 * the option 'ApercuSize' used to be coded as a multiple of the icon size in v0.95.6
-			 * it is now expressed directly in pixels, but to avoid breaking user's setting we check
-			 * for old coding and convert it now.
-			 */
-			if (legacy_minipreview_config.size < 24) {
-				/* 24 is the minimum icon size proposed in WPref's settings */
-				wPreferences.minipreview_size = legacy_minipreview_config.size * wPreferences.icon_size;
-			} else {
-				wPreferences.minipreview_size = legacy_minipreview_config.size;
-			}
-		}
-	}
-
 	if (needs_refresh != 0 && !scr->flags.startup) {
 		int foo;
 
-- 
2.7.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.