mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
Remove torrent temp folder when torrent is deleted
This commit is contained in:
parent
c56b4a25bc
commit
160b7ff2d3
3 changed files with 17 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue