forked from qt-creator/qt-creator
Fix enabling and disabling test code parser
Change-Id: If03752aaf3db36929e5e9d1b468e691e4dab1b96 Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
@@ -102,6 +102,7 @@ TestTreeModel::~TestTreeModel()
|
||||
|
||||
void TestTreeModel::enableParsing()
|
||||
{
|
||||
m_refCounter.ref();
|
||||
m_parser->setState(TestCodeParser::Idle);
|
||||
if (m_connectionsInitialized)
|
||||
return;
|
||||
@@ -128,6 +129,7 @@ void TestTreeModel::enableParsing()
|
||||
|
||||
void TestTreeModel::disableParsing()
|
||||
{
|
||||
if (!m_refCounter.deref())
|
||||
m_parser->setState(TestCodeParser::Disabled);
|
||||
}
|
||||
|
||||
|
@@ -112,6 +112,7 @@ private:
|
||||
TestTreeItem *m_quickTestRootItem;
|
||||
TestCodeParser *m_parser;
|
||||
bool m_connectionsInitialized;
|
||||
QAtomicInt m_refCounter;
|
||||
};
|
||||
|
||||
class TestTreeSortFilterModel : public QSortFilterProxyModel
|
||||
|
Reference in New Issue
Block a user