Drop libtorrent 0.15.x support.

This commit is contained in:
sledgehammer999
2013-10-23 22:16:23 +03:00
parent 243abaf524
commit b4dca951b2
23 changed files with 19 additions and 518 deletions

View File

@@ -79,11 +79,7 @@ void TorrentImportDlg::on_browseContentBtn_clicked()
const QString default_dir = settings.value(QString::fromUtf8("TorrentImport/LastContentDir"), QDir::homePath()).toString();
if (t->num_files() == 1) {
// Single file torrent
#if LIBTORRENT_VERSION_NUM >= 001600
const QString file_name = fsutils::fileName(misc::toQStringU(t->file_at(0).path));
#else
const QString file_name = misc::toQStringU(t->file_at(0).path.filename());
#endif
qDebug("Torrent has only one file: %s", qPrintable(file_name));
QString extension = fsutils::fileExtension(file_name);
qDebug("File extension is : %s", qPrintable(extension));
@@ -146,11 +142,7 @@ void TorrentImportDlg::on_browseContentBtn_clicked()
content_dir.cdUp();
// Check file sizes
for (int i=0; i<t->num_files(); ++i) {
#if LIBTORRENT_VERSION_NUM >= 001600
const QString rel_path = misc::toQStringU(t->file_at(i).path);
#else
const QString rel_path = misc::toQStringU(t->file_at(i).path.string());
#endif
if (QFile(QDir::cleanPath(content_dir.absoluteFilePath(rel_path))).size() != t->file_at(i).size) {
qDebug("%s is %lld",
qPrintable(QDir::cleanPath(content_dir.absoluteFilePath(rel_path))), (long long int) QFile(QDir::cleanPath(content_dir.absoluteFilePath(rel_path))).size());
@@ -252,11 +244,7 @@ void TorrentImportDlg::initializeFilesPath()
m_filesPath.clear();
// Loads files path in the torrent
for (int i=0; i<t->num_files(); ++i) {
#if LIBTORRENT_VERSION_NUM >= 001600
m_filesPath << misc::toQStringU(t->file_at(i).path).replace("\\", "/");
#else
m_filesPath << misc::toQStringU(t->file_at(i).path.string()).replace("\\", "/");
#endif
}
}