Skip to content
Permalink
Browse files

Also show desktop notifications when tasks fail, not just when they s…

…ucceed
  • Loading branch information
nyalldawson committed Aug 8, 2018
1 parent 1eee885 commit b0bc604d2e2e5ab7348a7ab9e3cbce8684476a58
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/app/qgisapp.cpp
@@ -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() );
}
}
}

0 comments on commit b0bc604

Please sign in to comment.
You can’t perform that action at this time.