Move is_embedded calculation to a single place.

git-svn-id: svn://localhost/ardour2/branches/3.0@6206 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-11-28 22:36:06 +00:00
parent 60d367cfc6
commit b88e7fdcca
2 changed files with 10 additions and 2 deletions

View file

@ -67,6 +67,8 @@ protected:
virtual int move_dependents_to_trash() { return 0; }
void set_embedded_from_name();
bool removable () const;
Glib::ustring _path;

View file

@ -70,7 +70,7 @@ FileSource::FileSource (Session& session, const XMLNode& node, bool /*must_exist
, _file_is_new (false)
{
_path = _name;
_is_embedded = (_path.find(PATH_SEP) != string::npos);
set_embedded_from_name();
}
bool
@ -103,6 +103,12 @@ FileSource::init (const ustring& pathstr, bool must_exist)
return 0;
}
void
FileSource::set_embedded_from_name ()
{
_is_embedded = (_name.find(PATH_SEP) != string::npos);
}
int
FileSource::set_state (const XMLNode& node, int /*version*/)
{
@ -114,7 +120,7 @@ FileSource::set_state (const XMLNode& node, int /*version*/)
_channel = 0;
}
_is_embedded = (_name.find(PATH_SEP) == string::npos);
set_embedded_from_name();
return 0;
}