QmlJS: Allow for QML modules with version subdirectories.

That means
import Foo 2.1
can resolve to
/path/Foo.2.1 or
/path/Foo.2 or
/path/Foo

Task-number: QTCREATORBUG-4607
Change-Id: Ie1efc5be2ca2ed3ccc130e8a662f94aed11bec1a
Reviewed-on: http://codereview.qt.nokia.com/194
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-05-27 14:51:30 +02:00
parent 42e5e5f00a
commit 8742026380
6 changed files with 106 additions and 36 deletions

View File

@@ -132,8 +132,14 @@ public:
TypeInfoFileError
};
enum Status {
NotScanned,
NotFound,
Found
};
private:
bool _valid;
Status _status;
QList<QmlDirParser::Component> _components;
QList<QmlDirParser::Plugin> _plugins;
typedef QList<LanguageUtils::FakeMetaObject::ConstPtr> FakeMetaObjectList;
@@ -143,8 +149,8 @@ private:
QString _dumpError;
public:
LibraryInfo();
LibraryInfo(const QmlDirParser &parser);
explicit LibraryInfo(Status status = NotScanned);
explicit LibraryInfo(const QmlDirParser &parser);
~LibraryInfo();
QList<QmlDirParser::Component> components() const
@@ -160,7 +166,10 @@ public:
{ _metaObjects = objects; }
bool isValid() const
{ return _valid; }
{ return _status == Found; }
bool wasScanned() const
{ return _status != NotScanned; }
PluginTypeInfoStatus pluginTypeInfoStatus() const
{ return _dumpStatus; }