mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-27 06:45:49 +03:00
[Core] Include more information about the OS in the user agent
This commit is contained in:
parent
edb51abdfd
commit
466e8abc91
1 changed files with 9 additions and 13 deletions
|
@ -170,24 +170,20 @@ static QLatin1String platform()
|
||||||
#elif defined(Q_OS_SOLARIS)
|
#elif defined(Q_OS_SOLARIS)
|
||||||
return QLatin1String("Solaris");
|
return QLatin1String("Solaris");
|
||||||
#else
|
#else
|
||||||
return QLatin1String("Unknown OS");
|
return QSysInfo::productType();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray Utility::userAgentString()
|
QByteArray Utility::userAgentString()
|
||||||
{
|
{
|
||||||
QString re = QString::fromLatin1("Mozilla/5.0 (%1) mirall/%2")
|
return QStringLiteral("Mozilla/5.0 (%1) mirall/%2 (%3, %4-%5 ClientArchitecture: %6 OsArchitecture: %7)")
|
||||||
.arg(platform(), QLatin1String(MIRALL_VERSION_STRING));
|
.arg(platform(),
|
||||||
|
QLatin1String(MIRALL_VERSION_STRING),
|
||||||
QLatin1String appName(APPLICATION_SHORTNAME);
|
qApp->applicationName(),
|
||||||
|
QSysInfo::productType(),
|
||||||
// this constant "ownCloud" is defined in the default OEM theming
|
QSysInfo::kernelVersion(),
|
||||||
// that is used for the standard client. If it is changed there,
|
QSysInfo::buildCpuArchitecture(),
|
||||||
// it needs to be adjusted here.
|
QSysInfo::currentCpuArchitecture()).toLatin1();
|
||||||
if (appName != QLatin1String("ownCloud")) {
|
|
||||||
re += QString(" (%1)").arg(appName);
|
|
||||||
}
|
|
||||||
return re.toLatin1();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray Utility::friendlyUserAgentString()
|
QByteArray Utility::friendlyUserAgentString()
|
||||||
|
|
Loading…
Reference in a new issue