Remove duplicate API to find session files (ignore `._` files)
Session::possible_states correctly filters files
and also directly returns sorted base-names.
We can remove the redundant `get_state_files_in_directory`
API now.
see also 193b35e885
This commit is contained in:
parent
04d50ab880
commit
91579608b2
|
@ -1109,9 +1109,7 @@ ARDOUR_UI::process_snapshot_session_prompter (Prompter& prompter, bool switch_to
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<std::string> p;
|
vector<std::string> n = Session::possible_states (_session->session_directory().root_path());
|
||||||
get_state_files_in_directory (_session->session_directory().root_path(), p);
|
|
||||||
vector<string> n = get_file_names_no_extension (p);
|
|
||||||
|
|
||||||
if (find (n.begin(), n.end(), snapname) != n.end()) {
|
if (find (n.begin(), n.end(), snapname) != n.end()) {
|
||||||
|
|
||||||
|
|
|
@ -202,17 +202,12 @@ EditorSnapshots::redisplay ()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<std::string> state_file_paths;
|
vector<string> state_file_names = _session->possible_states ();
|
||||||
|
|
||||||
get_state_files_in_directory (_session->session_directory().root_path(),
|
if (state_file_names.empty()) {
|
||||||
state_file_paths);
|
|
||||||
|
|
||||||
if (state_file_paths.empty()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector<string> state_file_names (get_file_names_no_extension(state_file_paths));
|
|
||||||
|
|
||||||
_snapshot_model->clear ();
|
_snapshot_model->clear ();
|
||||||
|
|
||||||
for (vector<string>::iterator i = state_file_names.begin(); i != state_file_names.end(); ++i)
|
for (vector<string>::iterator i = state_file_names.begin(); i != state_file_names.end(); ++i)
|
||||||
|
|
|
@ -786,14 +786,7 @@ SessionDialog::redisplay_recent_sessions ()
|
||||||
int session_snapshot_count = 0;
|
int session_snapshot_count = 0;
|
||||||
|
|
||||||
for (vector<std::string>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i) {
|
for (vector<std::string>::const_iterator i = session_directories.begin(); i != session_directories.end(); ++i) {
|
||||||
std::vector<std::string> state_file_paths;
|
|
||||||
|
|
||||||
// now get available states for this session
|
|
||||||
|
|
||||||
get_state_files_in_directory (*i, state_file_paths);
|
|
||||||
|
|
||||||
vector<string> states;
|
|
||||||
vector<const gchar*> item;
|
|
||||||
string dirname = *i;
|
string dirname = *i;
|
||||||
|
|
||||||
/* remove any trailing / */
|
/* remove any trailing / */
|
||||||
|
@ -813,17 +806,10 @@ SessionDialog::redisplay_recent_sessions ()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now get available states for this session */
|
/* now get available states for this session */
|
||||||
|
vector<string> state_file_names = Session::possible_states (dirname);
|
||||||
states = Session::possible_states (dirname);
|
|
||||||
|
|
||||||
if (states.empty()) {
|
|
||||||
/* no state file? */
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<string> state_file_names(get_file_names_no_extension (state_file_paths));
|
|
||||||
|
|
||||||
if (state_file_names.empty()) {
|
if (state_file_names.empty()) {
|
||||||
|
/* no state file? */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue