mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-13 05:41:17 +00:00
Merge pull request #396 from karimodm/master
Fix to Issue #395: Preview feature absent when .!qB extensions added
This commit is contained in:
commit
d9d63141bb
@ -39,6 +39,7 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "previewlistdelegate.h"
|
#include "previewlistdelegate.h"
|
||||||
#include "previewselect.h"
|
#include "previewselect.h"
|
||||||
|
#include "fs_utils.h"
|
||||||
|
|
||||||
PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent), h(h) {
|
PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent), h(h) {
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
@ -58,7 +59,9 @@ PreviewSelect::PreviewSelect(QWidget* parent, QTorrentHandle h): QDialog(parent)
|
|||||||
unsigned int nbFiles = h.num_files();
|
unsigned int nbFiles = h.num_files();
|
||||||
for (unsigned int i=0; i<nbFiles; ++i) {
|
for (unsigned int i=0; i<nbFiles; ++i) {
|
||||||
QString fileName = h.filename_at(i);
|
QString fileName = h.filename_at(i);
|
||||||
QString extension = fileName.split(QString::fromUtf8(".")).last().toUpper();
|
if (fileName.endsWith(".!qB"))
|
||||||
|
fileName.chop(4);
|
||||||
|
QString extension = fsutils::fileExtension(fileName).toUpper();
|
||||||
if (misc::isPreviewable(extension)) {
|
if (misc::isPreviewable(extension)) {
|
||||||
int row = previewListModel->rowCount();
|
int row = previewListModel->rowCount();
|
||||||
previewListModel->insertRow(row);
|
previewListModel->insertRow(row);
|
||||||
|
@ -1731,7 +1731,10 @@ bool QBtSession::isFilePreviewPossible(const QString &hash) const {
|
|||||||
}
|
}
|
||||||
const unsigned int nbFiles = h.num_files();
|
const unsigned int nbFiles = h.num_files();
|
||||||
for (unsigned int i=0; i<nbFiles; ++i) {
|
for (unsigned int i=0; i<nbFiles; ++i) {
|
||||||
const QString extension = fsutils::fileExtension(h.filename_at(i));
|
QString filename = h.filename_at(i);
|
||||||
|
if (filename.endsWith(".!qB"))
|
||||||
|
filename.chop(4);
|
||||||
|
const QString extension = fsutils::fileExtension(filename);
|
||||||
if (misc::isPreviewable(extension))
|
if (misc::isPreviewable(extension))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user