Skip to content

Commit

Permalink
Refs #8716. Make empty list case handling better.
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Jan 21, 2014
1 parent 9cb7972 commit 93b8ae8
Showing 1 changed file with 19 additions and 15 deletions.
Expand Up @@ -346,33 +346,37 @@ void MuonAnalysisResultTableTab::populateTables()
{
storeUserSettings();

QStringList fittedWsList = getFittedWorkspaces();

// Clear the previous table values
m_logValues.clear();
m_uiForm.fittingResultsTable->setRowCount(0);
m_uiForm.valueTable->setRowCount(0);

// Populate the individual log values and fittings into their respective tables.
populateFittings(fittedWsList);
populateLogsAndValues(fittedWsList);

// Make sure all fittings are selected by default.
selectAllFittings(true);
QStringList fittedWsList = getFittedWorkspaces();

// If we have Run Number log value, we want to select it by default.
auto found = m_uiForm.valueTable->findItems(RUN_NO_TITLE.c_str(), Qt::MatchFixedString);
if ( ! found.empty() )
if ( ! fittedWsList.isEmpty() )
{
int r = found[0]->row();
// Populate the individual log values and fittings into their respective tables.
populateFittings(fittedWsList);
populateLogsAndValues(fittedWsList);

// Make sure all fittings are selected by default.
selectAllFittings(true);

if( auto cb = dynamic_cast<QCheckBox*>(m_uiForm.valueTable->cellWidget(r, 1)) )
// If we have Run Number log value, we want to select it by default.
auto found = m_uiForm.valueTable->findItems(RUN_NO_TITLE.c_str(), Qt::MatchFixedString);
if ( ! found.empty() )
{
cb->setCheckState(Qt::Checked);
int r = found[0]->row();

if( auto cb = dynamic_cast<QCheckBox*>(m_uiForm.valueTable->cellWidget(r, 1)) )
{
cb->setCheckState(Qt::Checked);
}
}

applyUserSettings();
}

applyUserSettings();
}


Expand Down

0 comments on commit 93b8ae8

Please sign in to comment.