From e2f919d76b7e78bbccfa673106e8906da324cf59 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Tue, 4 Sep 2007 05:26:31 +0000 Subject: [PATCH] Use ardour/session_state_utils.h in Editor::redisplay_snapshots git-svn-id: svn://localhost/ardour2/trunk@2389 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 21 +++++++++++++-------- 1 file 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 #include #include +#include +#include #include #include @@ -3526,16 +3528,21 @@ Editor::redisplay_snapshots () return; } - vector* states; + vector 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 state_file_names(get_file_names_no_extension(state_file_paths)); snapshot_display_model->clear (); - for (vector::iterator i = states->begin(); i != states->end(); ++i) { - string statename = *(*i); + for (vector::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