QmlJS: Separate metaObjectRevision from minor version number.

They need not to be identical. Additionally:
* Rename ImportInfo::name to path, because that's what it does.
* Add ImportInfo::name, for getting the uri with the names
  separated by dots.
* Allow for exportMetaObjectRevisions in qmltypes files.
* Allow for exports with an empty type name, as generated by
  qmlRegisterRevision. They are used for associating meta object
  revisions with non-exported types.
* Rewrite the Qt 4.7 import to QtQuick 1.0 at an early stage. In
  preparation for the Qt 5 type information update, where Qt 4.7
  is gone.

Change-Id: Ia287193623d9530a56b9eb8d2481d50aabd94c3e
Reviewed-on: http://codereview.qt-project.org/5309
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-09-21 12:42:27 +02:00
parent 22e2c0ad2c
commit fdd0a15ef4
14 changed files with 145 additions and 52 deletions

View File

@@ -419,7 +419,7 @@ class QMLJS_EXPORT QmlObjectValue: public ObjectValue
public:
QmlObjectValue(LanguageUtils::FakeMetaObject::ConstPtr metaObject, const QString &className,
const QString &moduleName, const LanguageUtils::ComponentVersion &componentVersion,
const LanguageUtils::ComponentVersion &importVersion,
const LanguageUtils::ComponentVersion &importVersion, int metaObjectRevision,
ValueOwner *valueOwner);
virtual ~QmlObjectValue();
@@ -464,6 +464,7 @@ private:
const LanguageUtils::ComponentVersion _importVersion;
mutable QHash<int, const Value *> _metaSignature;
QHash<QString, const QmlEnumValue * > _enums;
int _metaObjectRevision;
};
class QMLJS_EXPORT Activation
@@ -823,17 +824,21 @@ public:
};
ImportInfo();
ImportInfo(Type type, const QString &name,
ImportInfo(Type type, const QString &path, const QString &name = QString(),
LanguageUtils::ComponentVersion version = LanguageUtils::ComponentVersion(),
AST::UiImport *ast = 0);
bool isValid() const;
Type type() const;
// LibraryImport: uri with '/' separator
// Other: absoluteFilePath
// LibraryImport: uri with ',' separator
// Other: non-absolute path
QString name() const;
// LibraryImport: uri with QDir::separator separator
// Other: absoluteFilePath
QString path() const;
// null if the import has no 'as', otherwise the target id
QString id() const;
@@ -843,6 +848,7 @@ public:
private:
Type _type;
QString _name;
QString _path;
LanguageUtils::ComponentVersion _version;
AST::UiImport *_ast;
};