mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-28 07:54:49 +03:00
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:
parent
0a08a51a41
commit
320cc1c7dd
1 changed files with 6 additions and 1 deletions
|
@ -137,10 +137,15 @@ int OCUpdater::downloadState() const
|
|||
|
||||
void OCUpdater::setDownloadState(DownloadState state)
|
||||
{
|
||||
auto oldState = _state;
|
||||
_state = state;
|
||||
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() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue