when copying A3 config files, consider that the user may have /config rather than...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 Apr 2015 23:02:42 +0000 (19:02 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 2 Apr 2015 23:03:06 +0000 (19:03 -0400)
This will be true if they have been self-building from git or
using nightlies.

libs/ardour/globals.cc

index 6e16d5480fff557d3d6a3d486fed7d27975c2bdb..288e69dc9e55161c221f93b6a7ca8d4cfcd4ccff 100644 (file)
@@ -270,9 +270,20 @@ copy_configuration_files (string const & old_dir, string const & new_dir, int ol
 
                copy_file (old_name, new_name);
 
-               /* can only copy ardour.rc - UI config is not compatible */
+               /* can only copy ardour.rc/config - UI config is not compatible */
+
+               /* users who have been using git/nightlies since the last
+                * release of 3.5 will have $CONFIG/config rather than
+                * $CONFIG/ardour.rc. Pick up the newer "old" config file,
+                * to avoid confusion.
+                */
+               
+               string old_name = Glib::build_filename (old_dir, X_("config"));
+
+               if (!Glib::file_test (old_name, Glib::FILE_TEST_EXISTS)) {
+                       old_name = Glib::build_filename (old_dir, X_("ardour.rc"));
+               }
 
-               old_name = Glib::build_filename (old_dir, X_("ardour.rc"));
                new_name = Glib::build_filename (new_dir, X_("config"));
 
                copy_file (old_name, new_name);