Stop using internal libtorrent API. Closes #2202.

This commit is contained in:
sledgehammer999
2014-11-26 00:31:22 +02:00
parent cbbf14b0f8
commit f413e8b121
2 changed files with 10 additions and 32 deletions

View File

@@ -74,15 +74,10 @@ void TorrentImportDlg::on_browseTorrentBtn_clicked()
void TorrentImportDlg::on_browseContentBtn_clicked()
{
const QString default_dir = Preferences::instance()->getTorImportLastContentDir();
// Test for multi-file taken from libtorrent/create_torrent.hpp -> create_torrent::create_torrent
bool multifile = t->num_files() > 1;
#if LIBTORRENT_VERSION_NUM >= 1600
if (!multifile && has_parent_path(t->files().file_path(*(t->files().begin()))))
if (!multifile && (fsutils::fromNativePath(misc::toQStringU(t->file_at(0).path)).indexOf('/') != -1))
multifile = true;
#else
if (!multifile && t->file_at(0).path.has_parent_path())
multifile = true;
#endif
if (!multifile) {
// Single file torrent
const QString file_name = fsutils::fileName(misc::toQStringU(t->file_at(0).path));