From 875bbfc6cb34687d49e94b20d4033af410c3494d Mon Sep 17 00:00:00 2001 From: Rodney Date: Oct 08 2021 15:38:53 +0000 Subject: Merge pull request #4095 from shun-iwasawa/g/fix_show_folder_contents Fix "Show Folder Contents" command for UNC path --- diff --git a/toonz/sources/toonz/fileselection.cpp b/toonz/sources/toonz/fileselection.cpp index 7e1973c..e009bd5 100644 --- a/toonz/sources/toonz/fileselection.cpp +++ b/toonz/sources/toonz/fileselection.cpp @@ -327,12 +327,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()))); } //------------------------------------------------------------------------