mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
Ref T401, mapping tool login updates crashpad info
This commit is contained in:
@@ -138,6 +138,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CDbLoginComponent::setUserInfo(const CAuthenticatedUser &user)
|
void CDbLoginComponent::setUserInfo(const CAuthenticatedUser &user)
|
||||||
{
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
if (user.isAuthenticated())
|
if (user.isAuthenticated())
|
||||||
{
|
{
|
||||||
CLogMessage(this).info("User authenticated: %1") << user.toQString();
|
CLogMessage(this).info("User authenticated: %1") << user.toQString();
|
||||||
@@ -152,6 +153,10 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->le_Info->setText("You can create model change requests");
|
ui->le_Info->setText("You can create model change requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// crashpad info
|
||||||
|
sGui->setCrashInfoUserName(user.getRealNameAndId());
|
||||||
|
sGui->appendCrashInfo(QStringLiteral("Login as user %1 %2").arg(user.getRealNameAndId(), user.getRolesAsString()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonValue>
|
#include <QJsonValue>
|
||||||
|
#include <QStringBuilder>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
@@ -38,7 +39,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (hasValidRealName())
|
if (hasValidRealName())
|
||||||
{
|
{
|
||||||
return m_realname + " " + getDbKeyAsStringInParentheses();
|
return m_realname % QStringLiteral(" ") % getDbKeyAsStringInParentheses();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -49,13 +50,8 @@ namespace BlackMisc
|
|||||||
QString CAuthenticatedUser::convertToQString(bool i18n) const
|
QString CAuthenticatedUser::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
if (m_realname.isEmpty()) return "<no realname>";
|
if (m_realname.isEmpty()) { return QStringLiteral("<no realname>"); }
|
||||||
QString s = m_realname;
|
return m_realname % (this->hasValidDbKey() ? this->getDbKeyAsStringInParentheses(" ") : QStringLiteral(""));
|
||||||
if (this->hasValidDbKey())
|
|
||||||
{
|
|
||||||
s.append(this->getDbKeyAsStringInParentheses(" "));
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CAuthenticatedUser CAuthenticatedUser::fromDatabaseJson(const QJsonObject &json)
|
CAuthenticatedUser CAuthenticatedUser::fromDatabaseJson(const QJsonObject &json)
|
||||||
|
|||||||
Reference in New Issue
Block a user