mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[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.
This commit is contained in:
parent
06bd8749a2
commit
2b91608b82
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue