Commit f092ad0a authored by Robert Loehning's avatar Robert Loehning
Browse files

Simplify TestResultsPane::visibilityChanged



Change-Id: Ie278384bb0fe899989a01a0ad89455b11059787f
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 21afdf22
...@@ -185,23 +185,20 @@ void TestResultsPane::clearContents() ...@@ -185,23 +185,20 @@ void TestResultsPane::clearContents()
void TestResultsPane::visibilityChanged(bool visible) void TestResultsPane::visibilityChanged(bool visible)
{ {
if (visible == m_wasVisibleBefore)
return;
if (visible) { if (visible) {
if (m_wasVisibleBefore)
return;
connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged, connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
this, &TestResultsPane::onTestTreeModelChanged); this, &TestResultsPane::onTestTreeModelChanged);
// make sure run/run all are in correct state // make sure run/run all are in correct state
onTestTreeModelChanged(); onTestTreeModelChanged();
m_wasVisibleBefore = true;
TestTreeModel::instance()->enableParsing(); TestTreeModel::instance()->enableParsing();
} else { } else {
if (!m_wasVisibleBefore)
return;
disconnect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged, disconnect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
this, &TestResultsPane::onTestTreeModelChanged); this, &TestResultsPane::onTestTreeModelChanged);
m_wasVisibleBefore = false;
TestTreeModel::instance()->disableParsing(); TestTreeModel::instance()->disableParsing();
} }
m_wasVisibleBefore = visible;
} }
void TestResultsPane::setFocus() void TestResultsPane::setFocus()
......
Supports Markdown
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