refactor: Un-singletonize Paths & Updates (#5092)

This commit is contained in:
pajlada
2024-01-16 21:56:43 +01:00
committed by GitHub
parent 7f935665f9
commit 718696db53
60 changed files with 237 additions and 165 deletions
+7 -6
View File
@@ -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();
@@ -223,7 +223,8 @@ namespace {
}
} // namespace
void runGui(QApplication &a, Paths &paths, Settings &settings, const Args &args)
void runGui(QApplication &a, const Paths &paths, Settings &settings,
const Args &args, Updates &updates)
{
initQt();
initResources();
@@ -232,7 +233,7 @@ void runGui(QApplication &a, Paths &paths, Settings &settings, const Args &args)
#ifdef Q_OS_WIN
if (args.crashRecovery)
{
showLastCrashDialog(args);
showLastCrashDialog(args, paths);
}
#endif
@@ -269,9 +270,9 @@ void runGui(QApplication &a, Paths &paths, Settings &settings, const Args &args)
});
chatterino::NetworkManager::init();
chatterino::Updates::instance().checkForUpdates();
updates.checkForUpdates();
Application app(settings, paths, args);
Application app(settings, paths, args, updates);
app.initialize(settings, paths);
app.run(a);
app.save();