[libcalamaresui] Avoid requirements-results UI duplication

If the requirements checking is **really fast**, e.g. you don't
have a check for internet connectivity, then the checks
might be done as fast as the 0-timeout single-shot timer,
which means that finished() is called once by the QFutureWatcher,
and then after that by the QTimer .. leading to two messages
"All requirements have been checked", but also twice
requirementsComplete being emitted, so you end up with two
results lists being added by the CheckerContainer.

Stop that by using the results-progress timer as an additional
flag: the first time everything is complete, delete that timer
and set the pointer back to nullptr.
main
Adriaan de Groot 6 years ago
parent 06bd8749a2
commit 2b91608b82

@ -99,12 +99,15 @@ RequirementsChecker::run()
void
RequirementsChecker::finished()
{
if ( std::all_of( m_watchers.cbegin(), m_watchers.cend(), []( const Watcher *w ) { return w && w->isFinished(); } ) )
if ( m_progressTimer && std::all_of( m_watchers.cbegin(), m_watchers.cend(), []( const Watcher *w ) { return w && w->isFinished(); } ) )
{
cDebug() << "All requirements have been checked.";
if ( m_progressTimer )
{
m_progressTimer->stop();
delete m_progressTimer;
m_progressTimer = nullptr;
}
bool acceptable = true;
int count = 0;

Loading…
Cancel
Save