diff options
author | Carl Hetherington <carl@carlh.net> | 2012-03-10 11:37:01 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-03-10 11:37:01 +0000 |
commit | f6ee63591d928ff63cca81864faa2e80f7d3277c (patch) | |
tree | d11f457555ad96579ee9331563d2f768729f60ba /libs/ardour | |
parent | ec1e3a1f6069421e769231ed524727919f99e4f7 (diff) |
Patch from colinf to allow the number of recent sessions to
be configured (#2207).
git-svn-id: svn://localhost/ardour2/branches/3.0@11641 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/rc_configuration_vars.h | 1 | ||||
-rw-r--r-- | libs/ardour/recent_sessions.cc | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 146f91dd68..766db9db1c 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -174,6 +174,7 @@ CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during- CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true) CONFIG_VARIABLE (bool, sound_midi_notes, "sound-midi-notes", false) CONFIG_VARIABLE (bool, use_plugin_own_gui, "use-plugin-own-gui", true) +CONFIG_VARIABLE (uint32_t, max_recent_sessions, "max-recent-sessions", 10) /* denormal management */ diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc index adc25294fb..45c30b085b 100644 --- a/libs/ardour/recent_sessions.cc +++ b/libs/ardour/recent_sessions.cc @@ -28,6 +28,7 @@ #include "pbd/error.h" #include "ardour/configuration.h" +#include "ardour/rc_configuration.h" #include "ardour/filesystem_paths.h" #include "ardour/recent_sessions.h" #include "ardour/utils.h" @@ -130,8 +131,10 @@ ARDOUR::store_recent_sessions (string name, string path) rs.push_front (newpair); - if (rs.size() > 10) { - rs.erase(rs.begin()+10, rs.end()); + uint32_t max_recent_sessions = Config->get_max_recent_sessions(); + + if (rs.size() > max_recent_sessions) { + rs.erase(rs.begin()+max_recent_sessions, rs.end()); } return ARDOUR::write_recent_sessions (rs); |