Author: cazfi
Date: Sat Sep 12 09:06:02 2015
New Revision: 29865

URL: http://svn.gna.org/viewcvs/freeciv?rev=29865&view=rev
Log:
Do not migrate settings as if they were from freeciv-2.5, but use the current 
defaults when
starting the client very first time.

See bug #23864

Modified:
    trunk/client/gui-gtk-2.0/gui_main.c
    trunk/client/gui-gtk-3.0/gui_main.c
    trunk/client/gui-qt/gui_main.cpp
    trunk/client/options.c
    trunk/client/options.h

Modified: trunk/client/gui-gtk-2.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/gui_main.c?rev=29865&r1=29864&r2=29865&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/gui_main.c (original)
+++ trunk/client/gui-gtk-2.0/gui_main.c Sat Sep 12 09:06:02 2015
@@ -1517,11 +1517,13 @@
 **************************************************************************/
 static void migrate_options_from_2_5(void)
 {
-  log_normal("Migrating gtk2-client options from freeciv-2.5 options.");
-
-  options.gui_gtk2_fullscreen = options.migrate_fullscreen;
-
-  options.gui_gtk2_migrated_from_2_5 = TRUE; 
+  if (!options.first_boot) {
+    log_normal("Migrating gtk2-client options from freeciv-2.5 options.");
+
+    options.gui_gtk2_fullscreen = options.migrate_fullscreen;
+
+    options.gui_gtk2_migrated_from_2_5 = TRUE;
+  }
 }
 
 /**************************************************************************

Modified: trunk/client/gui-gtk-3.0/gui_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/gui_main.c?rev=29865&r1=29864&r2=29865&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/gui_main.c (original)
+++ trunk/client/gui-gtk-3.0/gui_main.c Sat Sep 12 09:06:02 2015
@@ -1606,11 +1606,13 @@
 **************************************************************************/
 static void migrate_options_from_2_5(void)
 {
-  log_normal("Migrating gtk3-client options from freeciv-2.5 options.");
-
-  options.gui_gtk3_fullscreen = options.migrate_fullscreen;
-
-  options.gui_gtk3_migrated_from_2_5 = TRUE; 
+  if (!options.first_boot) {
+    log_normal("Migrating gtk3-client options from freeciv-2.5 options.");
+
+    options.gui_gtk3_fullscreen = options.migrate_fullscreen;
+
+    options.gui_gtk3_migrated_from_2_5 = TRUE;
+  }
 }
 
 /**************************************************************************

Modified: trunk/client/gui-qt/gui_main.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/gui_main.cpp?rev=29865&r1=29864&r2=29865&view=diff
==============================================================================
--- trunk/client/gui-qt/gui_main.cpp    (original)
+++ trunk/client/gui-qt/gui_main.cpp    Sat Sep 12 09:06:02 2015
@@ -137,11 +137,13 @@
 **************************************************************************/
 static void migrate_options_from_2_5()
 {
-  log_normal("Migrating Qt-client options from freeciv-2.5 options.");
-
-  options.gui_qt_fullscreen = options.migrate_fullscreen;
-
-  options.gui_qt_migrated_from_2_5 = TRUE; 
+  if (!options.first_boot) {
+    log_normal("Migrating Qt-client options from freeciv-2.5 options.");
+
+    options.gui_qt_fullscreen = options.migrate_fullscreen;
+
+    options.gui_qt_migrated_from_2_5 = TRUE;
+  }
 }
 
 /**************************************************************************

Modified: trunk/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=29865&r1=29864&r2=29865&view=diff
==============================================================================
--- trunk/client/options.c      (original)
+++ trunk/client/options.c      Sat Sep 12 09:06:02 2015
@@ -83,6 +83,7 @@
   .use_prev_server = FALSE,
 
 /** Migrations **/
+  .first_boot = FALSE,
   .gui_gtk3_migrated_from_gtk2 = FALSE,
   .gui_sdl2_migrated_from_sdl = FALSE,
   .gui_gtk2_migrated_from_2_5 = FALSE,
@@ -5319,6 +5320,7 @@
     client_option_adjust_defaults();
     options_fully_initialized = TRUE;
     create_default_cma_presets();
+    options.first_boot = TRUE;
     return;
   }
   if (!(sf = secfile_load(name, TRUE))) {

Modified: trunk/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/options.h?rev=29865&r1=29864&r2=29865&view=diff
==============================================================================
--- trunk/client/options.h      (original)
+++ trunk/client/options.h      Sat Sep 12 09:06:02 2015
@@ -101,6 +101,8 @@
   bool save_options_on_exit;
 
 /** Migrations **/
+  bool first_boot; /* There was no ealier options saved.
+                    * This affects some migrations, but not all. */
   bool gui_gtk3_migrated_from_gtk2;
   bool gui_sdl2_migrated_from_sdl;
   bool gui_gtk2_migrated_from_2_5;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to