summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cookiejar.cpp18
-rw-r--r--src/cookiejar.h3
-rw-r--r--src/webpage.cpp7
3 files changed, 17 insertions, 11 deletions
diff --git a/src/cookiejar.cpp b/src/cookiejar.cpp
index a8ba18bc..05ffb987 100644
--- a/src/cookiejar.cpp
+++ b/src/cookiejar.cpp
@@ -52,21 +52,22 @@
CookieJar::CookieJar(QObject* parent)
: QNetworkCookieJar(parent)
- , m_kcookiejar(new QDBusInterface("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer"))
+ , m_windowId(-1)
{
}
CookieJar::~CookieJar()
{
- delete m_kcookiejar;
}
QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const
{
+
+ QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
QList<QNetworkCookie> cookieList;
- QDBusReply<QString> reply = m_kcookiejar->call("listCookies", url.toString() );
+ QDBusReply<QString> reply = kcookiejar.call("findDOMCookies", url.toString() );
if (reply.isValid())
{
@@ -83,24 +84,27 @@ QList<QNetworkCookie> CookieJar::cookiesForUrl(const QUrl & url) const
bool CookieJar::setCookiesFromUrl(const QList<QNetworkCookie> & cookieList, const QUrl & url)
{
+ QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
QByteArray cookieHeader;
Q_FOREACH(const QNetworkCookie& cookie, cookieList)
{
cookieHeader = "Set-Cookie: ";
cookieHeader += cookie.toRawForm();
- m_kcookiejar->call("addCookies", url.toString(), cookieHeader, 0 );
+ kcookiejar.call("addCookies", url.toString(), cookieHeader, m_windowId );
}
- return !m_kcookiejar->lastError().isValid();
+ return !kcookiejar.lastError().isValid();
}
void CookieJar::clear()
{
- QDBusReply<void> reply = m_kcookiejar->call( "deleteAllCookies" );
+ QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
+
+ QDBusReply<void> reply = kcookiejar.call( "deleteAllCookies" );
if (!reply.isValid())
{
kWarning() << "Unable to delete all the cookies as requested.";
- return;
}
+ return;
}
diff --git a/src/cookiejar.h b/src/cookiejar.h
index 4dea1e60..3f9f366c 100644
--- a/src/cookiejar.h
+++ b/src/cookiejar.h
@@ -31,7 +31,6 @@
// Qt Includes
#include <QtNetwork/QNetworkCookieJar>
-#include <QtDBus/QDBusInterface>
// Forward Declarations
class QUrl;
@@ -51,7 +50,7 @@ public:
void clear();
private:
- QDBusInterface *m_kcookiejar;
+ qlonglong m_windowId;
};
#endif // RECOOKIEJAR_H
diff --git a/src/webpage.cpp b/src/webpage.cpp
index f1e5db33..942f20e3 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -272,8 +272,11 @@ bool WebPage::javaScriptPrompt(QWebFrame *frame, const QString &msg, const QStri
QObject *WebPage::createPlugin(const QString &classId, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues)
{
- kDebug() << "create Plugin requested with classId: " << classId;
-
+ kDebug() << "create Plugin requested:";
+ kDebug() << "classid:" << classId;
+ kDebug() << "url:" << url;
+ kDebug() << "paramNames:" << paramNames << " paramValues:" << paramValues;
+
QUiLoader loader;
return loader.createWidget(classId, view());
}