diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-01-25 14:43:07 +1000 |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2012-01-25 14:43:07 +1000 |
commit | c3601a8db91bc777ea859d6a796dfab6a218675e (patch) | |
tree | d2a4f6c83bec3cddcce020966cccac72be3aa04a /src/declarative/qml/qdeclarativedirparser.cpp | |
parent | 35794301d188b731a7b596d92fc632fff58586c0 (diff) | |
parent | 149f6afe321ce59aebe4ce2f9dddd1881d0ac22b (diff) |
Merge branch 'master' into animation-refactorwip/animation-refactor
Conflicts:
tests/auto/declarative/declarative.pro
Change-Id: Ie339be2989fac553d351f3077869f1847367b504
Diffstat (limited to 'src/declarative/qml/qdeclarativedirparser.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativedirparser.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativedirparser.cpp b/src/declarative/qml/qdeclarativedirparser.cpp index 256157f5b5..c4a11a9a43 100644 --- a/src/declarative/qml/qdeclarativedirparser.cpp +++ b/src/declarative/qml/qdeclarativedirparser.cpp @@ -2,7 +2,7 @@ ** ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) +** Contact: http://www.qt-project.org/ ** ** This file is part of the QtDeclarative module of the Qt Toolkit. ** @@ -103,6 +103,7 @@ bool QDeclarativeDirParser::parse() _errors.clear(); _plugins.clear(); _components.clear(); + _scripts.clear(); if (_source.isEmpty() && !_filePathSouce.isEmpty()) { QFile file(_filePathSouce); @@ -220,9 +221,16 @@ bool QDeclarativeDirParser::parse() const int minorVersion = version.mid(dotIndex + 1).toInt(&validVersionNumber); if (validVersionNumber) { - const Component entry(sections[0], sections[2], majorVersion, minorVersion); - - _components.append(entry); + const QString &fileName = sections[2]; + + if (fileName.endsWith(QLatin1String(".js"))) { + // A 'js' extension indicates a namespaced script import + const Script entry(sections[0], fileName, majorVersion, minorVersion); + _scripts.append(entry); + } else { + const Component entry(sections[0], fileName, majorVersion, minorVersion); + _components.append(entry); + } } } } @@ -275,6 +283,11 @@ QList<QDeclarativeDirParser::Component> QDeclarativeDirParser::components() cons return _components; } +QList<QDeclarativeDirParser::Script> QDeclarativeDirParser::scripts() const +{ + return _scripts; +} + #ifdef QT_CREATOR QList<QDeclarativeDirParser::TypeInfo> QDeclarativeDirParser::typeInfos() const { |