remove unnecessary calls
[ardour.git] / libs / ardour / find_session.cc
index 05f88d83b35fccbd622463adc6f46e43f545ff3d..7644422f6f701eb86b0eafbc9a4d39613a9d12fe 100644 (file)
@@ -196,7 +196,7 @@ find_session (string str, string& path, string& snapshot, bool& isnew)
 int
 inflate_session (const std::string& zipfile, const std::string& target_dir, string& path, string& snapshot)
 {
-       if (zipfile.find (".tar.xz") == string::npos) {
+       if (zipfile.find (session_archive_suffix) == string::npos) {
                return 1;
        }
 
@@ -218,13 +218,10 @@ inflate_session (const std::string& zipfile, const std::string& target_dir, stri
 
                size_t sep = bn.find_first_of ('/');
 
-               if (sep == string::npos) {
-                       error << _("Archive does not contain a session folder") << endmsg;
-                       return 3;
+               if (sep != string::npos) {
+                       bn = bn.substr (0, sep);
                }
 
-               bn = bn.substr (0, sep);
-
                if (bn.empty ()) {
                        error << _("Archive does not contain a valid session structure") << endmsg;
                        return 4;
@@ -265,7 +262,7 @@ string inflate_error (int e) {
                case 0:
                        return _("No Error");
                case 1:
-                       return _("File extension is not .tar.xz");
+                       return string_compose (_("File extension is not %1"), session_archive_suffix);
                case 2:
                        return _("Archive is empty");
                case 3: