diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-10-04 06:30:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-04 06:30:15 -0400 |
| commit | 2fe50f2ff366ea850eb70a85c6ea7d6c936bf08a (patch) | |
| tree | 77041dd84568817e0e359381e7fb78f6a1f2dd2a /src/organizercore.cpp | |
| parent | e6a47bf8b70be2c480f77c68c08480a33e71dce3 (diff) | |
| parent | 239cfbe6854f727b5dd3e6922cacc17587361cf5 (diff) | |
Merge pull request #842 from isanae/dialog-settings
Dialog settings
Diffstat (limited to 'src/organizercore.cpp')
| -rw-r--r-- | src/organizercore.cpp | 36 |
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); } } |
