\class QQmlFile
\brief The QQmlFile class gives access to local and remote files.
-Supports file://, qrc://, bundle:// uris and whatever QNetworkAccessManager supports.
+Supports file://, qrc:/, bundle:// uris and whatever QNetworkAccessManager supports.
*/
#define QQMLFILE_MAX_REDIRECT_RECURSION 16
/*!
Returns true if QQmlFile will open \a url synchronously.
-Synchronous urls have a qrc://, file://, or bundle:// scheme.
+Synchronous urls have a qrc:/, file://, or bundle:// scheme.
*/
bool QQmlFile::isSynchronous(const QUrl &url)
{
/*!
Returns true if QQmlFile will open \a url synchronously.
-Synchronous urls have a qrc://, file://, or bundle:// scheme.
+Synchronous urls have a qrc:/, file://, or bundle:// scheme.
*/
bool QQmlFile::isSynchronous(const QString &url)
{
- if (url.length() < 6 /* qrc:// */)
+ if (url.length() < 5 /* qrc:/ */)
return false;
QChar f = url[0];
} else if (f == QLatin1Char('q') || f == QLatin1Char('Q')) {
- return url.length() >= 6 /* bundle:// */ &&
+ return url.length() >= 5 /* qrc:/ */ &&
url.startsWith(qrc_string, Qt::CaseInsensitive) &&
- url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/') && url[5] == QLatin1Char('/');
+ url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/');
}
/*!
Returns true if \a url is a local file that can be opened with QFile.
-Local file urls have either a qrc:// or file:// scheme.
+Local file urls have either a qrc:/ or file:// scheme.
*/
bool QQmlFile::isLocalFile(const QUrl &url)
{
/*!
Returns true if \a url is a local file that can be opened with QFile.
-Local file urls have either a qrc:// or file:// scheme.
+Local file urls have either a qrc:/ or file:// scheme.
*/
bool QQmlFile::isLocalFile(const QString &url)
{
- if (url.length() < 6 /* qrc:// */)
+ if (url.length() < 5 /* qrc:/ */)
return false;
QChar f = url[0];
} else if (f == QLatin1Char('q') || f == QLatin1Char('Q')) {
- return url.length() >= 6 /* bundle:// */ &&
+ return url.length() >= 5 /* qrc:/ */ &&
url.startsWith(qrc_string, Qt::CaseInsensitive) &&
- url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/') && url[5] == QLatin1Char('/');
+ url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/');
}