File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -283,11 +283,12 @@ int main(int argc, char* argv[])
283283 }
284284#endif
285285
286- if (!Settings::Instance ().IsBatchModeEnabled ())
286+ if (!Settings::Instance ().IsBatchModeEnabled () &&
287+ AutoUpdateChecker::SystemSupportsAutoUpdates ())
287288 {
288- auto * updater = new Updater (&win, Config::Get (Config::MAIN_AUTOUPDATE_UPDATE_TRACK),
289- Config::Get (Config::MAIN_AUTOUPDATE_HASH_OVERRIDE));
290- updater-> start ( );
289+ new Updater (&win, Config::Get (Config::MAIN_AUTOUPDATE_UPDATE_TRACK),
290+ Config::Get (Config::MAIN_AUTOUPDATE_HASH_OVERRIDE),
291+ AutoUpdateChecker::CheckType::Automatic );
291292 }
292293
293294 retval = app.exec ();
Original file line number Diff line number Diff line change @@ -660,10 +660,9 @@ void MenuBar::InstallUpdateManually()
660660{
661661 const std::string autoupdate_track = Config::Get (Config::MAIN_AUTOUPDATE_UPDATE_TRACK);
662662 const std::string manual_track = autoupdate_track.empty () ? " dev" : autoupdate_track;
663- auto * const updater = new Updater (this ->parentWidget (), manual_track,
664- Config::Get (Config::MAIN_AUTOUPDATE_HASH_OVERRIDE));
665-
666- updater->CheckForUpdate ();
663+ new Updater (this ->parentWidget (), manual_track,
664+ Config::Get (Config::MAIN_AUTOUPDATE_HASH_OVERRIDE),
665+ AutoUpdateChecker::CheckType::Manual);
667666}
668667
669668void MenuBar::AddHelpMenu ()
Original file line number Diff line number Diff line change 2121
2222// Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process
2323
24- Updater::Updater (QWidget* parent, std::string update_track, std::string hash_override)
24+ Updater::Updater (QWidget* parent, std::string update_track, std::string hash_override,
25+ const CheckType check_type)
2526 : m_parent(parent), m_update_track(std::move(update_track)),
26- m_hash_override(std::move(hash_override))
27+ m_hash_override(std::move(hash_override)), m_check_type(check_type)
2728{
2829 connect (this , &QThread::finished, this , &QObject::deleteLater);
30+ start ();
2931}
3032
3133void Updater::run ()
3234{
33- AutoUpdateChecker::CheckForUpdate (m_update_track, m_hash_override,
34- AutoUpdateChecker::CheckType::Automatic);
35- }
36-
37- void Updater::CheckForUpdate ()
38- {
39- AutoUpdateChecker::CheckForUpdate (m_update_track, m_hash_override,
40- AutoUpdateChecker::CheckType::Manual);
35+ AutoUpdateChecker::CheckForUpdate (m_update_track, m_hash_override, m_check_type);
4136}
4237
4338void Updater::OnUpdateAvailable (const NewVersionInformation& info)
Original file line number Diff line number Diff line change @@ -17,14 +17,15 @@ class Updater : public QThread, public AutoUpdateChecker
1717{
1818 Q_OBJECT
1919public:
20- explicit Updater (QWidget* parent, std::string update_track, std::string hash_override);
20+ explicit Updater (QWidget* parent, std::string update_track, std::string hash_override,
21+ CheckType check_type);
2122
2223 void run () override ;
2324 void OnUpdateAvailable (const NewVersionInformation& info) override ;
24- void CheckForUpdate ();
2525
2626private:
2727 QWidget* m_parent;
2828 std::string m_update_track;
2929 std::string m_hash_override;
30+ CheckType m_check_type;
3031};
You can’t perform that action at this time.
0 commit comments