From 209efae5307bf6cf519848205dbbe637c62c4ae2 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 13 Feb 2015 14:11:08 +0100 Subject: Make scene parsers operate on URLs instead of raw filenames This way they are compatible with how mesh and texture source URLs are handled. Change-Id: Ifeee504fd3f5957d23f5cade92a73663488bdaf9 Reviewed-by: Sean Harmer --- src/render/io/gltfparser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/render/io/gltfparser.cpp') diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp index 459655771..c11e4d8f6 100644 --- a/src/render/io/gltfparser.cpp +++ b/src/render/io/gltfparser.cpp @@ -50,6 +50,7 @@ #include #include #include +#include #include #include @@ -285,8 +286,9 @@ bool GLTFParser::setJSON( QJsonDocument json ) * Sets the \a path used by the parser to load the scene file. * If the file is valid, parsing is automatically triggered. */ -void GLTFParser::setFilePath(const QString &path) +void GLTFParser::setSource(const QUrl &source) { + const QString path = QUrlHelper::urlToLocalFileOrQrc(source); QFileInfo finfo(path); if (!finfo.exists()) { qWarning() << "missing file:" << path; @@ -307,8 +309,9 @@ void GLTFParser::setFilePath(const QString &path) * Returns true if the extension of \a path is supported by the * GLTF parser. */ -bool GLTFParser::isPathExtensionSupported(const QString &path) +bool GLTFParser::isExtensionSupported(const QUrl &source) { + const QString path = QUrlHelper::urlToLocalFileOrQrc(source); return GLTFParser::isGLTFPath(path); } -- cgit v1.2.3