| 1 | // Copyright (C) 2024 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include "qqmlassetdownloader_p.h" |
| 5 | #include <QtQml/qqmlcontext.h> |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | using Assets::Downloader::AssetDownloader; |
| 10 | using Assets::Downloader::AssetDownloaderHelper; |
| 11 | using Assets::Downloader::QQmlAssetDownloader; |
| 12 | |
| 13 | AssetDownloaderHelper::AssetDownloaderHelper(QObject *parent) |
| 14 | : AssetDownloader(parent) |
| 15 | {} |
| 16 | |
| 17 | QUrl AssetDownloaderHelper::resolvedUrl(const QUrl &url) const |
| 18 | { |
| 19 | const QQmlContext *context = qmlContext(this); |
| 20 | return context ? context->resolvedUrl(url) : url; |
| 21 | } |
| 22 | |
| 23 | AssetDownloaderHelper *QQmlAssetDownloader::create(QQmlEngine *, QJSEngine *) |
| 24 | { |
| 25 | return new AssetDownloaderHelper(); |
| 26 | } |
| 27 | |
| 28 | QT_END_NAMESPACE |
| 29 |
