From f34ed0b633f30a6871a0d82409b1490565d1c96d Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Fri, 18 Jun 2021 11:41:54 +0300 Subject: 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 --- src/libs/installer/repository.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libs/installer') 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 #include #include +#include /*! \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(); -- cgit v1.2.3