summaryrefslogtreecommitdiff
path: root/libs/ardour/recent_sessions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/recent_sessions.cc')
-rw-r--r--libs/ardour/recent_sessions.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/ardour/recent_sessions.cc b/libs/ardour/recent_sessions.cc
index dfe85190b3..adc25294fb 100644
--- a/libs/ardour/recent_sessions.cc
+++ b/libs/ardour/recent_sessions.cc
@@ -137,3 +137,28 @@ ARDOUR::store_recent_sessions (string name, string path)
return ARDOUR::write_recent_sessions (rs);
}
+int
+ARDOUR::remove_recent_sessions (const string& path)
+{
+ RecentSessions rs;
+ bool write = false;
+
+ if (ARDOUR::read_recent_sessions (rs) < 0) {
+ return -1;
+ }
+
+ for (RecentSessions::iterator i = rs.begin(); i != rs.end(); ++i) {
+ if (i->second == path) {
+ rs.erase (i);
+ write = true;
+ break;
+ }
+ }
+
+ if (write) {
+ return ARDOUR::write_recent_sessions (rs);
+ } else {
+ return 1;
+ }
+}
+