1
0

fix: cannot load images under WSL2 network location

workaround resolve GH-7
This commit is contained in:
Gary Wang
2020-08-28 13:44:41 +08:00
parent 761f5e064c
commit 9f67be61fb
2 changed files with 19 additions and 0 deletions

View File

@@ -37,6 +37,14 @@ int main(int argc, char *argv[])
QList<QUrl> urlList;
for (const QString & str : urlStrList) {
QUrl url = QUrl::fromLocalFile(str);
#ifdef Q_OS_WIN
// TODO: remove this workaround when M$ change the "wsl$" hostname.
if (Q_UNLIKELY(str.startsWith(R"(\\wsl$\)"))) {
url.clear();
url.setScheme(QStringLiteral("qtbug-86277"));
url.setPath(str);
}
#endif // Q_OS_WIN
if (url.isValid()) {
urlList.append(url);
}