Read qmldir files in a thread and cache them in Snapshot.

Reviewed-by: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-03-18 15:43:33 +01:00
parent 4261aca7b0
commit 6eadfa3ac0
8 changed files with 104 additions and 13 deletions

View File

@@ -202,6 +202,22 @@ Bind *Document::bind() const
return _bind;
}
LibraryInfo::LibraryInfo()
: _valid(false)
{
}
LibraryInfo::LibraryInfo(const QmlDirParser &parser)
: _valid(true)
, _components(parser.components())
, _plugins(parser.plugins())
{
}
LibraryInfo::~LibraryInfo()
{
}
Snapshot::Snapshot()
{
}
@@ -216,6 +232,11 @@ void Snapshot::insert(const Document::Ptr &document)
_documents.insert(document->fileName(), document);
}
void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
{
_libraries.insert(path, info);
}
Document::Ptr Snapshot::documentFromSource(const QString &code,
const QString &fileName) const
{