summaryrefslogtreecommitdiff
path: root/libs/ardour/file_source.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-14 03:03:35 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-14 03:03:35 -0400
commit5764970709f15e85ec30c9cea89c318eb8114c58 (patch)
tree0e3ea92a0c26c3582ca31be5e9c48c3b4218aff4 /libs/ardour/file_source.cc
parent062dd5b71d4aad9e8e83d51bf9277293cddaa2c2 (diff)
more work on linking file existence and removability
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