mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 18:05:36 -04:00
[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.
This commit is contained in:
parent
0bd2bfa708
commit
18bf925a11
1 changed files with 12 additions and 2 deletions
|
@ -90,6 +90,7 @@ RequirementsChecker::run()
|
||||||
{
|
{
|
||||||
Watcher* watcher = new Watcher( this );
|
Watcher* watcher = new Watcher( this );
|
||||||
watcher->setFuture( QtConcurrent::run( check, module, this ) );
|
watcher->setFuture( QtConcurrent::run( check, module, this ) );
|
||||||
|
watcher->setObjectName( module->name() );
|
||||||
m_watchers.append( watcher );
|
m_watchers.append( watcher );
|
||||||
connect( watcher, &Watcher::finished, this, &RequirementsChecker::finished );
|
connect( watcher, &Watcher::finished, this, &RequirementsChecker::finished );
|
||||||
}
|
}
|
||||||
|
@ -149,10 +150,19 @@ RequirementsChecker::reportProgress()
|
||||||
{
|
{
|
||||||
m_progressTimeouts++;
|
m_progressTimeouts++;
|
||||||
|
|
||||||
auto remaining = std::count_if(
|
QStringList remainingNames;
|
||||||
m_watchers.cbegin(), m_watchers.cend(), []( const Watcher* w ) { return w && !w->isFinished(); } );
|
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 )
|
if ( remaining > 0 )
|
||||||
{
|
{
|
||||||
|
cDebug() << "Remaining modules:" << remaining << Logger::DebugList( remainingNames );
|
||||||
unsigned int posInterval = ( m_progressTimer->interval() < 0 ) ? 1000 : uint( m_progressTimer->interval() );
|
unsigned int posInterval = ( m_progressTimer->interval() < 0 ) ? 1000 : uint( m_progressTimer->interval() );
|
||||||
QString waiting = tr( "Waiting for %n module(s).", "", remaining );
|
QString waiting = tr( "Waiting for %n module(s).", "", remaining );
|
||||||
QString elapsed = tr( "(%n second(s))", "", m_progressTimeouts * posInterval / 1000 );
|
QString elapsed = tr( "(%n second(s))", "", m_progressTimeouts * posInterval / 1000 );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue