Merge pull request #2297 from pmzqla/filename-extension

Filename extension fixes
This commit is contained in:
sledgehammer999 2014-12-20 15:47:42 +02:00
commit 6daaaa6b24
2 changed files with 6 additions and 6 deletions

View File

@ -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"

View File

@ -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;
}