Browse Source

Merge pull request #2297 from pmzqla/filename-extension

Filename extension fixes
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
6daaaa6b24
  1. 7
      src/properties/propertieswidget.cpp
  2. 5
      src/qtlibtorrent/qbtsession.cpp

7
src/properties/propertieswidget.cpp

@ -463,11 +463,14 @@ void PropertiesWidget::openFolder(const QModelIndex &index, bool containing_fold
const QDir saveDir(h.save_path()); const QDir saveDir(h.save_path());
const QString filename = path_items.join("/"); const QString filename = path_items.join("/");
const QString file_path = fsutils::expandPath(saveDir.absoluteFilePath(filename));
qDebug("Trying to open folder at %s", qPrintable(file_path));
// Flush data // Flush data
h.flush_cache(); h.flush_cache();
QString file_path = fsutils::expandPath(saveDir.absoluteFilePath(filename));
if (QFile::exists(file_path + ".!qB"))
file_path += ".!qB";
qDebug("Trying to open folder at %s", qPrintable(file_path));
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
if (containing_folder) { if (containing_folder) {
// Syntax is: explorer /select, "C:\Folder1\Folder2\file_to_select" // Syntax is: explorer /select, "C:\Folder1\Folder2\file_to_select"

5
src/qtlibtorrent/qbtsession.cpp

@ -1755,10 +1755,7 @@ 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) {
QString filename = h.filename_at(i); const QString extension = fsutils::fileExtension(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…
Cancel
Save