Crashpad: Fix compilation on Windows

It was trying to modify a const QString.

Change-Id: I431abb387cf964d4e8869371fd8f7f04c0b055e7
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2024-10-07 13:40:42 +02:00
parent ef2d83c7b7
commit 836d555742

View File

@@ -418,12 +418,11 @@ bool startCrashpad(const AppInfo &appInfo, bool crashReportingEnabled)
const QString databasePath = appInfo.crashReports.path(); const QString databasePath = appInfo.crashReports.path();
const QString handlerPath = (appInfo.libexec / "crashpad_handler").path(); const QString handlerPath = (appInfo.libexec / "crashpad_handler").path();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
handlerPath += ".exe";
base::FilePath database(databasePath.toStdWString()); base::FilePath database(databasePath.toStdWString());
base::FilePath handler(handlerPath.toStdWString()); base::FilePath handler(HostOsInfo::withExecutableSuffix(handlerPath).toStdWString());
#elif defined(Q_OS_MACOS) || defined(Q_OS_LINUX) #elif defined(Q_OS_MACOS) || defined(Q_OS_LINUX)
base::FilePath database(databasePath.toStdString()); base::FilePath database(databasePath.toStdString());
base::FilePath handler(handlerPath.toStdString()); base::FilePath handler(HostOsInfo::withExecutableSuffix(handlerPath).toStdString());
#endif #endif
std::unique_ptr<CrashReportDatabase> db = CrashReportDatabase::Initialize(database); std::unique_ptr<CrashReportDatabase> db = CrashReportDatabase::Initialize(database);