From 2dc392b517eb47a9cd269c580cacf42089504388 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 21 Jan 2017 00:47:33 +0100 Subject: update bbe62da55a - use last-modified-with, strip git-rev --- libs/ardour/ardour/session.h | 2 +- libs/ardour/session_state.cc | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'libs') diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index aad16aa44c..0a2926d816 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -199,7 +199,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop virtual ~Session (); - static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& created_version); + static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& program_version); static std::string get_snapshot_from_instant (const std::string& session_dir); /** a monotonic counter used for naming user-visible things uniquely diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index ee86a40e09..834f054e0f 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -4428,11 +4428,11 @@ Session::rename (const std::string& new_name) } int -Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& created_version) +Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& program_version) { bool found_sr = false; bool found_data_format = false; - created_version = ""; + program_version = ""; if (!Glib::file_test (xmlpath, Glib::FILE_TEST_EXISTS)) { return -1; @@ -4470,9 +4470,13 @@ Session::get_info_from_path (const string& xmlpath, float& sample_rate, SampleFo node = node->children; while (node != NULL) { if (!strcmp((const char*) node->name, "ProgramVersion")) { - xmlChar* val = xmlGetProp (node, (const xmlChar*)"created-with"); + xmlChar* val = xmlGetProp (node, (const xmlChar*)"modified-with"); if (val) { - created_version = string ((const char*)val); + program_version = string ((const char*)val); + size_t sep = program_version.find_first_of("-"); + if (sep != string::npos) { + program_version = program_version.substr (0, sep); + } } xmlFree (val); } -- cgit v1.2.3