Handle no-copy/no-move permissions

This commit is contained in:
Phillip Stephens 2016-12-17 22:03:25 -08:00
parent b082a92fb2
commit fa70961027
1 changed files with 5 additions and 1 deletions

View File

@ -546,6 +546,10 @@ bool Card::copyFileTo(const std::unique_ptr<IFileHandle>& fh, Card& dest)
{
if (!fh)
return false;
if (!canCopy(fh))
return false;
/* Do a self test to avoid adding a file to itself */
if (this == &dest)
return false;
@ -589,7 +593,7 @@ bool Card::copyFileTo(const std::unique_ptr<IFileHandle>& fh, Card& dest)
bool Card::moveFileTo(const std::unique_ptr<IFileHandle>& fh, Card& dest)
{
if (copyFileTo(fh, dest))
if (copyFileTo(fh, dest) && canMove(fh))
{
deleteFile(fh);
return true;