1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/SetProxy.cpp

24 lines
684 B
C++
Raw Normal View History

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