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

Method authorizeResponse

plugins/ghprovider/ghdialog.cpp:114–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void Dialog::authorizeResponse(const QByteArray &id, const QByteArray &token, const QString &tokenName)
115{
116 Q_UNUSED(tokenName);
117
118 Resource *rs = m_account->resource();
119 disconnect(rs, &Resource::authenticated,
120 this, &Dialog::authorizeResponse);
121
122 if (id.isEmpty()) {
123 m_text->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
124 m_text->setText(invalidAccountText());
125 m_account->setName(QString());
126 KMessageBox::error(this, i18n("Authentication failed. Please try again.\n\n"
127 "Could not create token: \"%1\"\n%2", tokenName,
128 tokenLinkStatementText()),
129 i18nc("@title:window", "GitHub Authorization Failed"));
130 return;
131 }
132 else{
133 KMessageBox::information(this, i18n("Authentication succeeded.\n\n"
134 "Created token: \"%1\"\n%2", tokenName,
135 tokenLinkStatementText()),
136 i18nc("@title:window", "GitHub Account Authorized"));
137 }
138 m_account->saveToken(id, token);
139 syncUser();
140}
141
142void Dialog::twoFactorResponse(const QString &transferHeader)
143{

Callers

nothing calls this directly

Calls 8

invalidAccountTextFunction · 0.85
tokenLinkStatementTextFunction · 0.85
resourceMethod · 0.80
saveTokenMethod · 0.80
QStringClass · 0.50
isEmptyMethod · 0.45
setTextMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected