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!";