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