diff options
author | Kenneth Chew <kenneth.c0@protonmail.com> | 2022-04-25 19:33:17 -0400 |
---|---|---|
committer | Kenneth Chew <kenneth.c0@protonmail.com> | 2022-05-19 15:16:37 -0400 |
commit | 05cd30ac06b67ebc594773fc7e7ccf110fc336a3 (patch) | |
tree | 0c477c542301b45c8c2436b7b92b0b00cf785098 /launcher/ui/MainWindow.cpp | |
parent | 34adcec6165662d6245a55ee0a75c36753061df2 (diff) | |
download | PrismLauncher-05cd30ac06b67ebc594773fc7e7ccf110fc336a3.tar.gz PrismLauncher-05cd30ac06b67ebc594773fc7e7ccf110fc336a3.tar.bz2 PrismLauncher-05cd30ac06b67ebc594773fc7e7ccf110fc336a3.zip |
Refactor code, create abstract class `ExternalUpdater`
(Hopefully) this makes implementing updaters using external libraries easier on other platforms. To implement an updater on a new platform, create a new class that implements the pure virtual methods from `ExternalUpdater` and add code in the `UpdateChecker` initializer to initialize the new class.
Diffstat (limited to 'launcher/ui/MainWindow.cpp')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 12761da1..951fcccf 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1028,12 +1028,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow updater->checkForUpdate(APPLICATION->settings()->get("UpdateChannel").toString(), false); } -#ifdef Q_OS_MAC - connect(APPLICATION->updateChecker()->getSparkleUpdater(), - &SparkleUpdater::canCheckForUpdatesChanged, - this, - &MainWindow::updatesAllowedChanged); -#endif + if (APPLICATION->updateChecker()->getExternalUpdater()) + { + connect(APPLICATION->updateChecker()->getExternalUpdater(), + &ExternalUpdater::canCheckForUpdatesChanged, + this, + &MainWindow::updatesAllowedChanged); + } } setSelectedInstanceById(APPLICATION->settings()->get("SelectedInstance").toString()); |