MCPcopy Create free account
hub / github.com/KDE/kdevelop / authorizeClicked

Method authorizeClicked

plugins/ghprovider/ghdialog.cpp:95–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void Dialog::authorizeClicked()
96{
97 QPointer<KPasswordDialog> dlg = new KPasswordDialog(this, KPasswordDialog::ShowUsernameLine);
98 dlg->setPrompt(i18n("Enter a login and a password"));
99 if(dlg->exec()) {
100 m_text->setAlignment(Qt::AlignCenter);
101 m_text->setText(i18n("Waiting for response"));
102 m_account->setName(dlg->username());
103
104 Resource *rs = m_account->resource();
105 rs->authenticate(dlg->username(), dlg->password());
106 connect(rs, &Resource::twoFactorAuthRequested,
107 this, &Dialog::twoFactorResponse);
108 connect(rs, &Resource::authenticated,
109 this, &Dialog::authorizeResponse);
110 }
111 delete dlg;
112}
113
114void Dialog::authorizeResponse(const QByteArray &id, const QByteArray &token, const QString &tokenName)
115{

Callers

nothing calls this directly

Calls 5

execMethod · 0.80
resourceMethod · 0.80
authenticateMethod · 0.80
setTextMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected