浏览代码

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);
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////