Improve strip torrent root folder

Fix issue when you rename the "root item" in the "Add New Torrent" dialog
and uncheck "Create subfolder", it will create the subfolder with the
renamed name.
Fix PropertiesWidget first folder is expanded after app restart.
Strip root folder if torrent was added via magnet link.
Fix crash when you get name of torrent without metadata.
This commit is contained in:
Vladimir Golovnev (Glassez)
2016-01-04 16:00:50 +03:00
parent 4b2d8a7941
commit d413bc65ef
6 changed files with 48 additions and 35 deletions

View File

@@ -98,7 +98,7 @@ namespace BitTorrent
bool sequential;
bool hasSeedStatus;
bool skipChecking;
bool createSubfolder;
bool hasRootFolder;
TriStateBool addForced;
TriStateBool addPaused;
// for new torrents
@@ -236,6 +236,8 @@ namespace BitTorrent
bool belongsToCategory(const QString &category) const;
bool setCategory(const QString &category);
bool hasRootFolder() const;
int filesCount() const;
int piecesCount() const;
int piecesHave() const;
@@ -396,7 +398,7 @@ namespace BitTorrent
Session *const m_session;
libtorrent::torrent_handle m_nativeHandle;
libtorrent::torrent_status m_nativeStatus;
TorrentState m_state;
TorrentState m_state;
TorrentInfo m_torrentInfo;
SpeedMonitor m_speedMonitor;
@@ -422,6 +424,7 @@ namespace BitTorrent
qreal m_ratioLimit;
bool m_tempPathDisabled;
bool m_hasMissingFiles;
bool m_hasRootFolder;
bool m_pauseAfterRecheck;
bool m_needSaveResumeData;