Code clean up

This commit is contained in:
Christophe Dumez
2010-12-30 19:38:53 +00:00
parent 5696944c6f
commit 64f4775a81
10 changed files with 19 additions and 26 deletions

View File

@@ -85,9 +85,9 @@ void TorrentImportDlg::on_browseContentBtn_clicked()
if(t->num_files() == 1) {
// Single file torrent
#if LIBTORRENT_VERSION_MINOR >= 16
const QString file_name = misc::toQStringU(fs.file_path(t->file_at(0))).replace("\\", "/").split("/").last();
const QString file_name = misc::fileName(misc::toQStringU(fs.file_path(t->file_at(0)));
#else
const QString file_name = misc::toQStringU(t->file_at(0).path.leaf());
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 = misc::file_extension(file_name);