1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

KWalletPasswords: Pass window id to Wallet::openWallet

Closes #2441
This commit is contained in:
David Rosca 2018-01-03 17:10:33 +01:00
parent 8a6547b39c
commit b8f9c7e15d

View File

@ -1,6 +1,6 @@
/* ============================================================
* KWalletPasswords - KWallet support plugin for Falkon
* Copyright (C) 2013-2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2013-2018 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,6 +17,8 @@
* ============================================================ */
#include "kwalletpasswordbackend.h"
#include "kwalletplugin.h"
#include "mainapplication.h"
#include "browserwindow.h"
#include <QDateTime>
@ -154,7 +156,12 @@ void KWalletPasswordBackend::initialize()
return;
}
m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0);
WId wid = 0;
BrowserWindow *w = mApp->getWindow();
if (w && w->window()) {
wid = w->window()->winId();
}
m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), wid);
if (!m_wallet) {
qWarning() << "KWalletPasswordBackend::initialize Cannot open wallet!";