Skip to content

Commit

Permalink
Also show desktop notifications when tasks fail, not just when they s…
Browse files Browse the repository at this point in the history
…ucceed
  • Loading branch information
nyalldawson committed Aug 8, 2018
1 parent 1eee885 commit b0bc604
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/qgisapp.cpp
Expand Up @@ -12925,14 +12925,16 @@ void QgisApp::newProfile()

void QgisApp::onTaskCompleteShowNotify( long taskId, int status )
{
long long minTime = QgsSettings().value( QStringLiteral( "minTaskLengthForSystemNotification" ), 5, QgsSettings::App ).toLongLong() * 1000;

if ( status == QgsTask::Complete )
if ( status == QgsTask::Complete || status == QgsTask::Terminated )
{
long long minTime = QgsSettings().value( QStringLiteral( "minTaskLengthForSystemNotification" ), 5, QgsSettings::App ).toLongLong() * 1000;
QgsTask *task = QgsApplication::taskManager()->task( taskId );
if ( task && task->elapsedTime() >= minTime )
{
showSystemNotification( tr( "Task complete" ), task->description() );
if ( status == QgsTask::Complete )
showSystemNotification( tr( "Task complete" ), task->description() );
else if ( status == QgsTask::Terminated )
showSystemNotification( tr( "Task failed" ), task->description() );
}
}
}
Expand Down

0 comments on commit b0bc604

Please sign in to comment.