2011-09-24 17:55:18 -04:00
|
|
|
#include "SetProxy.h"
|
|
|
|
#include "WebPage.h"
|
2012-04-04 18:18:17 -04:00
|
|
|
#include "WebPageManager.h"
|
2012-11-22 00:21:40 -05:00
|
|
|
#include "NetworkAccessManager.h"
|
2011-09-24 17:55:18 -04:00
|
|
|
#include <QNetworkProxy>
|
|
|
|
|
2012-07-08 15:04:30 -04:00
|
|
|
SetProxy::SetProxy(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
|
2011-09-24 17:55:18 -04:00
|
|
|
|
2012-03-16 19:58:58 -04:00
|
|
|
void SetProxy::start()
|
2011-09-24 17:55:18 -04:00
|
|
|
{
|
|
|
|
// default to empty proxy
|
|
|
|
QNetworkProxy proxy;
|
|
|
|
|
2012-03-16 19:58:58 -04:00
|
|
|
if (arguments().size() > 0)
|
2011-09-24 17:55:18 -04:00
|
|
|
proxy = QNetworkProxy(QNetworkProxy::HttpProxy,
|
2012-03-16 19:58:58 -04:00
|
|
|
arguments()[0],
|
|
|
|
(quint16)(arguments()[1].toInt()),
|
|
|
|
arguments()[2],
|
|
|
|
arguments()[3]);
|
2011-09-24 17:55:18 -04:00
|
|
|
|
2013-03-18 08:11:59 -04:00
|
|
|
manager()->networkAccessManager()->setProxy(proxy);
|
2013-02-11 18:31:41 -05:00
|
|
|
finish(true);
|
2011-09-24 17:55:18 -04:00
|
|
|
}
|