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 13:07:07 -0400
commitbe0da8ff5c1a3bfbdf0a2934a79aeeed26ade3bc (patch)
tree85176c4f282901d2b61485aad0c7aaa0e9957987 /libs/ardour/file_source.cc
parent2e3a84b15afb749fbbfd05d765badb53434188b0 (diff)
merge 5764970709f15e85ec30c9cea89c318eb8114c58 from cairocanvas as final(?) change related to data loss
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 f9abda0ab3..de2783a1ac 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