Fix "file://" urls correction for case of launch portable GD via network

This commit is contained in:
Abs62 2019-08-05 17:51:57 +03:00
parent ebc301a7bf
commit a722b3f43d

View file

@ -327,7 +327,10 @@ QNetworkReply * ArticleNetworkAccessManager::createRequest( Operation op,
if( req.url().host().isEmpty() && articleMaker.adjustFilePath( fileName ) ) if( req.url().host().isEmpty() && articleMaker.adjustFilePath( fileName ) )
{ {
QUrl newUrl( req.url() ); 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 ); QNetworkRequest newReq( req );
newReq.setUrl( newUrl ); newReq.setUrl( newUrl );