mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 03:28:41 -07:00
Hack around QDesktopServices::openUrl to support network shares
This commit is contained in:
parent
6e77d12ac6
commit
bd9dcf1247
3 changed files with 20 additions and 6 deletions
|
@ -419,7 +419,9 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
|||
// Flush data
|
||||
h.flush_cache();
|
||||
if (QFile::exists(file_path)) {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(file_path));
|
||||
// Hack to access samba shares with QDesktopServices::openUrl
|
||||
const QString p = file_path.startsWith("//") ? QString("file:") + file_path : file_path;
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(p));
|
||||
} else {
|
||||
QMessageBox::warning(this, tr("I/O Error"), tr("This file does not exist yet."));
|
||||
}
|
||||
|
@ -439,7 +441,9 @@ void PropertiesWidget::openDoubleClickedFile(QModelIndex index) {
|
|||
// Flush data
|
||||
h.flush_cache();
|
||||
if (QFile::exists(file_path)) {
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(file_path));
|
||||
// Hack to access samba shares with QDesktopServices::openUrl
|
||||
const QString p = file_path.startsWith("//") ? QString("file:") + file_path : file_path;
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(p));
|
||||
} 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