From 193b35e88576e7736c6774708d4024c0d663d83b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 31 May 2023 16:02:17 +0200 Subject: [PATCH] Ignore Apple/HFS+ `._` meta-data files with statefile suffix. Those files may otherwise show up in the Recent Session dialog as possible states to load. --- libs/ardour/session_state.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 8671cf2496..974b0b203a 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -3154,8 +3154,10 @@ Session::load_route_groups (const XMLNode& node, int version) static bool state_file_filter (const string &str, void* /*arg*/) { - return (str.length() > strlen(statefile_suffix) && - str.find (statefile_suffix) == (str.length() - strlen (statefile_suffix))); + return (str.length() > strlen(statefile_suffix) + && str.find (statefile_suffix) == (str.length() - strlen (statefile_suffix)) + && str.substr (0, 2) != "._" /* ignore HFS+ extended data */ + ); } static string @@ -3876,7 +3878,6 @@ Session::cleanup_sources (CleanupReport& rep) tmppath1 = canonical_path (spath); tmppath2 = canonical_path ((*i)); - cerr << "\t => " << tmppath2 << endl; if (tmppath1 == tmppath2) { used = true; @@ -3884,6 +3885,8 @@ Session::cleanup_sources (CleanupReport& rep) } } + cerr << "\t" << (used ? "keep: " : "drop: ") << spath << endl; + if (!used) { unused.push_back (spath); }