Merge pull request #1331 from TheKodeToad/hungry-trash

Fix updating trashing resources
This commit is contained in:
seth
2023-07-10 16:31:43 -04:00
committed by Sefa Eyeoglu
parent 6cd259becd
commit 6f86e8b66e
7 changed files with 11 additions and 15 deletions

View File

@ -145,14 +145,10 @@ bool Resource::enable(EnableAction action)
return true;
}
bool Resource::destroy()
bool Resource::destroy(bool attemptTrash)
{
m_type = ResourceType::UNKNOWN;
if (FS::trash(m_file_info.filePath()))
return true;
return FS::deletePath(m_file_info.filePath());
return (attemptTrash && FS::trash(m_file_info.filePath())) || FS::deletePath(m_file_info.filePath());
}
bool Resource::isSymLinkUnder(const QString& instPath) const