Skip to content
Permalink
Browse files

Don't show system notifications for short tasks

Too annoying!
  • Loading branch information
nyalldawson committed Aug 8, 2018
1 parent 790408f commit 8c6068a2e2ee4e98765b16ac4e841caec1fd9e44
Showing with 10 additions and 2 deletions.
  1. +6 −0 resources/qgis_global_settings.ini
  2. +4 −2 src/app/qgisapp.cpp
@@ -28,6 +28,12 @@ connections-xyz\OpenStreetMap\username=
connections-xyz\OpenStreetMap\zmax=19
connections-xyz\OpenStreetMap\zmin=0

[app]

# Minimum time (in seconds) for a background task to execute in order for a system
# notification to be shown when the task completes.
minTaskLengthForSystemNotification=10

[core]
# Whether or not to anonymize newly created projects
# If set to 1, then project metadata items like AUTHOR and CREATION DATE
@@ -12925,10 +12925,12 @@ void QgisApp::newProfile()

void QgisApp::onTaskCompleteShowNotify( long taskId, int status )
{
if ( status == QgsTask::Complete && !this->isActiveWindow() )
long long minTime = QgsSettings().value( QStringLiteral( "minTaskLengthForSystemNotification" ), 10, QgsSettings::App ).toLongLong() * 1000;

if ( status == QgsTask::Complete )
{
QgsTask *task = QgsApplication::taskManager()->task( taskId );
if ( task )
if ( task && task->elapsedTime() >= minTime )
{
showSystemNotification( tr( "Task complete" ), task->description() );
}

0 comments on commit 8c6068a

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