mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
Ref T456, user statistics monitored at backend
* values for simulator/network * changed concept a bit so crash handler values are used for statistics as well
This commit is contained in:
@@ -1669,17 +1669,27 @@ namespace BlackCore
|
||||
|
||||
void CApplication::setCrashInfo(const CCrashInfo &info)
|
||||
{
|
||||
m_crashInfo = info;
|
||||
m_crashAndLogInfo = info;
|
||||
}
|
||||
|
||||
void CApplication::setCrashInfoUserName(const QString &name)
|
||||
void CApplication::crashAndLogInfoUserName(const QString &name)
|
||||
{
|
||||
m_crashInfo.setUserName(name);
|
||||
m_crashAndLogInfo.setUserName(name);
|
||||
}
|
||||
|
||||
void CApplication::appendCrashInfo(const QString &info)
|
||||
void CApplication::crashAndLogInfoSimulator(const QString &simulator)
|
||||
{
|
||||
m_crashInfo.appendInfo(info);
|
||||
m_crashAndLogInfo.setSimulatorString(simulator);
|
||||
}
|
||||
|
||||
void CApplication::crashAndLogInfoFlightNetwork(const QString &flightNetwork)
|
||||
{
|
||||
m_crashAndLogInfo.setFlightNetworkString(flightNetwork);
|
||||
}
|
||||
|
||||
void CApplication::crashAndLogAppendInfo(const QString &info)
|
||||
{
|
||||
m_crashAndLogInfo.appendInfo(info);
|
||||
}
|
||||
|
||||
void CApplication::httpRequestImplInQAMThread(const QNetworkRequest &request, int logId, const CallbackSlot &callback, int maxRedirects, NetworkRequestOrPostFunction requestOrPostMethod)
|
||||
|
||||
@@ -306,13 +306,19 @@ namespace BlackCore
|
||||
void setCrashInfo(const BlackMisc::CCrashInfo &info);
|
||||
|
||||
//! User name for crash info
|
||||
void setCrashInfoUserName(const QString &name);
|
||||
void crashAndLogInfoUserName(const QString &name);
|
||||
|
||||
//! Simulator string
|
||||
void crashAndLogInfoSimulator(const QString &simulator);
|
||||
|
||||
//! Flight network
|
||||
void crashAndLogInfoFlightNetwork(const QString &flightNetwork);
|
||||
|
||||
//! Append crash info
|
||||
void appendCrashInfo(const QString &info);
|
||||
void crashAndLogAppendInfo(const QString &info);
|
||||
|
||||
//! Get the crash info
|
||||
const BlackMisc::CCrashInfo &getCrashInfo() const { return m_crashInfo; }
|
||||
const BlackMisc::CCrashInfo &getCrashInfo() const { return m_crashAndLogInfo; }
|
||||
|
||||
// ----------------------- Input ----------------------------------------
|
||||
|
||||
@@ -592,12 +598,12 @@ namespace BlackCore
|
||||
// cmd parsing
|
||||
QList<QCommandLineOption> m_allOptions; //!< all registered options
|
||||
QCommandLineParser m_parser; //!< cmd parser
|
||||
QCommandLineOption m_cmdHelp {"help"}; //!< help option
|
||||
QCommandLineOption m_cmdVersion {"version"}; //!< version option
|
||||
QCommandLineOption m_cmdDBusAddress {"emptyDBus"}; //!< DBus address
|
||||
QCommandLineOption m_cmdDevelopment {"dev"}; //!< Development flag
|
||||
QCommandLineOption m_cmdSharedDir {"shared"}; //!< Shared directory
|
||||
QCommandLineOption m_cmdClearCache {"clearcache"}; //!< Clear cache
|
||||
QCommandLineOption m_cmdHelp {"help"}; //!< help option
|
||||
QCommandLineOption m_cmdVersion {"version"}; //!< version option
|
||||
QCommandLineOption m_cmdDBusAddress {"emptyDBus"}; //!< DBus address
|
||||
QCommandLineOption m_cmdDevelopment {"dev"}; //!< Development flag
|
||||
QCommandLineOption m_cmdSharedDir {"shared"}; //!< Shared directory
|
||||
QCommandLineOption m_cmdClearCache {"clearcache"}; //!< Clear cache
|
||||
QCommandLineOption m_cmdTestCrashpad {"testcrashpad"}; //!< Test a crasphpad upload
|
||||
bool m_parsed = false; //!< Parsing accomplished?
|
||||
bool m_started = false; //!< started with success?
|
||||
@@ -692,7 +698,7 @@ namespace BlackCore
|
||||
std::unique_ptr<crashpad::CrashReportDatabase> m_crashReportDatabase;
|
||||
BlackMisc::CSettingReadOnly<Application::TCrashDumpSettings> m_crashDumpSettings { this, &CApplication::onCrashDumpUploadEnabledChanged };
|
||||
#endif
|
||||
BlackMisc::CCrashInfo m_crashInfo; //!< info representing details
|
||||
BlackMisc::CCrashInfo m_crashAndLogInfo; //!< info representing details
|
||||
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -158,10 +158,18 @@ namespace BlackCore
|
||||
uuid.remove('}');
|
||||
|
||||
pingUrl.appendQuery("uuid", uuid);
|
||||
pingUrl.appendQuery("application", sApp->getApplicationNameAndVersion());
|
||||
if (type.testFlag(PingLogoff)) { pingUrl.appendQuery("logoff", "true"); }
|
||||
if (type.testFlag(PingShutdown)) { pingUrl.appendQuery("shutdown", "true"); }
|
||||
if (type.testFlag(PingStarted)) { pingUrl.appendQuery("started", "true"); }
|
||||
pingUrl.appendQuery("os", CBuildConfig::getPlatformString());
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild()) { pingUrl.appendQuery("dev", "true"); }
|
||||
if (sApp)
|
||||
{
|
||||
const CCrashInfo ci = sApp->getCrashInfo();
|
||||
pingUrl.appendQuery("application", sApp->getApplicationNameAndVersion());
|
||||
if (!ci.getSimulatorString().isEmpty()) { pingUrl.appendQuery("fs", ci.getSimulatorString()); }
|
||||
if (!ci.getFlightNetworkString().isEmpty()) { pingUrl.appendQuery("network", ci.getFlightNetworkString()); }
|
||||
}
|
||||
return pingUrl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user