aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-migrate.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-07-03 01:27:06 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-07-03 02:19:33 +0800
commit6cda29281f23dbf2ceff713a40c08415266d3c98 (patch)
tree5abc96c1995c2130a258ecfed82531b36bde15fb /shell/e-shell-migrate.c
parent34eeda37d39f37fc88fa93dd7a890424fbcf6d3d (diff)
downloadgsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar.gz
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar.bz2
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar.lz
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar.xz
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.tar.zst
gsoc2013-evolution-6cda29281f23dbf2ceff713a40c08415266d3c98.zip
Record the actual Evolution version after migration.
Not the next stable version. If migration needs to occur multiple times during a development cycle for different reasons, we'll need an accurate last-used-version stamp.
Diffstat (limited to 'shell/e-shell-migrate.c')
-rw-r--r--shell/e-shell-migrate.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c
index b05e8a293f..26901e7177 100644
--- a/shell/e-shell-migrate.c
+++ b/shell/e-shell-migrate.c
@@ -38,6 +38,7 @@
#include "e-util/e-util.h"
#include "es-event.h"
+#include "evo-version.h"
/******************** Begin XDG Base Directory Migration ********************/
/* These are the known EShellBackend names as of Evolution 3.0 */
@@ -799,18 +800,12 @@ e_shell_migrate_attempt (EShell *shell)
ESEvent *ese;
GSettings *settings;
gint major, minor, micro;
- gint curr_major, curr_minor;
gchar *string;
g_return_val_if_fail (E_IS_SHELL (shell), FALSE);
settings = g_settings_new ("org.gnome.evolution");
- if (sscanf (BASE_VERSION, "%d.%d", &curr_major, &curr_minor) != 2) {
- g_warning ("Could not parse BASE_VERSION (%s)", BASE_VERSION);
- return TRUE;
- }
-
shell_migrate_get_version (shell, &major, &minor, &micro);
/* Migrate to XDG Base Directories first, so shell backends
@@ -818,7 +813,7 @@ e_shell_migrate_attempt (EShell *shell)
shell_migrate_to_xdg_base_dirs (shell);
/* This sets the folder permissions to S_IRWXU if needed */
- if (curr_major <= 2 && curr_minor <= 30)
+ if (major <= 2 && minor <= 30)
fix_folder_permissions (e_get_user_data_dir ());
/* Attempt to run migration all the time and let the backend
@@ -828,7 +823,10 @@ e_shell_migrate_attempt (EShell *shell)
/* Record a successful migration. */
string = g_strdup_printf (
- "%d.%d.%d", curr_major, curr_minor, 0);
+ "%d.%d.%d",
+ EVO_MAJOR_VERSION,
+ EVO_MINOR_VERSION,
+ EVO_MICRO_VERSION);
g_settings_set_string (settings, "version", string);
g_free (string);
@@ -845,7 +843,7 @@ e_shell_migrate_attempt (EShell *shell)
e_event_emit (
(EEvent *) ese, "upgrade.done",
(EEventTarget *) es_event_target_new_upgrade (
- ese, curr_major, curr_minor, 0));
+ ese, EVO_MAJOR_VERSION, EVO_MINOR_VERSION, EVO_MICRO_VERSION));
return TRUE;
}