From fc91db4227c0625bf44cc0d7cf77f94d62322abf Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 11 Mar 2010 14:44:16 -0600 Subject: [PATCH] CalculateCoefficientsOfAffixness(): fix status display Clear status bar text on completion. --- Lexicon_Compounds.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Lexicon_Compounds.cpp b/Lexicon_Compounds.cpp index d063de7..b5eca87 100644 --- a/Lexicon_Compounds.cpp +++ b/Lexicon_Compounds.cpp @@ -707,15 +707,13 @@ void CLexicon::CalculateCoefficientsOfAffixness() QList* pStems; - m_pDoc->setStatusBar1( "Calculating affixness..." ); - m_pDoc->BeginCountDown(); - + linguistica::ui::status_user_agent& status = status_display(); + status.major_operation = "Calculating affixness..."; + status.progress.clear(); + status.progress.set_denominator(m_pCompounds->GetComponentMap()->count()); ComponentMap::Iterator it; - for( it = m_pCompounds->GetComponentMap()->begin(); it != m_pCompounds->GetComponentMap()->end(); ++it ) - { - m_pDoc->CountDownOnStatusBar( ++count, m_pCompounds->GetComponentMap()->count(), - m_pCompounds->GetComponentMap()->count()/100 ); - + for (it = m_pCompounds->GetComponentMap()->begin(); it != m_pCompounds->GetComponentMap()->end(); ++it) { + status.progress = ++count; double affix_prob = 0.0, component_prob = 0.0; @@ -840,9 +838,8 @@ void CLexicon::CalculateCoefficientsOfAffixness() else pStem->SetAffixness( affix_prob / ( affix_prob + component_prob ) ); } } - - m_pDoc->setStatusBar1( "" ); - m_pDoc->EndCountDown(); + status.progress.clear(); + status.major_operation.clear(); } -- 2.11.4.GIT