[Pkg-owncloud-commits] [owncloud-client] 376/498: Merge branch 'regular_update_check'

Sandro Knauß hefee-guest at moszumanska.debian.org
Tue Aug 11 14:49:08 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 316427c801997e811a9c8ea30ab470e33ec7a3bc
Merge: 59a7ae5 c34641f
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Thu Jul 23 11:34:12 2015 +0200

    Merge branch 'regular_update_check'
    
    Conflicts:
    	src/gui/application.cpp
    	src/gui/application.h
    	src/gui/updater/ocupdater.h

 src/gui/application.cpp       | 19 +++------
 src/gui/application.h         |  1 -
 src/gui/generalsettings.cpp   |  3 +-
 src/gui/updater/ocupdater.cpp | 90 ++++++++++++++++++++++++++++++++++++++-----
 src/gui/updater/ocupdater.h   | 61 +++++++++++++++++++++++++++--
 src/gui/updater/updater.cpp   |  6 +++
 src/gui/updater/updater.h     |  2 +
 src/libsync/configfile.cpp    | 21 +++++++++-
 src/libsync/configfile.h      |  4 +-
 9 files changed, 177 insertions(+), 30 deletions(-)

diff --cc src/gui/application.cpp
index 404a194,1bbedd0..ae3b1fd
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@@ -32,10 -32,11 +32,9 @@@
  #include "utility.h"
  #include "clientproxy.h"
  #include "sharedialog.h"
--
--#include "updater/updater.h"
 -#include "updater/ocupdater.h"
 -
 +#include "accountmanager.h"
  #include "creds/abstractcredentials.h"
++#include "updater/ocupdater.h"
  
  #include "config.h"
  
@@@ -212,27 -249,14 +211,21 @@@ void Application::slotCleanup(
      _gui->deleteLater();
  }
  
- void Application::slotStartUpdateDetector()
- {
-     Updater *updater = Updater::instance();
-     updater->backgroundCheckForUpdate();
- }
- 
  void Application::slotCheckConnection()
  {
 -    AccountState *accountState = AccountStateManager::instance()->accountState();
 -
 -    if( accountState ) {
 -        accountState->checkConnectivity();
 +    auto list = AccountManager::instance()->accounts();
 +    foreach (const auto &accountState , list) {
 +        AccountState::State state = accountState->state();
 +
 +        // Don't check if we're manually signed out or
 +        // when the error is permanent.
 +        if (state != AccountState::SignedOut
 +                && state != AccountState::ConfigurationError) {
 +            accountState->checkConnectivity();
 +        }
 +    }
  
 -    } else {
 +    if (list.isEmpty()) {
          // let gui open the setup wizard
          _gui->slotOpenSettingsDialog( true );
  
diff --cc src/gui/application.h
index 366d0fd,c66bf8c..aa64064
--- a/src/gui/application.h
+++ b/src/gui/application.h
@@@ -79,8 -74,10 +79,7 @@@ signals
  protected slots:
      void slotParseMessage(const QString&, QObject*);
      void slotCheckConnection();
-     void slotStartUpdateDetector();
 -    void slotUpdateConnectionErrors(int accountState);
      void slotUseMonoIconsChanged( bool );
 -    void slotLogin();
 -    void slotLogout();
      void slotCleanup();
      void slotAccountStateAdded(AccountState *accountState);
      void slotAccountStateRemoved(AccountState *accountState);
diff --cc src/gui/updater/ocupdater.h
index 51dce72,8425ef2..08c1c5a
--- a/src/gui/updater/ocupdater.h
+++ b/src/gui/updater/ocupdater.h
@@@ -27,11 -28,58 +28,63 @@@ class QNetworkReply
  
  namespace OCC {
  
 -/** @short Schedule update checks every couple of hours if the client runs.
 +/**
++ * @brief Schedule update checks every couple of hours if the client runs.
++ * @ingroup gui
+  *
+  * This class schedules regular update checks. It also checks the config
+  * if update checks are wanted at all.
+  *
+  * To reflect that all platforms have its own update scheme, a little
+  * complex class design was set up:
+  *
+  * For Windows and Linux, the updaters are inherited from OCUpdater, while
+  * the MacOSX SparkleUpdater directly uses the class Updater. On windows,
+  * NSISUpdater starts the update if a new version of the client is available.
+  * On MacOSX, the sparkle framework handles the installation of the new
+  * version. On Linux, the update capabilities by the underlying linux distro
+  * is relied on, and thus the PassiveUpdateNotifier just shows a notification
+  * if there is a new version once at every start of the application.
+  *
+  * Simple class diagram of the updater:
+  *
+  *           +---------------------------+
+  *     +-----+   UpdaterScheduler        +-----+
+  *     |     +------------+--------------+     |
+  *     v                  v                    v
+  * +------------+ +---------------------+ +----------------+
+  * |NSISUpdater | |PassiveUpdateNotifier| | SparkleUpdater |
+  * +-+----------+ +---+-----------------+ +-----+----------+
+  *   |                |                         |
+  *   |                v      +------------------+
+  *   |   +---------------+   v
+  *   +-->|   OCUpdater   +------+
+  *       +--------+------+      |
+  *                |   Updater   |
+  *                +-------------+
+  */
+ 
+ class UpdaterScheduler : public QObject
+ {
+     Q_OBJECT
+ public:
+     UpdaterScheduler(QObject *parent);
+ 
+ signals:
+     void updaterAnnouncement(const QString& title, const QString& msg);
+ 
+ private slots:
+     void slotTimerFired();
+ 
+ private:
+     QTimer _updateCheckTimer; /** Timer for the regular update check. */
+ 
+ };
+ 
 -/** @short Class that uses an ownCloud propritary XML format to fetch update information */
++/**
 + * @brief Class that uses an ownCloud propritary XML format to fetch update information
 + * @ingroup gui
 + */
  class OCUpdater : public QObject, public Updater
  {
      Q_OBJECT

-- 
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