work around a bug in url resolution of qmldir files

This commit is contained in:
Marco Martin 2014-01-08 13:05:51 +01:00
parent 63fb80df2a
commit 798b7665d4

View File

@ -59,10 +59,12 @@ QUrl PackageUrlInterceptor::intercept(const QUrl &path, QQmlAbstractUrlIntercept
//qDebug() << "Intercepted URL:" << path;
if (path.scheme() == QStringLiteral("plasmapackage")) {
QUrl pkgUrl;
pkgUrl.setScheme(QStringLiteral("file"));
pkgUrl.setPath(m_package.filePath(0, path.path()));
return pkgUrl;
//FIXME: this is incorrect but works around a bug in qml in resolution of urls of qmldir files
if (type == QQmlAbstractUrlInterceptor::QmldirFile) {
return QUrl(m_package.filePath(0, path.path()));
} else {
return QUrl::fromLocalFile(m_package.filePath(0, path.path()));
}
}
//TODO: security: permission for remote urls