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()
|
void TestTreeModel::enableParsing()
|
||||||
{
|
{
|
||||||
|
m_refCounter.ref();
|
||||||
m_parser->setState(TestCodeParser::Idle);
|
m_parser->setState(TestCodeParser::Idle);
|
||||||
if (m_connectionsInitialized)
|
if (m_connectionsInitialized)
|
||||||
return;
|
return;
|
||||||
@@ -128,7 +129,8 @@ void TestTreeModel::enableParsing()
|
|||||||
|
|
||||||
void TestTreeModel::disableParsing()
|
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
|
QModelIndex TestTreeModel::index(int row, int column, const QModelIndex &parent) const
|
||||||
|
@@ -112,6 +112,7 @@ private:
|
|||||||
TestTreeItem *m_quickTestRootItem;
|
TestTreeItem *m_quickTestRootItem;
|
||||||
TestCodeParser *m_parser;
|
TestCodeParser *m_parser;
|
||||||
bool m_connectionsInitialized;
|
bool m_connectionsInitialized;
|
||||||
|
QAtomicInt m_refCounter;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestTreeSortFilterModel : public QSortFilterProxyModel
|
class TestTreeSortFilterModel : public QSortFilterProxyModel
|
||||||
|
Reference in New Issue
Block a user