mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
be22bfe244
Destroying the NetworkAccessManager seems to result in "terminate called without an active exception" segfaults. The documentation states that an application requires only a single single NetworkAccessManager.
23 lines
684 B
C++
23 lines
684 B
C++
#include "SetProxy.h"
|
|
#include "WebPage.h"
|
|
#include "WebPageManager.h"
|
|
#include "NetworkAccessManager.h"
|
|
#include <QNetworkProxy>
|
|
|
|
SetProxy::SetProxy(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
|
|
|
|
void SetProxy::start()
|
|
{
|
|
// default to empty proxy
|
|
QNetworkProxy proxy;
|
|
|
|
if (arguments().size() > 0)
|
|
proxy = QNetworkProxy(QNetworkProxy::HttpProxy,
|
|
arguments()[0],
|
|
(quint16)(arguments()[1].toInt()),
|
|
arguments()[2],
|
|
arguments()[3]);
|
|
|
|
manager()->networkAccessManager()->setProxy(proxy);
|
|
finish(true);
|
|
}
|