summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-01-05 17:48:42 +0100
committerRobin Gareus <robin@gareus.org>2015-01-05 17:48:42 +0100
commit6e3e1738ddc4cefdf81641bf4b28696db1ecd338 (patch)
tree0517c2b2929821ec6252b9facc73678004e914d4 /libs
parent877e518f054c4e1e92541f77a8dd96593a401f93 (diff)
removed hardcoded ".ardour" suffix
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/session_state.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 8463b92503..a44eeaf95a 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -2311,7 +2311,7 @@ remove_end(string state)
statename = statename.substr (start+1);
}
- if ((end = statename.rfind(".ardour")) == string::npos) {
+ if ((end = statename.rfind(statefile_suffix)) == string::npos) {
end = statename.length();
}
@@ -2493,11 +2493,16 @@ accept_all_midi_files (const string& path, void* /*arg*/)
static bool
accept_all_state_files (const string& path, void* /*arg*/)
{
- if (!Glib::file_test (path, Glib::FILE_TEST_IS_REGULAR)) {
- return false;
- }
+ if (!Glib::file_test (path, Glib::FILE_TEST_IS_REGULAR)) {
+ return false;
+ }
- return (path.length() > 7 && path.find (".ardour") == (path.length() - 7));
+ std::string const statefile_ext (statefile_suffix);
+ if (path.length() >= statefile_ext.length()) {
+ return (0 == path.compare (path.length() - statefile_ext.length(), statefile_ext.length(), statefile_ext));
+ } else {
+ return false;
+ }
}
int