Commit 33306f48 authored by Dawit Alemayehu's avatar Dawit Alemayehu
Browse files

Just like the password dialog, associate the cookie configuration dialog with

the correct parent window.

BUG: 123504
BUG: 160044
FIXED-IN: 4.7.4
parent bab4ee94
......@@ -36,13 +36,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <kdebug.h>
#include <kcmdlineargs.h>
#include <kstandarddirs.h>
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kwindowsystem.h>
#include "kcookiejar.h"
#include "kcookiewin.h"
#include "kcookieserveradaptor.h"
#include <kpluginfactory.h>
#include <kpluginloader.h>
#define QL1S(x) QLatin1String(x)
#define QL1C(x) QLatin1Char(x)
......@@ -149,7 +149,7 @@ void KCookieServer::addCookies( const QString &url, const QByteArray &cookieHead
else
cookieList = mCookieJar->makeCookies(url, cookieHeader, windowId);
checkCookies(&cookieList);
checkCookies(&cookieList, windowId);
*mPendingCookies += cookieList;
......@@ -158,13 +158,18 @@ void KCookieServer::addCookies( const QString &url, const QByteArray &cookieHead
mAdvicePending = true;
while (!mPendingCookies->isEmpty())
{
checkCookies(0);
checkCookies(0, windowId);
}
mAdvicePending = false;
}
}
void KCookieServer::checkCookies(KHttpCookieList *cookieList)
{
checkCookies(cookieList, 0);
}
void KCookieServer::checkCookies(KHttpCookieList *cookieList, qlonglong windowId)
{
KHttpCookieList *list;
......@@ -211,6 +216,14 @@ void KCookieServer::checkCookies(KHttpCookieList *cookieList)
KCookieWin *kw = new KCookieWin( 0L, currentList,
mCookieJar->preferredDefaultPolicy(),
mCookieJar->showCookieDetails() );
if (windowId > 0) {
#ifndef Q_WS_WIN
KWindowSystem::setMainWindow(kw, static_cast<WId>(windowId));
#else
KWindowSystem::setMainWindow(kw, (HWND)(long)windowId);
#endif
}
KCookieAdvice userAdvice = kw->advice(mCookieJar, currentCookie);
delete kw;
// Save the cookie config if it has changed
......
......@@ -77,6 +77,9 @@ public:
void addCookies(const QString &url, const QByteArray &cookieHeader,
qlonglong windowId, bool useDOMFormat);
void checkCookies(KHttpCookieList *cookieList);
// TODO: KDE5 merge with above function and make all these public functions
// private since they are not used externally.
void checkCookies(KHttpCookieList *cookieList, qlonglong windowId);
private Q_SLOTS:
void slotSave();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment