chore: remove the wsl workaround since Qt 5.15.2 fixed the issue

This commit is contained in:
Gary Wang 2020-12-17 13:04:33 +08:00
parent 50457a7fc4
commit 01443d5ad4
3 changed files with 1 additions and 25 deletions

View File

@ -31,13 +31,6 @@ void GraphicsView::showFileFromUrl(const QUrl &url, bool doRequestGallery)
QString filePath(url.toLocalFile()); QString filePath(url.toLocalFile());
#ifdef Q_OS_WIN
// TODO: remove this workaround when M$ change the "wsl$" hostname.
if (Q_UNLIKELY(url.scheme() == QStringLiteral("qtbug-86277"))) {
filePath = url.path();
}
#endif // Q_OS_WIN
if (filePath.endsWith(".svg")) { if (filePath.endsWith(".svg")) {
showSvg(filePath); showSvg(filePath);
} else if (filePath.endsWith(".gif")) { } else if (filePath.endsWith(".gif")) {

View File

@ -37,14 +37,6 @@ int main(int argc, char *argv[])
QList<QUrl> urlList; QList<QUrl> urlList;
for (const QString & str : urlStrList) { for (const QString & str : urlStrList) {
QUrl url = QUrl::fromLocalFile(str); 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()) { if (url.isValid()) {
urlList.append(url); urlList.append(url);
} }

View File

@ -244,16 +244,7 @@ void MainWindow::loadGalleryBySingleLocalFile(const QString &path)
for (int i = 0; i < entryList.count(); i++) { for (int i = 0; i < entryList.count(); i++) {
const QString & fileName = entryList.at(i); const QString & fileName = entryList.at(i);
const QString & oneEntry = dir.absoluteFilePath(fileName); const QString & oneEntry = dir.absoluteFilePath(fileName);
QUrl url = QUrl::fromLocalFile(oneEntry); const QUrl & url = QUrl::fromLocalFile(oneEntry);
#ifdef Q_OS_WIN
// TODO: remove this workaround when M$ change the "wsl$" hostname.
// Qt will convert path "\\wsl$\" to "//wsl$/"...
if (Q_UNLIKELY(oneEntry.startsWith(R"(//wsl$/)"))) {
url.clear();
url.setScheme(QStringLiteral("qtbug-86277"));
url.setPath(oneEntry);
}
#endif // Q_OS_WIN
m_files.append(url); m_files.append(url);
if (fileName == currentFileName) { if (fileName == currentFileName) {
m_currentFileIndex = i; m_currentFileIndex = i;