From b1690b31899b70401d8a64c3fa54c64363d3f898 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 16 Mar 2018 00:27:36 +0300 Subject: [PATCH 1/2] fix malformed urls on windows (like file:///Users/ai/AppData....) note: the issue happened because drive letter on Windows is treated by QUrl as 'scheme', so replacing it with 'file' results in broken url. --- tools/oven/src/BakerCLI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/oven/src/BakerCLI.cpp b/tools/oven/src/BakerCLI.cpp index f5af5455fb..aac028e8cf 100644 --- a/tools/oven/src/BakerCLI.cpp +++ b/tools/oven/src/BakerCLI.cpp @@ -28,7 +28,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString& // if the URL doesn't have a scheme, assume it is a local file if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp") { - inputUrl.setScheme("file"); + inputUrl = QUrl::fromLocalFile(inputUrl.toString()); } qDebug() << "Baking file type: " << type; From 2439c045281b9c9d47c3b002dba8d0d9821d4d8b Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Wed, 25 Apr 2018 11:04:31 +0300 Subject: [PATCH 2/2] skip url conversion to 'file:///' for the urls which schema is already 'file' --- tools/oven/src/BakerCLI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/oven/src/BakerCLI.cpp b/tools/oven/src/BakerCLI.cpp index aac028e8cf..a908b69f77 100644 --- a/tools/oven/src/BakerCLI.cpp +++ b/tools/oven/src/BakerCLI.cpp @@ -27,7 +27,7 @@ BakerCLI::BakerCLI(OvenCLIApplication* parent) : QObject(parent) { void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString& type) { // if the URL doesn't have a scheme, assume it is a local file - if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp") { + if (inputUrl.scheme() != "http" && inputUrl.scheme() != "https" && inputUrl.scheme() != "ftp" && inputUrl.scheme() != "file") { inputUrl = QUrl::fromLocalFile(inputUrl.toString()); }