AssetDownloader Add a virtual method for resolving urls
Change-Id: Ie771fd955e6b44ff4825243791029c4fcea0d493 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 3e3cf6dca96180a4f86c0780baad93fb29c2c994) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
cfc50c7026
commit
d699966713
@ -377,7 +377,7 @@ void AssetDownloader::start()
|
||||
}
|
||||
storage->tempDir = d->m_temporaryDir->path();
|
||||
d->setLocalDownloadDir(baseLocalDir(d->m_preferredLocalDownloadDir));
|
||||
precheckLocalFile(d->m_offlineAssetsFilePath);
|
||||
precheckLocalFile(resolvedUrl(d->m_offlineAssetsFilePath));
|
||||
return SetupResult::Continue;
|
||||
};
|
||||
|
||||
@ -397,7 +397,7 @@ void AssetDownloader::start()
|
||||
return DoneResult::Error;
|
||||
}
|
||||
|
||||
QFile file(pathFromUrl(d->m_offlineAssetsFilePath));
|
||||
QFile file(pathFromUrl(resolvedUrl(d->m_offlineAssetsFilePath)));
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
qWarning() << "Also failed to open" << d->m_offlineAssetsFilePath;
|
||||
return DoneResult::Error;
|
||||
@ -552,6 +552,11 @@ void AssetDownloader::start()
|
||||
[this](DoneWith result) { emit finished(result == DoneWith::Success); });
|
||||
}
|
||||
|
||||
QUrl AssetDownloader::resolvedUrl(const QUrl &url) const
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
} // namespace Assets::Downloader
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -89,6 +89,9 @@ public:
|
||||
public Q_SLOTS:
|
||||
void start();
|
||||
|
||||
protected:
|
||||
virtual QUrl resolvedUrl(const QUrl &url) const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void started();
|
||||
void finished(bool success);
|
||||
|
Loading…
x
Reference in New Issue
Block a user