mirror of https://github.com/AxioDL/kabufuda.git
Handle no-copy/no-move permissions
This commit is contained in:
parent
b082a92fb2
commit
fa70961027
|
@ -546,6 +546,10 @@ bool Card::copyFileTo(const std::unique_ptr<IFileHandle>& fh, Card& dest)
|
||||||
{
|
{
|
||||||
if (!fh)
|
if (!fh)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!canCopy(fh))
|
||||||
|
return false;
|
||||||
|
|
||||||
/* Do a self test to avoid adding a file to itself */
|
/* Do a self test to avoid adding a file to itself */
|
||||||
if (this == &dest)
|
if (this == &dest)
|
||||||
return false;
|
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)
|
bool Card::moveFileTo(const std::unique_ptr<IFileHandle>& fh, Card& dest)
|
||||||
{
|
{
|
||||||
if (copyFileTo(fh, dest))
|
if (copyFileTo(fh, dest) && canMove(fh))
|
||||||
{
|
{
|
||||||
deleteFile(fh);
|
deleteFile(fh);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue