[Pkg-owncloud-commits] [owncloud-client] 25/470: Use a constant for ConnectionValidator::DefaultCallingIntervalMsec

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:40 UTC 2016


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 e9307bb797a81359a2ff7abddd01c3937ec6941b
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Feb 10 12:35:26 2016 +0100

    Use a constant for ConnectionValidator::DefaultCallingIntervalMsec
    
    So there is no runtime initialization
---
 src/gui/application.cpp             | 2 +-
 src/libsync/connectionvalidator.cpp | 2 +-
 src/libsync/connectionvalidator.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gui/application.cpp b/src/gui/application.cpp
index 90eca8a..6d3b6cd 100644
--- a/src/gui/application.cpp
+++ b/src/gui/application.cpp
@@ -182,7 +182,7 @@ Application::Application(int &argc, char **argv) :
 
     // startup procedure.
     connect(&_checkConnectionTimer, SIGNAL(timeout()), this, SLOT(slotCheckConnection()));
-    _checkConnectionTimer.setInterval(ConnectionValidator::defaultCallingIntervalMsec()); // check for connection every 32 seconds.
+    _checkConnectionTimer.setInterval(ConnectionValidator::DefaultCallingIntervalMsec); // check for connection every 32 seconds.
     _checkConnectionTimer.start();
     // Also check immediately
     QTimer::singleShot( 0, this, SLOT( slotCheckConnection() ));
diff --git a/src/libsync/connectionvalidator.cpp b/src/libsync/connectionvalidator.cpp
index ca4e797..f8c11f9 100644
--- a/src/libsync/connectionvalidator.cpp
+++ b/src/libsync/connectionvalidator.cpp
@@ -25,7 +25,7 @@ namespace OCC {
 
 // Make sure the timeout for this job is less than how often we get called
 // This makes sure we get tried often enough without "ConnectionValidator already running"
-static qint64 timeoutToUseMsec = qMax(qint64(1000), ConnectionValidator::defaultCallingIntervalMsec() - 5*1000);
+static qint64 timeoutToUseMsec = qMax(1000, ConnectionValidator::DefaultCallingIntervalMsec - 5*1000);
 
 ConnectionValidator::ConnectionValidator(AccountPtr account, QObject *parent)
     : QObject(parent),
diff --git a/src/libsync/connectionvalidator.h b/src/libsync/connectionvalidator.h
index eb57a29..e126462 100644
--- a/src/libsync/connectionvalidator.h
+++ b/src/libsync/connectionvalidator.h
@@ -85,7 +85,7 @@ public:
     static QString statusString( Status );
 
     // How often should the Application ask this object to check for the connection?
-    static qint64 defaultCallingIntervalMsec() { return 32 * 1000;}
+    enum { DefaultCallingIntervalMsec = 32 * 1000 };
 
 public slots:
     /// Checks the server and the authentication.

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