C++/QmlJS: Warnings if C++ based QML type detection fails.

Change-Id: I1e206e09c4068cc541978ee148f9ed8c4138c249
Reviewed-on: http://codereview.qt.nokia.com/3579
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-24 10:55:48 +02:00
parent 2c7729eeac
commit 94a00259ac
6 changed files with 102 additions and 15 deletions

View File

@@ -698,10 +698,17 @@ void ModelManager::loadPluginTypes(const QString &libraryPath, const QString &im
// is called *inside a c++ parsing thread*, to allow hanging on to source and ast
void ModelManager::maybeQueueCppQmlTypeUpdate(const CPlusPlus::Document::Ptr &doc)
{
// avoid scanning documents without source code available
doc->keepSourceAndAST();
if (doc->source().isEmpty()) {
doc->releaseSourceAndAST();
return;
}
// keep source and AST alive if we want to scan for register calls
const bool scan = FindExportedCppTypes::maybeExportsTypes(doc);
if (scan)
doc->keepSourceAndAST();
if (!scan)
doc->releaseSourceAndAST();
// delegate actual queuing to the gui thread
QMetaObject::invokeMethod(this, "queueCppQmlTypeUpdate",