mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Ref T401, update functions for crashpad info in CApplication
This commit is contained in:
@@ -1646,6 +1646,16 @@ namespace BlackCore
|
||||
m_crashInfo = info;
|
||||
}
|
||||
|
||||
void CApplication::setCrashInfoUserName(const QString &name)
|
||||
{
|
||||
m_crashInfo.setUserName(name);
|
||||
}
|
||||
|
||||
void CApplication::appendCrashInfo(const QString &info)
|
||||
{
|
||||
m_crashInfo.appendInfo(info);
|
||||
}
|
||||
|
||||
void CApplication::httpRequestImplInQAMThread(const QNetworkRequest &request, int logId, const CallbackSlot &callback, int maxRedirects, NetworkRequestOrPostFunction requestOrPostMethod)
|
||||
{
|
||||
// run in QAM thread
|
||||
|
||||
@@ -300,6 +300,20 @@ namespace BlackCore
|
||||
virtual QString cmdLineArgumentsAsString(bool withExecutable = true);
|
||||
//! @}
|
||||
|
||||
// ----------------------- CrashPad info ---------------------------------
|
||||
|
||||
//! Extra annotation for crash to easier identify annotation
|
||||
void setCrashInfo(const BlackMisc::CCrashInfo &info);
|
||||
|
||||
//! User name for crash info
|
||||
void setCrashInfoUserName(const QString &name);
|
||||
|
||||
//! Append crash info
|
||||
void appendCrashInfo(const QString &info);
|
||||
|
||||
//! Get the crash info
|
||||
const BlackMisc::CCrashInfo &getCrashInfo() const { return m_crashInfo; }
|
||||
|
||||
// ----------------------- Input ----------------------------------------
|
||||
|
||||
//! The input manager, if available
|
||||
@@ -670,9 +684,6 @@ namespace BlackCore
|
||||
//! Upload settings changed
|
||||
void onCrashDumpUploadEnabledChanged();
|
||||
|
||||
//! Extra annotation for crash to easier identify annotation
|
||||
void setCrashInfo(const BlackMisc::CCrashInfo &info);
|
||||
|
||||
#ifdef BLACK_USE_CRASHPAD
|
||||
std::unique_ptr<crashpad::CrashpadClient> m_crashpadClient;
|
||||
std::unique_ptr<crashpad::CrashReportDatabase> m_crashReportDatabase;
|
||||
|
||||
@@ -20,6 +20,13 @@ namespace BlackMisc
|
||||
return QStringLiteral("{ %1, %2 }").arg(this->getInfo(), this->getUserName());
|
||||
}
|
||||
|
||||
void CCrashInfo::appendInfo(const QString &extraInfo)
|
||||
{
|
||||
if (extraInfo.isEmpty()) { return; }
|
||||
if (m_info.isEmpty()) { this->setInfo(extraInfo); return; }
|
||||
m_info += QStringLiteral(" ") % extraInfo;
|
||||
}
|
||||
|
||||
CVariant CCrashInfo::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
@@ -45,6 +45,9 @@ namespace BlackMisc
|
||||
//! Set info
|
||||
void setInfo(const QString &info) { m_info = info; }
|
||||
|
||||
//! Append some info
|
||||
void appendInfo(const QString &extraInfo);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user