Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/reportassistantpages_bugzilla.cpp
Show All 24 Lines | |||||
25 | #include <QLabel> | 25 | #include <QLabel> | ||
26 | #include <QCheckBox> | 26 | #include <QCheckBox> | ||
27 | #include <QToolTip> | 27 | #include <QToolTip> | ||
28 | #include <QCursor> | 28 | #include <QCursor> | ||
29 | #include <QFileDialog> | 29 | #include <QFileDialog> | ||
30 | #include <QTemporaryFile> | 30 | #include <QTemporaryFile> | ||
31 | #include <QTextBrowser> | 31 | #include <QTextBrowser> | ||
32 | #include <QDesktopServices> | 32 | #include <QDesktopServices> | ||
33 | #include <QWindow> | ||||
33 | 34 | | |||
34 | #include "drkonqi_debug.h" | 35 | #include "drkonqi_debug.h" | ||
35 | #include <KMessageBox> | 36 | #include <KMessageBox> | ||
36 | #include <KLocalizedString> | 37 | #include <KLocalizedString> | ||
37 | #include <kwallet.h> | 38 | #include <kwallet.h> | ||
38 | #include <KCapacityBar> | 39 | #include <KCapacityBar> | ||
39 | 40 | | |||
40 | /* Unhandled error dialog includes */ | 41 | /* Unhandled error dialog includes */ | ||
▲ Show 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 165 | return !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), | |||
165 | KWallet::Wallet::FormDataFolder(), | 166 | KWallet::Wallet::FormDataFolder(), | ||
166 | entryName); | 167 | entryName); | ||
167 | } | 168 | } | ||
168 | 169 | | |||
169 | void BugzillaLoginPage::openWallet() | 170 | void BugzillaLoginPage::openWallet() | ||
170 | { | 171 | { | ||
171 | //Store if the wallet was previously opened so we can know if we should close it later | 172 | //Store if the wallet was previously opened so we can know if we should close it later | ||
172 | m_walletWasOpenedBefore = KWallet::Wallet::isOpen(KWallet::Wallet::NetworkWallet()); | 173 | m_walletWasOpenedBefore = KWallet::Wallet::isOpen(KWallet::Wallet::NetworkWallet()); | ||
174 | | ||||
173 | //Request open the wallet | 175 | //Request open the wallet | ||
174 | m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), | 176 | WId windowId = 0; | ||
175 | static_cast<QWidget*>(this->parent())->winId()); | 177 | const auto *widget = qobject_cast<QWidget*>(this->parent()); | ||
178 | QWindow *window = widget->windowHandle(); | ||||
179 | if (window) { | ||||
180 | windowId = window->winId(); | ||||
181 | } | ||||
182 | | ||||
183 | m_wallet = KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), windowId); | ||||
176 | } | 184 | } | ||
177 | 185 | | |||
178 | void BugzillaLoginPage::walletLogin() | 186 | void BugzillaLoginPage::walletLogin() | ||
179 | { | 187 | { | ||
180 | if (!m_wallet) { | 188 | if (!m_wallet) { | ||
181 | if (kWalletEntryExists(QLatin1String(kWalletEntryName))) { //Key exists! | 189 | if (kWalletEntryExists(QLatin1String(kWalletEntryName))) { //Key exists! | ||
182 | openWallet(); | 190 | openWallet(); | ||
183 | ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); | 191 | ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); | ||
▲ Show 20 Lines • Show All 591 Lines • Show Last 20 Lines |