versionKeeper: ignore minor rev version

no point in firing the update screen when no breaking changes happen on point releases
This commit is contained in:
Vaxry 2026-02-19 01:05:28 +00:00
parent 68456a5d9a
commit 7a566942d5
No known key found for this signature in database
GPG key ID: 665806380871D640
2 changed files with 4 additions and 8 deletions

View file

@ -34,8 +34,8 @@ CVersionKeeperManager::CVersionKeeperManager() {
return;
}
if (!isVersionOlderThanRunning(*LASTVER)) {
Log::logger->log(Log::DEBUG, "CVersionKeeperManager: Read version {} matches or is older than running.", *LASTVER);
if (!isMajorVersionOlderThanRunning(*LASTVER)) {
Log::logger->log(Log::DEBUG, "CVersionKeeperManager: Read version {} matches or is older than running major.", *LASTVER);
return;
}
@ -59,25 +59,21 @@ CVersionKeeperManager::CVersionKeeperManager() {
});
}
bool CVersionKeeperManager::isVersionOlderThanRunning(const std::string& ver) {
bool CVersionKeeperManager::isMajorVersionOlderThanRunning(const std::string& ver) {
const CVarList verStrings(ver, 0, '.', true);
const int V1 = configStringToInt(verStrings[0]).value_or(0);
const int V2 = configStringToInt(verStrings[1]).value_or(0);
const int V3 = configStringToInt(verStrings[2]).value_or(0);
static const CVarList runningStrings(HYPRLAND_VERSION, 0, '.', true);
static const int R1 = configStringToInt(runningStrings[0]).value_or(0);
static const int R2 = configStringToInt(runningStrings[1]).value_or(0);
static const int R3 = configStringToInt(runningStrings[2]).value_or(0);
if (R1 > V1)
return true;
if (R2 > V2)
return true;
if (R3 > V3)
return true;
return false;
}

View file

@ -10,7 +10,7 @@ class CVersionKeeperManager {
bool fired();
private:
bool isVersionOlderThanRunning(const std::string& ver);
bool isMajorVersionOlderThanRunning(const std::string& ver);
bool m_fired = false;
};