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

@@ -35,6 +35,7 @@
#include "base/bittorrent/addtorrentparams.h"
#include "base/bittorrent/magneturi.h"
#include "base/bittorrent/torrentinfo.h"
#include "base/path.h"
#include "base/settingvalue.h"
namespace BitTorrent
@@ -88,7 +89,7 @@ private slots:
void handleDownloadFinished(const Net::DownloadResult &downloadResult);
void TMMChanged(int index);
void categoryChanged(int index);
void contentLayoutChanged(int index);
void contentLayoutChanged();
void doNotDeleteTorrentClicked(bool checked);
void renameSelectedFile();
@@ -97,6 +98,8 @@ private slots:
private:
explicit AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inParams, QWidget *parent);
void applyContentLayout();
bool loadTorrentFile(const QString &source);
bool loadTorrentImpl();
bool loadMagnet(const BitTorrent::MagnetUri &magnetUri);
@@ -115,6 +118,8 @@ private:
PropListDelegate *m_contentDelegate = nullptr;
BitTorrent::MagnetUri m_magnetURI;
BitTorrent::TorrentInfo m_torrentInfo;
Path m_originalRootFolder;
BitTorrent::TorrentContentLayout m_currentContentLayout;
int m_savePathIndex = -1;
int m_downloadPathIndex = -1;
bool m_useDownloadPath = false;