This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4faa3a
commit 25281b7
Showing
6 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "SetProxy.h" | ||
#include "WebPage.h" | ||
#include <QNetworkAccessManager> | ||
#include <QNetworkProxy> | ||
|
||
SetProxy::SetProxy(WebPage *page, QObject *parent) | ||
: Command(page, parent) | ||
{ } | ||
|
||
void SetProxy::start(QStringList &arguments) | ||
{ | ||
// default to empty proxy | ||
QNetworkProxy proxy; | ||
|
||
if (arguments.size() > 0) | ||
proxy = QNetworkProxy(QNetworkProxy::HttpProxy, | ||
arguments[0], | ||
(quint16)(arguments[1].toInt()), | ||
arguments[2], | ||
arguments[3]); | ||
|
||
page()->networkAccessManager()->setProxy(proxy); | ||
emit finished(new Response(true)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "Command.h" | ||
|
||
class WebPage; | ||
|
||
class SetProxy : public Command { | ||
Q_OBJECT; | ||
|
||
public: | ||
SetProxy(WebPage *page, QObject *parent = 0); | ||
virtual void start(QStringList &arguments); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters