diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2007-09-04 05:26:31 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2007-09-04 05:26:31 +0000 |
commit | e2f919d76b7e78bbccfa673106e8906da324cf59 (patch) | |
tree | 48eb7da173db8f04af00548db9c32d8f9ccc8bbc /gtk2_ardour | |
parent | a9d70383d1544b49b2d48986c6cfbd8646cd793c (diff) |
Use ardour/session_state_utils.h in Editor::redisplay_snapshots
git-svn-id: svn://localhost/ardour2/trunk@2389 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 8584e59b8a..fa69990a82 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -52,6 +52,8 @@ #include <ardour/audioregion.h> #include <ardour/midi_region.h> #include <ardour/session_route.h> +#include <ardour/session_directory.h> +#include <ardour/session_state_utils.h> #include <ardour/tempo.h> #include <ardour/utils.h> @@ -3526,16 +3528,21 @@ Editor::redisplay_snapshots () return; } - vector<string*>* states; + vector<sys::path> state_file_paths; - if ((states = session->possible_states()) == 0) { - return; - } + get_state_files_in_directory (session->session_directory().root_path(), + state_file_paths); + + if (state_file_paths.empty()) return; + + vector<string> state_file_names(get_file_names_no_extension(state_file_paths)); snapshot_display_model->clear (); - for (vector<string*>::iterator i = states->begin(); i != states->end(); ++i) { - string statename = *(*i); + for (vector<string>::iterator i = state_file_names.begin(); + i != state_file_names.end(); ++i) + { + string statename = (*i); TreeModel::Row row = *(snapshot_display_model->append()); /* this lingers on in case we ever want to change the visible @@ -3552,8 +3559,6 @@ Editor::redisplay_snapshots () row[snapshot_display_columns.visible_name] = display_name; row[snapshot_display_columns.real_name] = statename; } - - delete states; } void |