diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-31 11:27:30 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-31 11:27:47 -0400 |
commit | 207ac16731baec44c939d85f25c8965d925d7983 (patch) | |
tree | 09ebee94d4ffa2e2a5667df1158efd0a096b4b58 /gtk2_ardour/startup.cc | |
parent | ea5e94977b3bddbc477fc4e87557f9e1d1d50790 (diff) |
move "been here before" path concept into libardour, and use it appropriately at startup
Diffstat (limited to 'gtk2_ardour/startup.cc')
-rw-r--r-- | gtk2_ardour/startup.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index b6af6ddb4c..d4c8686698 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -115,13 +115,23 @@ ArdourStartup::~ArdourStartup () bool ArdourStartup::required () { - return !Glib::file_test (been_here_before_path(), Glib::FILE_TEST_EXISTS); -} + /* look for a "been here before" file for this version or earlier + * versions + */ -std::string -ArdourStartup::been_here_before_path () -{ - return Glib::build_filename (user_config_directory (), ".a" PROGRAM_VERSION); + const int current_version = atoi (PROGRAM_VERSION); + + for (int v = current_version; v != 0; --v) { + if (Glib::file_test (ARDOUR::been_here_before_path (v), Glib::FILE_TEST_EXISTS)) { + if (v != current_version) { + /* older version exists, create the current one */ + ofstream fout (been_here_before_path (current_version).c_str()); + } + return false; + } + } + + return true; } void |