diff --git a/src/RunGui.cpp b/src/RunGui.cpp
index 99d8a4bb6..4ab7ac830 100644
--- a/src/RunGui.cpp
+++ b/src/RunGui.cpp
@@ -98,9 +98,9 @@ namespace {
installCustomPalette();
}
- void showLastCrashDialog(const Args &args)
+ void showLastCrashDialog(const Args &args, const Paths &paths)
{
- auto *dialog = new LastRunCrashDialog(args);
+ auto *dialog = new LastRunCrashDialog(args, paths);
// Use exec() over open() to block the app from being loaded
// and to be able to set the safe mode.
dialog->exec();
@@ -233,7 +233,7 @@ void runGui(QApplication &a, const Paths &paths, Settings &settings,
#ifdef Q_OS_WIN
if (args.crashRecovery)
{
- showLastCrashDialog(args);
+ showLastCrashDialog(args, paths);
}
#endif
diff --git a/src/widgets/dialogs/LastRunCrashDialog.cpp b/src/widgets/dialogs/LastRunCrashDialog.cpp
index 6de4daba9..4b12543a3 100644
--- a/src/widgets/dialogs/LastRunCrashDialog.cpp
+++ b/src/widgets/dialogs/LastRunCrashDialog.cpp
@@ -43,7 +43,7 @@ namespace chatterino {
using namespace literals;
-LastRunCrashDialog::LastRunCrashDialog(const Args &args)
+LastRunCrashDialog::LastRunCrashDialog(const Args &args, const Paths &paths)
{
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
this->setWindowTitle(u"Chatterino - " % randomMessage());
@@ -56,8 +56,7 @@ LastRunCrashDialog::LastRunCrashDialog(const Args &args)
"You can disable automatic restarts in the settings.
";
#ifdef CHATTERINO_WITH_CRASHPAD
- auto reportsDir =
- QDir(getPaths()->crashdumpDirectory).filePath(u"reports"_s);
+ auto reportsDir = QDir(paths.crashdumpDirectory).filePath(u"reports"_s);
text += u"A crash report has been saved to "
"" % reportsDir % u".
";
diff --git a/src/widgets/dialogs/LastRunCrashDialog.hpp b/src/widgets/dialogs/LastRunCrashDialog.hpp
index 1f31c51f7..d8175758c 100644
--- a/src/widgets/dialogs/LastRunCrashDialog.hpp
+++ b/src/widgets/dialogs/LastRunCrashDialog.hpp
@@ -5,11 +5,12 @@
namespace chatterino {
class Args;
+class Paths;
class LastRunCrashDialog : public QDialog
{
public:
- explicit LastRunCrashDialog(const Args &args);
+ explicit LastRunCrashDialog(const Args &args, const Paths &paths);
};
} // namespace chatterino