Browse Source

Merge pull request #3845 from glassez/drop_unused

Drop unused TorrentHandle methods.
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
1ba1f90058
  1. 27
      src/core/bittorrent/torrenthandle.cpp
  2. 2
      src/core/bittorrent/torrenthandle.h

27
src/core/bittorrent/torrenthandle.cpp

@ -465,17 +465,6 @@ void TorrentHandle::saveResumeData()
m_needSaveResumeData = false; m_needSaveResumeData = false;
} }
QString TorrentHandle::savePathParsed() const
{
QString p;
if (hasMetadata() && (filesCount() == 1))
p = firstFileSavePath();
else
p = savePath();
return Utils::Fs::toNativePath(p);
}
int TorrentHandle::filesCount() const int TorrentHandle::filesCount() const
{ {
return m_torrentInfo.filesCount(); return m_torrentInfo.filesCount();
@ -519,22 +508,6 @@ qreal TorrentHandle::ratioLimit() const
return m_ratioLimit; return m_ratioLimit;
} }
QString TorrentHandle::firstFileSavePath() const
{
Q_ASSERT(hasMetadata());
QString fSavePath = savePath();
if (!fSavePath.endsWith("/"))
fSavePath += "/";
fSavePath += filePath(0);
// Remove .!qB extension
if (fSavePath.endsWith(".!qB", Qt::CaseInsensitive))
fSavePath.chop(4);
return fSavePath;
}
QString TorrentHandle::filePath(int index) const QString TorrentHandle::filePath(int index) const
{ {
return m_torrentInfo.filePath(index); return m_torrentInfo.filePath(index);

2
src/core/bittorrent/torrenthandle.h

@ -184,7 +184,6 @@ namespace BitTorrent
QString actualSavePath() const; QString actualSavePath() const;
QString savePath() const; QString savePath() const;
QString rootPath() const; QString rootPath() const;
QString savePathParsed() const;
int filesCount() const; int filesCount() const;
int piecesCount() const; int piecesCount() const;
int piecesHave() const; int piecesHave() const;
@ -193,7 +192,6 @@ namespace BitTorrent
QDateTime addedTime() const; QDateTime addedTime() const;
qreal ratioLimit() const; qreal ratioLimit() const;
QString firstFileSavePath() const;
QString filePath(int index) const; QString filePath(int index) const;
QString fileName(int index) const; QString fileName(int index) const;
qlonglong fileSize(int index) const; qlonglong fileSize(int index) const;

Loading…
Cancel
Save