1 | // Copyright (C) 2016 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 "qurlhelper_p.h" |
5 | |
6 | QT_BEGIN_NAMESPACE |
7 | |
8 | namespace Qt3DCore { |
9 | |
10 | QString QUrlHelper::urlToLocalFileOrQrc(const QUrl &url) |
11 | { |
12 | const QString scheme(url.scheme().toLower()); |
13 | if (scheme == QLatin1String("qrc")) { |
14 | if (url.authority().isEmpty()) |
15 | return QLatin1Char(':') + url.path(); |
16 | return QString(); |
17 | } |
18 | |
19 | #if defined(Q_OS_ANDROID) |
20 | if (scheme == QLatin1String("assets")) { |
21 | if (url.authority().isEmpty()) |
22 | return url.toString(); |
23 | return QString(); |
24 | } |
25 | #endif |
26 | |
27 | return url.toLocalFile(); |
28 | } |
29 | |
30 | } // Qt3DCore |
31 | |
32 | QT_END_NAMESPACE |
33 |