Use a constant for ConnectionValidator::DefaultCallingIntervalMsec
authorOlivier Goffart <ogoffart@woboq.com>
Wed, 10 Feb 2016 11:35:26 +0000 (12:35 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Wed, 10 Feb 2016 11:36:09 +0000 (12:36 +0100)
So there is no runtime initialization

src/gui/application.cpp
src/libsync/connectionvalidator.cpp
src/libsync/connectionvalidator.h

index 90eca8a178a24aec978e969552f2b780d7b5d84b..6d3b6cd39f91f58a8d726ccfd6710746879d998f 100644 (file)
@@ -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() ));
index ca4e79705a042ad5422578da8dbd87211875b3d0..f8c11f9c9756fa633ef43d9018f00daa97b97801 100644 (file)
@@ -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),
index eb57a293d08b3a7af42fc2d1d451cbef6553c1af..e1264628acaf1db2a791d3c9bfa624bfb4d8a8ac 100644 (file)
@@ -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.