Remove torrent temp folder when torrent is deleted

This commit is contained in:
Vladimir Golovnev (Glassez) 2017-04-26 13:15:37 +03:00
parent c56b4a25bc
commit 160b7ff2d3
3 changed files with 17 additions and 12 deletions

View file

@ -100,7 +100,7 @@ QString Utils::Fs::folderName(const QString& file_path)
*/
bool Utils::Fs::smartRemoveEmptyFolderTree(const QString& path)
{
if (!QDir(path).exists())
if (path.isEmpty() || !QDir(path).exists())
return false;
static const QStringList deleteFilesList = {
@ -161,9 +161,10 @@ bool Utils::Fs::forceRemove(const QString& file_path)
* Removes directory and its content recursively.
*
*/
void Utils::Fs::removeDirRecursive(const QString& dirName)
void Utils::Fs::removeDirRecursive(const QString &path)
{
QDir(dirName).removeRecursively();
if (!path.isEmpty())
QDir(path).removeRecursively();
}
/**