crash: add crash stack print.

This commit is contained in:
2025-06-20 10:33:03 +08:00
parent 32b206c2f5
commit ce3d3a1866
15 changed files with 5048 additions and 8 deletions

View File

@@ -33,6 +33,33 @@ QString Util::GetUserHome()
return homePath;
}
QString Util::GetCurConfigPath(const QString& sub)
{
// Get user's home directory
QString homePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
if (homePath.isEmpty()) {
qWarning() << "Failed to get user home directory";
return QString();
}
auto configPath = QDir(homePath).absoluteFilePath(".config");
// Append subdirectory if provided
if (!sub.isEmpty()) {
configPath = QDir(configPath).absoluteFilePath(sub);
}
// Create the directory if it doesn't exist
QDir dir(configPath);
if (!dir.exists()) {
if (!dir.mkpath(".")) {
qWarning() << "Failed to create config directory:" << configPath;
return QString();
}
}
return QDir::cleanPath(configPath);
}
QString Util::Join(const QString& path, const QString& name)
{
return QDir::cleanPath(path + QDir::separator() + name);
@@ -111,5 +138,4 @@ QString DirFileHelper::GetErr() const
DirFileHelper::DirFileHelper(QObject* parent) : QObject(parent)
{
}