summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2019-09-23 19:10:19 -0400
committerisanae <14251494+isanae@users.noreply.github.com>2019-09-23 19:10:19 -0400
commit088f27fe48cd8f218052090a97e8187eedf0c06e (patch)
tree87e2695ff28c5fa4a7ef3610a0898f22776074e6 /src/organizercore.cpp
parent200b5283eb5a0eff5ed18e772930b99eea5e11ef (diff)
changed the layout of the general settings tab
added option to disable checking for updates removed online check, just try it and see
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp36
1 files changed, 9 insertions, 27 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 0da5b604..a4a89c99 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -74,25 +74,6 @@ using namespace MOBase;
//static
CrashDumpsType OrganizerCore::m_globalCrashDumpsType = CrashDumpsType::None;
-static bool isOnline()
-{
- const auto runningFlags =
- QNetworkInterface::IsUp | QNetworkInterface::IsRunning;
-
- for (auto&& i : QNetworkInterface::allInterfaces()) {
- if (!(i.flags() & QNetworkInterface::IsLoopBack)) {
- if (i.flags() & runningFlags) {
- auto addresses = i.addressEntries();
- if (!addresses.empty()) {
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
static std::wstring getProcessName(HANDLE process)
{
wchar_t buffer[MAX_PATH];
@@ -307,14 +288,15 @@ void OrganizerCore::setUserInterface(IUserInterface *userInterface,
m_InstallationManager.setParentWidget(widget);
m_Updater.setUserInterface(widget);
- if (userInterface != nullptr) {
- // this currently wouldn't work reliably if the ui isn't initialized yet to
- // display the result
- if (isOnline() && !m_Settings.network().offlineMode()) {
- m_Updater.testForUpdate();
- } else {
- log::debug("user doesn't seem to be connected to the internet");
- }
+ checkForUpdates();
+}
+
+void OrganizerCore::checkForUpdates()
+{
+ // this currently wouldn't work reliably if the ui isn't initialized yet to
+ // display the result
+ if (m_UserInterface != nullptr) {
+ m_Updater.testForUpdate(m_Settings);
}
}