diff --git a/src/fs_utils.cpp b/src/fs_utils.cpp index 2e9ecd8a7..69db2e9c4 100644 --- a/src/fs_utils.cpp +++ b/src/fs_utils.cpp @@ -81,8 +81,18 @@ QString fsutils::toDisplayPath(const QString& path) */ QString fsutils::fileExtension(const QString &filename) { - const int point_index = filename.lastIndexOf("."); - return (point_index >= 0) ? filename.mid(point_index + 1) : QString(); + QString holder; + int point_index = filename.lastIndexOf("."); + if (point_index >= 0) { + QString holder = filename.mid(point_index + 1); + if (holder == "!qB") { + holder = filename.mid(0, point_index); + point_index = holder.lastIndexOf("."); + holder = (point_index >= 0) ? holder.mid(point_index + 1) : QString(); + } + return holder; + } + return QString(); } QString fsutils::fileName(const QString& file_path) diff --git a/src/previewselect.cpp b/src/previewselect.cpp index 5ba887298..c215f5ad5 100644 --- a/src/previewselect.cpp +++ b/src/previewselect.cpp @@ -39,6 +39,7 @@ #include "misc.h" #include "previewlistdelegate.h" #include "previewselect.h" +#include "fs_utils.h" PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent), h(h) { setupUi(this); @@ -58,7 +59,7 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent) unsigned int nbFiles = h.num_files(); for (unsigned int i=0; irowCount(); previewListModel->insertRow(row);