mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-11-04 03:36:32 +00:00
crash: add crash reporter
This commit is contained in:
23 files changed
+1118
-315
No files matched your search
+12
-1
@@ -9,6 +9,8 @@
|
||||
#include <qtenvironmentvariables.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
Q_LOGGING_CATEGORY(logPaths, "quickshell.paths", QtWarningMsg);
|
||||
|
||||
QsPaths* QsPaths::instance() {
|
||||
@@ -18,6 +20,15 @@ QsPaths* QsPaths::instance() {
|
||||
|
||||
void QsPaths::init(QString shellId) { QsPaths::instance()->shellId = std::move(shellId); }
|
||||
|
||||
QDir QsPaths::crashDir(const QString& shellId, const QDateTime& launchTime) {
|
||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
|
||||
dir = QDir(dir.filePath("crashes"));
|
||||
dir = QDir(dir.filePath(shellId));
|
||||
dir = QDir(dir.filePath(QString("run-%1").arg(launchTime.toMSecsSinceEpoch())));
|
||||
|
||||
return dir;
|
||||
}
|
||||
|
||||
QDir* QsPaths::cacheDir() {
|
||||
if (this->cacheState == DirState::Unknown) {
|
||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
|
||||
@@ -73,7 +84,7 @@ QDir* QsPaths::instanceRunDir() {
|
||||
this->instanceRunState = DirState::Failed;
|
||||
} else {
|
||||
this->mInstanceRunDir =
|
||||
runtimeDir->filePath(QString("run-%1").arg(QDateTime::currentMSecsSinceEpoch()));
|
||||
runtimeDir->filePath(QString("run-%1").arg(qs::Common::LAUNCH_TIME.toMSecsSinceEpoch()));
|
||||
|
||||
qCDebug(logPaths) << "Initialized instance runtime path:" << this->mInstanceRunDir.path();
|
||||
|
||||
|
||||
Reference in new issue
Block a user