mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-04 12:45:45 +01:00
Fix egregious logic bug in FileSource::removable() and introduce FileSource::is_stub() to hide logic for deciding if a source (file) is a stub
This commit is contained in:
parent
ed75b9425b
commit
2c67913245
1 changed files with 19 additions and 1 deletions
|
|
@ -101,7 +101,7 @@ FileSource::removable () const
|
|||
{
|
||||
bool r = ((_flags & Removable)
|
||||
&& ((_flags & RemoveAtDestroy) ||
|
||||
((_flags & RemovableIfEmpty) && empty() == 0)));
|
||||
((_flags & RemovableIfEmpty) && empty())));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
@ -589,3 +589,21 @@ FileSource::inc_use_count ()
|
|||
Source::inc_use_count ();
|
||||
}
|
||||
|
||||
bool
|
||||
FileSource::is_stub () const
|
||||
{
|
||||
if (!empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!removable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue