mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-08 06:00:59 -07:00
Fix compilation with libtorrent 0.15.x.
This commit is contained in:
parent
79f3c6439c
commit
ba1f9558a9
1 changed files with 9 additions and 0 deletions
|
@ -78,12 +78,21 @@ void TorrentImportDlg::on_browseContentBtn_clicked()
|
||||||
QIniSettings settings;
|
QIniSettings settings;
|
||||||
const QString default_dir = settings.value(QString::fromUtf8("TorrentImport/LastContentDir"), QDir::homePath()).toString();
|
const QString default_dir = settings.value(QString::fromUtf8("TorrentImport/LastContentDir"), QDir::homePath()).toString();
|
||||||
bool multifile = t->num_files() > 1;
|
bool multifile = t->num_files() > 1;
|
||||||
|
#if LIBTORRENT_VERSION_NUM >= 1600
|
||||||
if (!multifile && (QDir::fromNativeSeparators(misc::toQStringU(t->file_at(0).path)).indexOf('/') != -1))
|
if (!multifile && (QDir::fromNativeSeparators(misc::toQStringU(t->file_at(0).path)).indexOf('/') != -1))
|
||||||
multifile = true;
|
multifile = true;
|
||||||
|
#else
|
||||||
|
if (!multifile && t->file_at(0).path.has_parent_path())
|
||||||
|
multifile = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!multifile) {
|
if (!multifile) {
|
||||||
// Single file torrent
|
// Single file torrent
|
||||||
|
#if LIBTORRENT_VERSION_NUM >= 1600
|
||||||
const QString file_name = fsutils::fileName(misc::toQStringU(t->file_at(0).path));
|
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));
|
qDebug("Torrent has only one file: %s", qPrintable(file_name));
|
||||||
QString extension = fsutils::fileExtension(file_name);
|
QString extension = fsutils::fileExtension(file_name);
|
||||||
qDebug("File extension is : %s", qPrintable(extension));
|
qDebug("File extension is : %s", qPrintable(extension));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue