mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Merge pull request #2297 from pmzqla/filename-extension
Filename extension fixes
This commit is contained in:
commit
6daaaa6b24
@ -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"
|
||||||
|
@ -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…
Reference in New Issue
Block a user