X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_state_utils.cc;h=28cfbb2b756eb6019f4ca2bcb06f032a2cce46e2;hb=88b3aa926a82ff103d8440e89e28b202a450e18f;hp=136598efc4a8e78b5150cb43605f834c71c9af24;hpb=71a4495db4d3f8af841b9be3fa41f103a0b857a7;p=ardour.git diff --git a/libs/ardour/session_state_utils.cc b/libs/ardour/session_state_utils.cc index 136598efc4..28cfbb2b75 100644 --- a/libs/ardour/session_state_utils.cc +++ b/libs/ardour/session_state_utils.cc @@ -30,7 +30,7 @@ #include "ardour/session_state_utils.h" #include "ardour/filename_extensions.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace PBD; @@ -40,33 +40,15 @@ namespace ARDOUR { bool create_backup_file (const std::string & file_path) { - if (!Glib::file_test (file_path, Glib::FILE_TEST_EXISTS)) return false; - - Glib::RefPtr backup_path = Gio::File::create_for_path(file_path + backup_suffix); - Glib::RefPtr path = Gio::File::create_for_path(file_path); - - try - { - path->copy (backup_path); - } - catch(const Glib::Exception& ex) - { - error << string_compose (_("Unable to create a backup copy of file %1 (%2)"), - file_path, ex.what()) - << endmsg; - return false; - } - return true; + return copy_file (file_path, file_path + backup_suffix); } void get_state_files_in_directory (const std::string & directory_path, vector & result) { - Glib::PatternSpec state_file_pattern('*' + string(statefile_suffix)); - - find_matching_files_in_directory (directory_path, state_file_pattern, - result); + find_files_matching_pattern (result, directory_path, + '*' + string(statefile_suffix)); } vector