fix show folder contents for unc path

This commit is contained in:
shun-iwasawa 2021-10-08 17:17:56 +09:00 committed by manongjohn
parent 63d31c2d60
commit 4e6159a4b7

View file

@ -328,12 +328,16 @@ void FileSelection::showFolderContents() {
if (!model) return;
folderPath = model->getFolder();
}
if (TSystem::isUNC(folderPath))
QDesktopServices::openUrl(
if (TSystem::isUNC(folderPath)) {
bool ok = QDesktopServices::openUrl(
QUrl(QString::fromStdWString(folderPath.getWideString())));
else
QDesktopServices::openUrl(QUrl::fromLocalFile(
QString::fromStdWString(folderPath.getWideString())));
if (ok) return;
// If the above fails, then try opening UNC path with the same way as the
// local files.. QUrl::fromLocalFile() seems to work for UNC path as well in
// our environment. (8/10/2021 shun-iwasawa)
}
QDesktopServices::openUrl(
QUrl::fromLocalFile(QString::fromStdWString(folderPath.getWideString())));
}
//------------------------------------------------------------------------