mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
parent
a1c78a0455
commit
ef06be63bf
1 changed files with 8 additions and 8 deletions
|
@ -2172,20 +2172,20 @@ void TorrentImpl::handleFileRenamedAlert(const lt::file_renamed_alert *p)
|
||||||
const Path newActualParentPath = newActualFilePath.parentPath();
|
const Path newActualParentPath = newActualFilePath.parentPath();
|
||||||
if (newActualParentPath.filename() == UNWANTED_FOLDER_NAME)
|
if (newActualParentPath.filename() == UNWANTED_FOLDER_NAME)
|
||||||
{
|
{
|
||||||
Q_ASSERT(oldActualParentPath.filename() != UNWANTED_FOLDER_NAME);
|
if (oldActualParentPath.filename() != UNWANTED_FOLDER_NAME)
|
||||||
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
const std::wstring winPath = (actualStorageLocation() / newActualParentPath).toString().toStdWString();
|
const std::wstring winPath = (actualStorageLocation() / newActualParentPath).toString().toStdWString();
|
||||||
const DWORD dwAttrs = ::GetFileAttributesW(winPath.c_str());
|
const DWORD dwAttrs = ::GetFileAttributesW(winPath.c_str());
|
||||||
::SetFileAttributesW(winPath.c_str(), (dwAttrs | FILE_ATTRIBUTE_HIDDEN));
|
::SetFileAttributesW(winPath.c_str(), (dwAttrs | FILE_ATTRIBUTE_HIDDEN));
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#ifdef QBT_USES_LIBTORRENT2
|
#ifdef QBT_USES_LIBTORRENT2
|
||||||
else if (oldActualParentPath.filename() == UNWANTED_FOLDER_NAME)
|
else if (oldActualParentPath.filename() == UNWANTED_FOLDER_NAME)
|
||||||
{
|
{
|
||||||
Q_ASSERT(newActualParentPath.filename() != UNWANTED_FOLDER_NAME);
|
if (newActualParentPath.filename() != UNWANTED_FOLDER_NAME)
|
||||||
|
Utils::Fs::rmdir(actualStorageLocation() / oldActualParentPath);
|
||||||
Utils::Fs::rmdir(actualStorageLocation() / oldActualParentPath);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue