mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Merge latest fixes from stable branch
This commit is contained in:
parent
b67938aa3f
commit
4e1366bf0d
8 changed files with 69 additions and 29 deletions
|
@ -483,17 +483,22 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
|||
if(PropListModel->getType(index) == TFILE) {
|
||||
int i = PropListModel->getFileIndex(index);
|
||||
const QDir &saveDir(h.save_path());
|
||||
const QString &filename = misc::toQString(h.get_torrent_info().file_at(i).path.string());
|
||||
const QString &filename = misc::toQStringU(h.get_torrent_info().file_at(i).path.string());
|
||||
const QString &file_path = QDir::cleanPath(saveDir.absoluteFilePath(filename));
|
||||
qDebug("Trying to open file at %s", qPrintable(file_path));
|
||||
#ifdef LIBTORRENT_0_15
|
||||
// Flush data
|
||||
h.flush_cache();
|
||||
#endif
|
||||
if(QFile::exists(file_path))
|
||||
if(QFile::exists(file_path)) {
|
||||
#ifdef Q_WS_WIN
|
||||
QDesktopServices::openUrl(QUrl("file:///"+file_path));
|
||||
#else
|
||||
QDesktopServices::openUrl(QUrl("file://"+file_path));
|
||||
else
|
||||
#endif
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("I/O Error"), tr("This file does not exist yet."));
|
||||
}
|
||||
} else {
|
||||
// FOLDER
|
||||
QStringList path_items;
|
||||
|
@ -511,10 +516,15 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
|||
// Flush data
|
||||
h.flush_cache();
|
||||
#endif
|
||||
if(QFile::exists(file_path))
|
||||
if(QFile::exists(file_path)) {
|
||||
#ifdef Q_WS_WIN
|
||||
QDesktopServices::openUrl(QUrl("file:///"+file_path));
|
||||
#else
|
||||
QDesktopServices::openUrl(QUrl("file://"+file_path));
|
||||
else
|
||||
#endif
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("I/O Error"), tr("This folder does not exist yet."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue