Revamp content layout handling

Apply content layout only if desired file names aren't provided.
Remove helpers with confusing signatures.
Don't remove root folder twice.

PR #16724.
Closes #16259.
This commit is contained in:
Vladimir Golovnev
2022-04-01 09:35:45 +03:00
committed by GitHub
parent eecd221d40
commit df2d449f9b
13 changed files with 93 additions and 103 deletions

View File

@@ -41,6 +41,7 @@
#include <QVector>
#include "base/global.h"
#include "base/path.h"
#include "base/utils/fs.h"
#include "base/utils/io.h"
#include "base/utils/misc.h"
@@ -408,14 +409,6 @@ int TorrentInfo::fileIndex(const Path &filePath) const
return -1;
}
TorrentContentLayout TorrentInfo::contentLayout() const
{
if (!isValid())
return TorrentContentLayout::Original;
return detectContentLayout(filePaths());
}
std::shared_ptr<lt::torrent_info> TorrentInfo::nativeInfo() const
{
if (!isValid())