[Pkg-owncloud-commits] [owncloud-client] 368/498: Updater: Avoid to show the update notification to often.

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 320cc1c7dde97cf6ebbb10830acedd4f67fe32cf
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Mon Jul 20 15:33:17 2015 +0200

    Updater: Avoid to show the update notification to often.
    
    If the update is only available through the system, the notification
    is only shown once.
---
 src/gui/updater/ocupdater.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gui/updater/ocupdater.cpp b/src/gui/updater/ocupdater.cpp
index a2882e0..6dd661c 100644
--- a/src/gui/updater/ocupdater.cpp
+++ b/src/gui/updater/ocupdater.cpp
@@ -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() );
     }
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list