qmljs: add isIdle method to detect background parsing/scannig

If the qmljsmodel has no background task, then isIdle returns true

Change-Id: I31420343c560c5ed118f371f7be347eadb6622f4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-11-06 16:24:26 +01:00
committed by Fawzi Mohamed
parent 7c9c5bda94
commit 7e1b512f31
2 changed files with 6 additions and 0 deletions

View File

@@ -629,6 +629,11 @@ ModelManagerInterface::ProjectInfo ModelManagerInterface::projectInfoForPath(QSt
return res; return res;
} }
bool ModelManagerInterface::isIdle() const
{
return m_synchronizer.futures().isEmpty();
}
void ModelManagerInterface::emitDocumentChangedOnDisk(Document::Ptr doc) void ModelManagerInterface::emitDocumentChangedOnDisk(Document::Ptr doc)
{ emit documentChangedOnDisk(doc); } { emit documentChangedOnDisk(doc); }

View File

@@ -182,6 +182,7 @@ public:
void emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc); void emitDocumentChangedOnDisk(QmlJS::Document::Ptr doc);
void updateQrcFile(const QString &path); void updateQrcFile(const QString &path);
ProjectInfo projectInfoForPath(QString path) const; ProjectInfo projectInfoForPath(QString path) const;
bool isIdle() const ;
PathsAndLanguages importPaths() const; PathsAndLanguages importPaths() const;
QmlJS::QmlLanguageBundles activeBundles() const; QmlJS::QmlLanguageBundles activeBundles() const;