Updater: Avoid to show the update notification to often.

If the update is only available through the system, the notification
is only shown once.
This commit is contained in:
Klaas Freitag 2015-07-20 15:33:17 +02:00
parent 0a08a51a41
commit 320cc1c7dd

View file

@ -137,10 +137,15 @@ int OCUpdater::downloadState() const
void OCUpdater::setDownloadState(DownloadState state) void OCUpdater::setDownloadState(DownloadState state)
{ {
auto oldState = _state;
_state = state; _state = state;
emit downloadStateChanged(); emit downloadStateChanged();
if( _state == OCUpdater::DownloadComplete ) { // show the notification if the download is complete (on every check)
// or once for system based updates.
if( _state == OCUpdater::DownloadComplete ||
(oldState != OCUpdater::UpdateOnlyAvailableThroughSystem
&& _state == OCUpdater::UpdateOnlyAvailableThroughSystem) ) {
emit newUpdateAvailable(tr("Update Check"), statusString() ); emit newUpdateAvailable(tr("Update Check"), statusString() );
} }
} }