Fix handling special chars like # in openLocalFileOrDir()
This commit is contained in:
parent
60403202df
commit
783c00b78c
|
@ -16,9 +16,13 @@ bool openLocalFileOrDir(const QString &path)
|
|||
// -> replace backslashes with slashes to support Windows paths
|
||||
QString tmp(path);
|
||||
tmp.replace(QChar('\\'), QChar('/'));
|
||||
return QDesktopServices::openUrl(QUrl(QStringLiteral("file:///") + path, QUrl::TolerantMode));
|
||||
QUrl url(QStringLiteral("file:///"));
|
||||
url.setPath(tmp, QUrl::DecodedMode);
|
||||
return QDesktopServices::openUrl(url);
|
||||
#else
|
||||
return QDesktopServices::openUrl(QUrl(QStringLiteral("file://") + path, QUrl::TolerantMode));
|
||||
QUrl url(QStringLiteral("file://"));
|
||||
url.setPath(path, QUrl::DecodedMode);
|
||||
return QDesktopServices::openUrl(url);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue