mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
Ref T401, crash simulation improvements
* sub-directory paths in directory utils * no UI simulated crash in release builds * no upload rate in local developer builds
This commit is contained in:
committed by
Mat Sutcliffe
parent
9745bafd4e
commit
60b3c16120
@@ -77,10 +77,16 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CCrashInfo::triggerWritingFile()
|
||||
void CCrashInfo::triggerWritingFile() const
|
||||
{
|
||||
if (m_logFileAndPath.isEmpty()) { return; }
|
||||
CFileUtils::writeStringToFileInBackground(summary(), m_logFileAndPath);
|
||||
CFileUtils::writeStringToFileInBackground(this->summary(), m_logFileAndPath);
|
||||
}
|
||||
|
||||
bool CCrashInfo::writeToFile() const
|
||||
{
|
||||
if (m_logFileAndPath.isEmpty()) { return false; }
|
||||
return CFileUtils::writeStringToFile(this->summary(), m_logFileAndPath);
|
||||
}
|
||||
|
||||
QString CCrashInfo::summary() const
|
||||
|
||||
@@ -79,8 +79,11 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Index::comparePropertyByIndex
|
||||
int comparePropertyByIndex(const CPropertyIndex &index, const CCrashInfo &compareValue) const;
|
||||
|
||||
//! Trigger writing this to file
|
||||
void triggerWritingFile();
|
||||
//! Trigger writing this to file (in background)
|
||||
void triggerWritingFile() const;
|
||||
|
||||
//! Write to file (synchronous)
|
||||
bool writeToFile() const;
|
||||
|
||||
//! Summary
|
||||
QString summary() const;
|
||||
|
||||
@@ -378,7 +378,7 @@ namespace BlackMisc
|
||||
|
||||
QString getDocumentationDirectoryImpl()
|
||||
{
|
||||
QStringList pathes(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation));
|
||||
const QStringList pathes(QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation));
|
||||
QString d = pathes.first();
|
||||
d = QDir::cleanPath(d + QDir::separator() + "swift");
|
||||
QDir dir(d);
|
||||
@@ -398,6 +398,18 @@ namespace BlackMisc
|
||||
return p;
|
||||
}
|
||||
|
||||
const QString &CDirectoryUtils::crashpadDatabaseDirectory()
|
||||
{
|
||||
static const QString p = CFileUtils::appendFilePaths(crashpadDirectory(), "/database");
|
||||
return p;
|
||||
}
|
||||
|
||||
const QString &CDirectoryUtils::crashpadMetricsDirectory()
|
||||
{
|
||||
static const QString p = CFileUtils::appendFilePaths(crashpadDirectory(), "/metrics");
|
||||
return p;
|
||||
}
|
||||
|
||||
QString CDirectoryUtils::decodeNormalizedDirectory(const QString &directory)
|
||||
{
|
||||
return QUrl::fromPercentEncoding(directory.toUtf8());
|
||||
|
||||
@@ -139,6 +139,12 @@ namespace BlackMisc
|
||||
//! Directory for crashpad files
|
||||
static const QString &crashpadDirectory();
|
||||
|
||||
//! Directory for crashpad database files
|
||||
static const QString &crashpadDatabaseDirectory();
|
||||
|
||||
//! Directory for crashpad metrics files
|
||||
static const QString &crashpadMetricsDirectory();
|
||||
|
||||
//! Virtually the inverse operation of CDirectoryUtils::normalizedApplicationDirectory
|
||||
static QString decodeNormalizedDirectory(const QString &directory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user