2012-10-24 11:55:29 +00:00
|
|
|
#include "SetTimeout.h"
|
|
|
|
#include "WebPageManager.h"
|
2013-02-02 22:32:54 +00:00
|
|
|
#include "ErrorMessage.h"
|
2012-10-24 11:55:29 +00:00
|
|
|
|
|
|
|
SetTimeout::SetTimeout(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetTimeout::start() {
|
|
|
|
QString timeoutString = arguments()[0];
|
|
|
|
bool ok;
|
|
|
|
int timeout = timeoutString.toInt(&ok);
|
|
|
|
|
|
|
|
if (ok) {
|
|
|
|
manager()->setTimeout(timeout);
|
2013-02-11 23:31:41 +00:00
|
|
|
finish(true);
|
2012-10-24 11:55:29 +00:00
|
|
|
} else {
|
2013-02-11 23:31:41 +00:00
|
|
|
finish(false, new ErrorMessage("Invalid value for timeout"));
|
2012-10-24 11:55:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|