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.
This commit is contained in:
Kenneth Chew
2022-04-25 19:33:17 -04:00
parent 34adcec616
commit 05cd30ac06
8 changed files with 273 additions and 138 deletions

View File

@ -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());