From 01443d5ad4f7dfe180e799ed7aaab7e87d2198e7 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Thu, 17 Dec 2020 13:04:33 +0800 Subject: [PATCH] chore: remove the wsl workaround since Qt 5.15.2 fixed the issue --- app/graphicsview.cpp | 7 ------- app/main.cpp | 8 -------- app/mainwindow.cpp | 11 +---------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/app/graphicsview.cpp b/app/graphicsview.cpp index b3d3d97..c61dc04 100644 --- a/app/graphicsview.cpp +++ b/app/graphicsview.cpp @@ -31,13 +31,6 @@ void GraphicsView::showFileFromUrl(const QUrl &url, bool doRequestGallery) 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")) { showSvg(filePath); } else if (filePath.endsWith(".gif")) { diff --git a/app/main.cpp b/app/main.cpp index 251476d..71da5e0 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -37,14 +37,6 @@ int main(int argc, char *argv[]) QList 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); } diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 4b864ed..1d67962 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -244,16 +244,7 @@ void MainWindow::loadGalleryBySingleLocalFile(const QString &path) for (int i = 0; i < entryList.count(); i++) { const QString & fileName = entryList.at(i); const QString & oneEntry = dir.absoluteFilePath(fileName); - 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 + const QUrl & url = QUrl::fromLocalFile(oneEntry); m_files.append(url); if (fileName == currentFileName) { m_currentFileIndex = i;