Qml: Make import classification in Bind less verbose.

This commit is contained in:
Christian Kamm
2010-09-16 09:40:19 +02:00
parent b7384af062
commit 97c07292aa
4 changed files with 38 additions and 47 deletions

View File

@@ -52,14 +52,22 @@ public:
virtual ~Bind();
struct ImportInfo {
enum Type {
LibraryImport,
FileImport,
DirectoryImport,
InvalidFileImport // refers a file/directoy that wasn't found
};
Type type;
// LibraryImport: uri with '/' separator
// Other: absoluteFilePath
QString name;
ComponentVersion version;
AST::UiImport *ast;
};
QList<ImportInfo> fileImports() const;
QList<ImportInfo> directoryImports() const;
QList<ImportInfo> libraryImports() const;
QList<ImportInfo> imports() const;
Interpreter::ObjectValue *idEnvironment() const;
Interpreter::ObjectValue *rootObjectValue() const;
@@ -111,9 +119,7 @@ private:
QHash<AST::FunctionDeclaration *, Interpreter::ObjectValue *> _functionScopes;
QStringList _includedScripts;
QList<ImportInfo> _fileImports;
QList<ImportInfo> _directoryImports;
QList<ImportInfo> _libraryImports;
QList<ImportInfo> _imports;
};
} // end of namespace Qml