Преглед изворни кода

Respect automatic updates settings value in the updater

This was broken since we moved the updater internally. Now we check
this value before starting the timer to check for updates.
Tobias Hieta пре 8 година
родитељ
комит
5066cf8da5
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      src/system/UpdaterComponent.cpp

+ 5 - 2
src/system/UpdaterComponent.cpp

@@ -42,7 +42,8 @@ UpdaterComponent::UpdaterComponent(QObject* parent) :
   connect(&m_netManager, &QNetworkAccessManager::finished, this, &UpdaterComponent::dlComplete);
 
   connect(&SystemComponent::Get(), &SystemComponent::userInfoChanged, [&](){
-    QTimer::singleShot(10 * 1000, this, &UpdaterComponent::checkForUpdate);
+    if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "automaticUpdates").toBool())
+      QTimer::singleShot(10 * 1000, this, &UpdaterComponent::checkForUpdate);
   });
 
   auto updateTimer = new QTimer(this);
@@ -52,7 +53,9 @@ UpdaterComponent::UpdaterComponent(QObject* parent) :
     if (diff >= (3 * 60 * 60))
       checkForUpdate();
   });
-  updateTimer->start(5 * 60 * 1000);
+
+  if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "automaticUpdates").toBool())
+    updateTimer->start(5 * 60 * 1000);
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////