From 94827cb78008d0b4acc722be5ee16b62d3f0b646 Mon Sep 17 00:00:00 2001 From: Team YAYC Date: Sat, 10 Jun 2023 12:30:29 +0300 Subject: [PATCH] Fix windoze again --- main.cpp | 3 ++- main.qml | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 4d3301e..d6193fb 100644 --- a/main.cpp +++ b/main.cpp @@ -924,7 +924,8 @@ class RequestInterceptor : public QWebEngineUrlRequestInterceptor if (newPath.startsWith("file://")) { newPath = newPath.mid(7); #if defined(Q_OS_WINDOWS) - newPath = newPath.mid(1); // Strip one more / + if (newPath[0] == '/') + newPath = newPath.mid(1); // Strip one more / #endif } diff --git a/main.qml b/main.qml index 1856d07..b4f97c8 100644 --- a/main.qml +++ b/main.qml @@ -364,7 +364,12 @@ ApplicationWindow { } function deUrlizePath(path) { - return path.slice(7) // strip file:// + path = path.slice(7) // strip file:// + if (Qt.platform.os === "windows" && + path[0] === '/') { + path = path.slice(1) + } + return path } function isCurrentVideoAdded(key, trigger) {