From a722b3f43dc3ddaca186a8541db1845d3d572bd2 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Mon, 5 Aug 2019 17:51:57 +0300 Subject: [PATCH] Fix "file://" urls correction for case of launch portable GD via network --- article_netmgr.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/article_netmgr.cc b/article_netmgr.cc index 21944320..e35ccb15 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -327,7 +327,10 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op, if( req.url().host().isEmpty() && articleMaker.adjustFilePath( fileName ) ) { QUrl newUrl( req.url() ); - newUrl.setPath( Qt4x5::Url::ensureLeadingSlash( QUrl::fromLocalFile( fileName ).path() ) ); + QUrl localUrl = QUrl::fromLocalFile( fileName ); + + newUrl.setHost( localUrl.host() ); + newUrl.setPath( Qt4x5::Url::ensureLeadingSlash( localUrl.path() ) ); QNetworkRequest newReq( req ); newReq.setUrl( newUrl );