Skip to content

Commit 3a4bcf9

Browse files
author
Klaas Freitag
committed
Again considering more review feedback
1 parent b7b1ffb commit 3a4bcf9

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

changelog/unreleased/8780

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Enhancement: Consider a remote poll interval coming with the server capabilities
33
This way, admins can configure the remote sync poll interval of clients through
44
the capabilities settings of the server. Note that the setting in the server
55
capabilities needs to be done in milliseconds. Default is 30 seconds.
6+
67
https://github.com/owncloud/client/issues/5947
78
https://github.com/owncloud/client/issues/8780
89
https://github.com/owncloud/client/pull/8777

src/libsync/capabilities.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class OWNCLOUDSYNC_EXPORT Capabilities
7777
bool shareResharing() const;
7878
/** Remote Poll interval.
7979
*
80-
* returns the requested poll interval to be used by the client in milliseconds.
81-
* If it returns -1 the client default remains unchanged.
80+
* returns the requested poll interval in seconds to be used by the client.
81+
* @returns 0 if no capability is set.
8282
*/
8383
std::chrono::seconds remotePollInterval() const;
8484

src/libsync/configfile.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const QString moveToTrashC() { return QStringLiteral("moveToTrash"); }
9393
}
9494

9595
QString ConfigFile::_confDir = QString();
96+
const std::chrono::seconds DefaultRemotePollInterval { 30 }; // default remote poll time in milliseconds
9697

9798
static chrono::milliseconds millisecondsValue(const QSettings &setting, const QString &key,
9899
chrono::milliseconds defaultValue)
@@ -427,8 +428,8 @@ chrono::milliseconds ConfigFile::remotePollInterval(std::chrono::seconds default
427428
}
428429
auto remoteInterval = millisecondsValue(settings, remotePollIntervalC(), defaultPollInterval);
429430
if (remoteInterval < chrono::seconds(5)) {
430-
qCWarning(lcConfigFile) << "Remote Interval is less than 5 seconds, reverting to" << DefaultRemotePollInterval.count();
431431
remoteInterval = defaultPollInterval;
432+
qCWarning(lcConfigFile) << "Remote Interval is less than 5 seconds, reverting to" << remoteInterval.count();
432433
}
433434
return remoteInterval;
434435
}

src/libsync/configfile.h

-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
199199

200200
private:
201201
typedef QSharedPointer<AbstractCredentials> SharedCreds;
202-
const std::chrono::seconds DefaultRemotePollInterval { 30 }; // default remote poll time in milliseconds
203202

204203
static QString _oCVersion;
205204
static QString _confDir;

0 commit comments

Comments
 (0)