Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/reportassistantpages_bugzilla.cpp
Show First 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | 216 | if (!username.isEmpty() && !password.isEmpty()) { | |||
---|---|---|---|---|---|
223 | ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); | 223 | ui.m_savePasswordCheckBox->setCheckState(Qt::Checked); | ||
224 | 224 | | |||
225 | ui.m_userEdit->setText(username); | 225 | ui.m_userEdit->setText(username); | ||
226 | ui.m_passwordEdit->setPassword(password); | 226 | ui.m_passwordEdit->setPassword(password); | ||
227 | } | 227 | } | ||
228 | } | 228 | } | ||
229 | 229 | | |||
230 | } | 230 | } | ||
231 | | ||||
232 | if (canLogin()) { | ||||
233 | loginClicked(); | ||||
234 | } | ||||
231 | } | 235 | } | ||
232 | } | 236 | } | ||
233 | 237 | | |||
234 | bool BugzillaLoginPage::canSetCookies() | 238 | bool BugzillaLoginPage::canSetCookies() | ||
235 | { | 239 | { | ||
236 | if (bugzillaManager()->securityMethod() != BugzillaManager::UseCookies) { | 240 | if (bugzillaManager()->securityMethod() != BugzillaManager::UseCookies) { | ||
237 | qCDebug(DRKONQI_LOG) << "Bugzilla software no longer issues cookies."; | 241 | qCDebug(DRKONQI_LOG) << "Bugzilla software no longer issues cookies."; | ||
238 | return false; | 242 | return false; | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 271 | if (advice.value() == QLatin1String("Reject")) { | |||
292 | } | 296 | } | ||
293 | } | 297 | } | ||
294 | 298 | | |||
295 | return true; | 299 | return true; | ||
296 | } | 300 | } | ||
297 | 301 | | |||
298 | void BugzillaLoginPage::loginClicked() | 302 | void BugzillaLoginPage::loginClicked() | ||
299 | { | 303 | { | ||
300 | if (!(ui.m_userEdit->text().isEmpty() || ui.m_passwordEdit->password().isEmpty())) { | 304 | if (canLogin()) { | ||
301 | 305 | | |||
302 | if ((bugzillaManager()->securityMethod() == BugzillaManager::UseCookies) | 306 | if ((bugzillaManager()->securityMethod() == BugzillaManager::UseCookies) | ||
303 | && (!canSetCookies())) { | 307 | && (!canSetCookies())) { | ||
304 | return; | 308 | return; | ||
305 | } | 309 | } | ||
306 | 310 | | |||
307 | updateWidget(false); | 311 | updateWidget(false); | ||
308 | 312 | | |||
Show All 19 Lines | 328 | if (kWalletEntryExists(QLatin1String(kWalletEntryName))) { | |||
328 | //Got wallet open ? | 332 | //Got wallet open ? | ||
329 | if (m_wallet) { | 333 | if (m_wallet) { | ||
330 | m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); | 334 | m_wallet->setFolder(KWallet::Wallet::FormDataFolder()); | ||
331 | m_wallet->removeEntry(QLatin1String(kWalletEntryName)); | 335 | m_wallet->removeEntry(QLatin1String(kWalletEntryName)); | ||
332 | } | 336 | } | ||
333 | } | 337 | } | ||
334 | } | 338 | } | ||
335 | 339 | | |||
340 | login(); | ||||
341 | } else { | ||||
342 | loginFinished(false); | ||||
343 | } | ||||
344 | } | ||||
345 | | ||||
346 | bool BugzillaLoginPage::canLogin() const | ||||
347 | { | ||||
348 | return (!(ui.m_userEdit->text().isEmpty() || ui.m_passwordEdit->password().isEmpty())); | ||||
349 | } | ||||
350 | | ||||
351 | void BugzillaLoginPage::login() | ||||
352 | { | ||||
353 | Q_ASSERT(canLogin()); | ||||
354 | | ||||
336 | ui.m_statusWidget->setBusy(i18nc("@info:status '1' is a url, '2' the username", | 355 | ui.m_statusWidget->setBusy(i18nc("@info:status '1' is a url, '2' the username", | ||
337 | "Performing login at %1 as %2...", | 356 | "Performing login at %1 as %2...", | ||
338 | QLatin1String(KDE_BUGZILLA_SHORT_URL), ui.m_userEdit->text())); | 357 | QLatin1String(KDE_BUGZILLA_SHORT_URL), | ||
358 | ui.m_userEdit->text())); | ||||
339 | 359 | | |||
340 | bugzillaManager()->tryLogin(ui.m_userEdit->text(), ui.m_passwordEdit->password()); | 360 | bugzillaManager()->tryLogin(ui.m_userEdit->text(), ui.m_passwordEdit->password()); | ||
341 | } else { | | |||
342 | loginFinished(false); | | |||
343 | } | | |||
344 | } | 361 | } | ||
345 | 362 | | |||
346 | void BugzillaLoginPage::updateWidget(bool enabled) | 363 | void BugzillaLoginPage::updateWidget(bool enabled) | ||
347 | { | 364 | { | ||
348 | ui.m_loginButton->setEnabled(enabled); | 365 | ui.m_loginButton->setEnabled(enabled); | ||
349 | 366 | | |||
350 | ui.m_userLabel->setEnabled(enabled); | 367 | ui.m_userLabel->setEnabled(enabled); | ||
351 | ui.m_passwordLabel->setEnabled(enabled); | 368 | ui.m_passwordLabel->setEnabled(enabled); | ||
▲ Show 20 Lines • Show All 532 Lines • Show Last 20 Lines |