[evolution] Remove "last-upgraded-version" GSettings key.



commit 62a4fb09124725720aa1bd5d46f594786df92c6f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 2 11:52:01 2012 -0400

    Remove "last-upgraded-version" GSettings key.
    
    AFAICT, this key does nothing useful and only confuses me every time I
    read the EShell migration code.
    
    The "version" key records the most recently used Evolution version.
    That's all we need for migration.  And since downgrading Evolution is
    not supported, we can assume this value will only increase over time.

 data/evolution.convert                  |    1 -
 data/org.gnome.evolution.gschema.xml.in |    9 ++-------
 shell/e-shell-migrate.c                 |   19 -------------------
 3 files changed, 2 insertions(+), 27 deletions(-)
---
diff --git a/data/evolution.convert b/data/evolution.convert
index a1ab31d..1246152 100644
--- a/data/evolution.convert
+++ b/data/evolution.convert
@@ -1,6 +1,5 @@
 [org.gnome.evolution]
 version = /apps/evolution/version
-last-upgraded-version = /apps/evolution/last_version
 disabled-eplugins = /apps/evolution/eplugin/disabled
 
 [org.gnome.evolution.shell]
diff --git a/data/org.gnome.evolution.gschema.xml.in b/data/org.gnome.evolution.gschema.xml.in
index 3e8a2a7..c268811 100644
--- a/data/org.gnome.evolution.gschema.xml.in
+++ b/data/org.gnome.evolution.gschema.xml.in
@@ -2,13 +2,8 @@
   <schema gettext-domain="evolution" id="org.gnome.evolution" path="/org/gnome/evolution/">
     <key name="version" type="s">
       <default>''</default>
-      <_summary>Configuration version</_summary>
-      <_description>The configuration version of Evolution, with major/minor/configuration level (for example "2.6.0").</_description>
-    </key>
-    <key name="last-upgraded-version" type="s">
-      <default>''</default>
-      <_summary>Last upgraded configuration version</_summary>
-      <_description>The last upgraded configuration version of Evolution, with major/minor/configuration level (for example "2.6.0").</_description>
+      <_summary>Previous Evolution version</_summary>
+      <_description>The most recently used version of Evolution, expressed as "major.minor.micro". This is used for data and settings migration from older to newer versions.</_description>
     </key>
     <key name="disabled-eplugins" type="as">
       <default>[]</default>
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index 2fe9cd6..5fb5ca0 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -799,9 +799,7 @@ e_shell_migrate_attempt (EShell *shell)
 	ESEvent *ese;
 	GSettings *settings;
 	gint major, minor, micro;
-	gint last_major, last_minor, last_micro;
 	gint curr_major, curr_minor, curr_micro;
-	gboolean migrated = FALSE;
 	gchar *string;
 
 	g_return_val_if_fail (E_IS_SHELL (shell), FALSE);
@@ -836,23 +834,6 @@ e_shell_migrate_attempt (EShell *shell)
 	g_settings_set_string (settings, "version", string);
 	g_free (string);
 
-	migrated = TRUE;
-
-	/* Try to retrieve the last migrated version from GSettings. */
-	string = g_settings_get_string (settings, "last-upgraded-version");
-	if (migrated || string == NULL || sscanf (string, "%d.%d.%d",
-		&last_major, &last_minor, &last_micro) != 3) {
-		last_major = major;
-		last_minor = minor;
-		last_micro = micro;
-	}
-	g_free (string);
-
-	string = g_strdup_printf (
-		"%d.%d.%d", last_major, last_minor, last_micro);
-	g_settings_set_string (settings, "last-upgraded-version", string);
-	g_free (string);
-
 	g_object_unref (settings);
 
 	/** @Event: Shell attempted upgrade



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]