Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 16 lines (13 sloc) 0.503 kb
fb119f6 @niklasb adds cookie management functions to Webkit::Browser
niklasb authored
1 #include "SetCookie.h"
2 #include "WebPage.h"
f80125e @mhoran Pass the WebPageManager to each command
mhoran authored
3 #include "WebPageManager.h"
fb119f6 @niklasb adds cookie management functions to Webkit::Browser
niklasb authored
4 #include "NetworkCookieJar.h"
5 #include <QNetworkCookie>
6
95732ad @jferris Split Command into more abstract Command and concrete SocketCommand
jferris authored
7 SetCookie::SetCookie(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {}
fb119f6 @niklasb adds cookie management functions to Webkit::Browser
niklasb authored
8
85dcc72 @jferris Pass command arguments to the constructor
jferris authored
9 void SetCookie::start()
fb119f6 @niklasb adds cookie management functions to Webkit::Browser
niklasb authored
10 {
85dcc72 @jferris Pass command arguments to the constructor
jferris authored
11 QList<QNetworkCookie> cookies = QNetworkCookie::parseCookies(arguments()[0].toAscii());
58e6a25 @mhoran Shared cookie jar for all windows
mhoran authored
12 NetworkCookieJar *jar = manager()->cookieJar();
fb119f6 @niklasb adds cookie management functions to Webkit::Browser
niklasb authored
13 jar->overwriteCookies(cookies);
14 emit finished(new Response(true));
15 }
Something went wrong with that request. Please try again.