Commit 7a8b73a0 authored by Christian Stenger's avatar Christian Stenger

Fix enabling and disabling test code parser

Change-Id: If03752aaf3db36929e5e9d1b468e691e4dab1b96
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent 00ca77a5
......@@ -102,6 +102,7 @@ TestTreeModel::~TestTreeModel()
void TestTreeModel::enableParsing()
{
m_refCounter.ref();
m_parser->setState(TestCodeParser::Idle);
if (m_connectionsInitialized)
return;
......@@ -128,7 +129,8 @@ void TestTreeModel::enableParsing()
void TestTreeModel::disableParsing()
{
m_parser->setState(TestCodeParser::Disabled);
if (!m_refCounter.deref())
m_parser->setState(TestCodeParser::Disabled);
}
QModelIndex TestTreeModel::index(int row, int column, const QModelIndex &parent) const
......
......@@ -112,6 +112,7 @@ private:
TestTreeItem *m_quickTestRootItem;
TestCodeParser *m_parser;
bool m_connectionsInitialized;
QAtomicInt m_refCounter;
};
class TestTreeSortFilterModel : public QSortFilterProxyModel
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment