summaryrefslogtreecommitdiff
path: root/libs/ardour/file_source.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/file_source.cc')
-rw-r--r--libs/ardour/file_source.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc
index 709915378d..109539ce2d 100644
--- a/libs/ardour/file_source.cc
+++ b/libs/ardour/file_source.cc
@@ -62,8 +62,6 @@ FileSource::FileSource (Session& session, DataType type, const string& path, con
, _open (false)
{
set_within_session_from_path (path);
-
- prevent_deletion ();
}
FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist*/)
@@ -77,8 +75,6 @@ FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist
_path = _name;
_within_session = true;
-
- prevent_deletion ();
}
FileSource::~FileSource()
@@ -86,20 +82,21 @@ FileSource::~FileSource()
}
void
-FileSource::prevent_deletion ()
+FileSource::existence_check ()
{
- /* if this file already exists, it cannot be removed, ever
- */
-
if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) {
- cerr << " ... " << _path << " already exists, marking immutable\n";
+ prevent_deletion ();
+ }
+}
- if (!(_flags & Destructive)) {
- mark_immutable ();
- } else {
- _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
- }
- }
+void
+FileSource::prevent_deletion ()
+{
+ if (!(_flags & Destructive)) {
+ mark_immutable ();
+ } else {
+ _flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
+ }
}
bool