From b8f9c7e15da4e26ac31c30b6914ebe245a8666ab Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 3 Jan 2018 17:10:33 +0100 Subject: [PATCH] KWalletPasswords: Pass window id to Wallet::openWallet Closes #2441 --- .../KWalletPasswords/kwalletpasswordbackend.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/KWalletPasswords/kwalletpasswordbackend.cpp b/src/plugins/KWalletPasswords/kwalletpasswordbackend.cpp index 1f599b255..008515abf 100644 --- a/src/plugins/KWalletPasswords/kwalletpasswordbackend.cpp +++ b/src/plugins/KWalletPasswords/kwalletpasswordbackend.cpp @@ -1,6 +1,6 @@ /* ============================================================ * KWalletPasswords - KWallet support plugin for Falkon -* Copyright (C) 2013-2014 David Rosca +* Copyright (C) 2013-2018 David Rosca * * 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 @@ -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!";