Ref T401, utility functions info for crashpad

This commit is contained in:
Klaus Basan
2018-11-01 16:03:30 +01:00
parent 4ff531c6c4
commit bb34bc7939
3 changed files with 15 additions and 2 deletions

View File

@@ -177,8 +177,8 @@ namespace BlackMisc
QString CServer::getServerSessionId() const
{
if (!this->isConnected()) { return ""; }
static const QString session("%1 %2:%3 %4 %5");
return session.arg(this->getName(), this->getAddress()).arg(this->getPort()).arg(this->getUser().getRealName(), this->getFormattedUtcTimestampHms());
static const QString session("%1 %2:%3 [%4] %5 %6");
return session.arg(this->getName(), this->getAddress()).arg(this->getPort()).arg(this->getEcosystem().getSystemString(), this->getUser().getRealName(), this->getFormattedUtcTimestampHms());
}
CVariant CServer::propertyByIndex(const CPropertyIndex &index) const

View File

@@ -55,6 +55,16 @@ namespace BlackMisc
return this->getRealName() % separator % this->getHomeBase().asString();
}
QString CUser::getRealNameAndId() const
{
if (this->hasRealName())
{
if (this->hasId()) { return this->getRealName() % QStringLiteral(" (") % this->getId() % QStringLiteral(")"); }
return this->getRealName();
}
return this->getId();
}
void CUser::setCallsign(const CCallsign &callsign)
{
m_callsign = callsign;

View File

@@ -107,6 +107,9 @@ namespace BlackMisc
//! Real name + homebase
QString getRealNameAndHomeBase(const QString &separator = QString(" ")) const;
//! Real name and id
QString getRealNameAndId() const;
//! Validate, provide details about issues
CStatusMessageList validate() const;