From 18bf925a11e004490a779a0869f03981a95699fa Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 27 Jun 2019 15:30:32 +0200 Subject: [PATCH] [libcalamaresui] Name pending requirements checks - Give each check a name (based on the module it runs for, so there might be overlaps when there are multiple module instances). - Log the remaining checks each time the timeout fires, to help figure out which one is hanging. --- .../modulesystem/RequirementsChecker.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/libcalamaresui/modulesystem/RequirementsChecker.cpp b/src/libcalamaresui/modulesystem/RequirementsChecker.cpp index 2f500c771..916463ae4 100644 --- a/src/libcalamaresui/modulesystem/RequirementsChecker.cpp +++ b/src/libcalamaresui/modulesystem/RequirementsChecker.cpp @@ -90,6 +90,7 @@ RequirementsChecker::run() { Watcher* watcher = new Watcher( this ); watcher->setFuture( QtConcurrent::run( check, module, this ) ); + watcher->setObjectName( module->name() ); m_watchers.append( watcher ); connect( watcher, &Watcher::finished, this, &RequirementsChecker::finished ); } @@ -149,10 +150,19 @@ RequirementsChecker::reportProgress() { m_progressTimeouts++; - auto remaining = std::count_if( - m_watchers.cbegin(), m_watchers.cend(), []( const Watcher* w ) { return w && !w->isFinished(); } ); + QStringList remainingNames; + auto remaining = std::count_if( m_watchers.cbegin(), m_watchers.cend(), + [&]( const Watcher* w ) { + if ( w && !w->isFinished() ) + { + remainingNames << w->objectName(); + return true; + } + return false; + } ); if ( remaining > 0 ) { + cDebug() << "Remaining modules:" << remaining << Logger::DebugList( remainingNames ); unsigned int posInterval = ( m_progressTimer->interval() < 0 ) ? 1000 : uint( m_progressTimer->interval() ); QString waiting = tr( "Waiting for %n module(s).", "", remaining ); QString elapsed = tr( "(%n second(s))", "", m_progressTimeouts * posInterval / 1000 );