summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-06-18 11:41:54 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-06-18 11:26:43 +0000
commitf34ed0b633f30a6871a0d82409b1490565d1c96d (patch)
tree1b792d5f704bcc3be201ffed2b359a169c9bbbb7
parent1e1c4311ff71560be62589547d3113683b6084e1 (diff)
Fix usage of '--install-compressed-repository' with a relative file path
Use a function overload of QUrl::fromUserInput that takes a workingDirectory parameter, in order to be able to handle relative paths. Otherwise a string pointing to a relative local file path is handled as a short form of a HTTP URL. Change-Id: I5811661680728e79555ea7b99d0a1e8a8f294b44 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r--src/libs/installer/repository.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/installer/repository.cpp b/src/libs/installer/repository.cpp
index e959d8550..50f3eceb6 100644
--- a/src/libs/installer/repository.cpp
+++ b/src/libs/installer/repository.cpp
@@ -32,6 +32,7 @@
#include <QDataStream>
#include <QFileInfo>
#include <QStringList>
+#include <QDir>
/*!
\fn inline uint QInstaller::qHash(const Repository &repository)
@@ -89,7 +90,7 @@ Repository::Repository(const QUrl &url, bool isDefault, bool compressed)
*/
Repository Repository::fromUserInput(const QString &repositoryUrl, bool compressed)
{
- QUrl url = QUrl::fromUserInput(repositoryUrl);
+ QUrl url = QUrl::fromUserInput(repositoryUrl, QDir::currentPath());
const QStringList supportedSchemes = KDUpdater::FileDownloaderFactory::supportedSchemes();
if (!supportedSchemes.contains(url.scheme()) && QFileInfo(url.toString()).exists())
url = QLatin1String("file:///") + url.toString();