Qt: Install crash handler on startup

This commit is contained in:
Connor McLaughlin 2022-04-19 00:58:34 +10:00 committed by refractionpcsx2
parent abde47fa18
commit 69da1e4559
2 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,8 @@
#include "Frontend/GameList.h" #include "Frontend/GameList.h"
#include "svnrev.h" #include "svnrev.h"
#include "common/CrashHandler.h"
static void PrintCommandLineVersion() static void PrintCommandLineVersion()
{ {
std::fprintf(stderr, "PCSX2 Version %s\n", GIT_REV); std::fprintf(stderr, "PCSX2 Version %s\n", GIT_REV);
@ -189,6 +191,8 @@ static bool ParseCommandLineOptions(int argc, char* argv[], std::shared_ptr<VMBo
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
CrashHandler::Install();
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);

View File

@ -26,6 +26,7 @@
#include "common/Assertions.h" #include "common/Assertions.h"
#include "common/Console.h" #include "common/Console.h"
#include "common/CrashHandler.h"
#include "common/FileSystem.h" #include "common/FileSystem.h"
#include "common/SettingsWrapper.h" #include "common/SettingsWrapper.h"
#include "common/StringUtil.h" #include "common/StringUtil.h"
@ -114,6 +115,9 @@ bool QtHost::SetCriticalFolders()
EmuFolders::Settings = EmuFolders::DataRoot.Combine(wxDirName(L"inis")); EmuFolders::Settings = EmuFolders::DataRoot.Combine(wxDirName(L"inis"));
EmuFolders::Resources = EmuFolders::AppRoot.Combine(wxDirName(L"resources")); EmuFolders::Resources = EmuFolders::AppRoot.Combine(wxDirName(L"resources"));
// Write crash dumps to the data directory, since that'll be accessible for certain.
CrashHandler::SetWriteDirectory(EmuFolders::DataRoot.ToUTF8().data());
// the resources directory should exist, bail out if not // the resources directory should exist, bail out if not
if (!EmuFolders::Resources.Exists()) if (!EmuFolders::Resources.Exists())
{ {