Allow to set a smaller timeout value in the config file

Added to debug #1724
This commit is contained in:
Daniel Molkentin 2014-05-28 16:28:22 +02:00
parent 86a48b52e9
commit 3d2a2df86f
3 changed files with 13 additions and 1 deletions

View file

@ -47,6 +47,7 @@ static const char monoIconsC[] = "monoIcons";
static const char optionalDesktopNoficationsC[] = "optionalDesktopNotifications";
static const char skipUpdateCheckC[] = "skipUpdateCheck";
static const char geometryC[] = "geometry";
static const char timeoutC[] = "timeout";
static const char proxyHostC[] = "Proxy/host";
static const char proxyTypeC[] = "Proxy/type";
@ -103,6 +104,12 @@ bool MirallConfigFile::optionalDesktopNotifications() const
return settings.value(QLatin1String(optionalDesktopNoficationsC), true).toBool();
}
int MirallConfigFile::timeout() const
{
QSettings settings(configFile(), QSettings::IniFormat);
return settings.value(QLatin1String(timeoutC), 300).toInt(); // default to 5 min
}
void MirallConfigFile::setOptionalDesktopNotifications(bool show)
{
QSettings settings(configFile(), QSettings::IniFormat);

View file

@ -97,6 +97,8 @@ public:
bool optionalDesktopNotifications() const;
void setOptionalDesktopNotifications(bool show);
int timeout() const;
void saveGeometry(QWidget *w);
void restoreGeometry(QWidget *w);

View file

@ -19,6 +19,7 @@
#include "propagator_qnam.h"
#include "propagatorjobs.h"
#include "propagator_legacy.h"
#include "mirall/mirallconfigfile.h"
#include "mirall/utility.h"
#ifdef Q_OS_WIN
@ -295,8 +296,10 @@ int OwncloudPropagator::httpTimeout()
if (!timeout) {
timeout = qgetenv("OWNCLOUD_TIMEOUT").toUInt();
if (timeout == 0) {
timeout = 300; // default to 300 secs
MirallConfigFile cfg;
timeout = cfg.timeout();
}
}
return timeout;
}