diff --git a/src/modules/finished/Config.cpp b/src/modules/finished/Config.cpp index bf156303d..03616d05a 100644 --- a/src/modules/finished/Config.cpp +++ b/src/modules/finished/Config.cpp @@ -121,10 +121,11 @@ Config::doRestart() void -Config::doNotify( bool hasFailed ) +Config::doNotify( bool hasFailed, bool sendAnyway ) { - if ( !notifyOnFinished() ) + if ( !sendAnyway ) { + cDebug() << "Notification failed?" << hasFailed << "not sent."; return; } diff --git a/src/modules/finished/Config.h b/src/modules/finished/Config.h index cf1d8eb73..b4f93fd91 100644 --- a/src/modules/finished/Config.h +++ b/src/modules/finished/Config.h @@ -76,14 +76,21 @@ public Q_SLOTS: */ void doRestart(); - /** @brief Send DBus notification, if desired. - * - * This takes notifyOnFinished() into account. + /** @brief Send DBus notification * * At the end of installation (when the FinishedViewStep is activated), * send a desktop notification via DBus that the install is done. + * + * - The two-argument form sends success or failure, and can be + * forced to send by setting @p sendAnyway to @c true. + * - The one-argument form sends success or failure and takes + * the notifyOnFinished() configuration into account. + * - The no-argument form checks if a failure was signalled previously + * and uses that to decide if it was a failure. + * */ - void doNotify( bool hasFailed ); + void doNotify( bool hasFailed, bool sendAnyway ); + void doNotify( bool hasFailed ) { doNotify( hasFailed, notifyOnFinished() ); } void doNotify() { doNotify( hasFailed() ); } /** @brief Tell the config the install failed