build: Added option to disable update checking (#1036)

This is aimed at use by linux distros, where package updates come from a
central location, and users shouldn't need to worry about updating ImHex
on their own. This disables parts of the ImHex UI that would not be
useful in that case.

Tested and confirmed that this works in both states of the of the
`-DIMHEX_DISABLE_UPDATE_CHECK` switch.
This commit is contained in:
classabbyamp
2023-05-05 16:03:45 -04:00
committed by GitHub
parent e44eb2aa8e
commit 82f5900759
5 changed files with 15 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ namespace hex::init {
using namespace std::literals::string_literals;
#if defined(HEX_UPDATE_CHECK)
static bool checkForUpdates() {
int showCheckForUpdates = ContentRegistry::Settings::read("hex.builtin.setting.general", "hex.builtin.setting.general.check_for_updates", 2);
@@ -69,6 +70,7 @@ namespace hex::init {
}
return true;
}
#endif
bool setupEnvironment() {
hex::log::debug("Using romfs: '{}'", romfs::name());
@@ -475,7 +477,9 @@ namespace hex::init {
#endif
{ "Loading settings", loadSettings, false },
{ "Loading plugins", loadPlugins, false },
#if defined(HEX_UPDATE_CHECK)
{ "Checking for updates", checkForUpdates, true },
#endif
{ "Loading fonts", loadFonts, true },
};
}
@@ -488,4 +492,4 @@ namespace hex::init {
};
}
}
}