Hack around QDesktopServices::openUrl to support network shares

This commit is contained in:
Nick Tiskov 2013-11-10 23:53:38 +04:00
parent 6e77d12ac6
commit bd9dcf1247
3 changed files with 20 additions and 6 deletions

View file

@ -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."));
}