mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-21 08:09:35 +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 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
|
||||
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
|
||||
if (containing_folder) {
|
||||
// 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();
|
||||
for (unsigned int i=0; i<nbFiles; ++i) {
|
||||
QString filename = h.filename_at(i);
|
||||
if (filename.endsWith(".!qB"))
|
||||
filename.chop(4);
|
||||
const QString extension = fsutils::fileExtension(filename);
|
||||
const QString extension = fsutils::fileExtension(h.filename_at(i));
|
||||
if (misc::isPreviewable(extension))
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user