forked from qt-creator/qt-creator
Simplify TestResultsPane::visibilityChanged
Change-Id: Ie278384bb0fe899989a01a0ad89455b11059787f Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -185,23 +185,20 @@ void TestResultsPane::clearContents()
|
||||
|
||||
void TestResultsPane::visibilityChanged(bool visible)
|
||||
{
|
||||
if (visible) {
|
||||
if (m_wasVisibleBefore)
|
||||
if (visible == m_wasVisibleBefore)
|
||||
return;
|
||||
if (visible) {
|
||||
connect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
|
||||
this, &TestResultsPane::onTestTreeModelChanged);
|
||||
// make sure run/run all are in correct state
|
||||
onTestTreeModelChanged();
|
||||
m_wasVisibleBefore = true;
|
||||
TestTreeModel::instance()->enableParsing();
|
||||
} else {
|
||||
if (!m_wasVisibleBefore)
|
||||
return;
|
||||
disconnect(TestTreeModel::instance(), &TestTreeModel::testTreeModelChanged,
|
||||
this, &TestResultsPane::onTestTreeModelChanged);
|
||||
m_wasVisibleBefore = false;
|
||||
TestTreeModel::instance()->disableParsing();
|
||||
}
|
||||
m_wasVisibleBefore = visible;
|
||||
}
|
||||
|
||||
void TestResultsPane::setFocus()
|
||||
|
Reference in New Issue
Block a user