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:
parent
68456a5d9a
commit
7a566942d5
2 changed files with 4 additions and 8 deletions
|
|
@ -34,8 +34,8 @@ CVersionKeeperManager::CVersionKeeperManager() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVersionOlderThanRunning(*LASTVER)) {
|
if (!isMajorVersionOlderThanRunning(*LASTVER)) {
|
||||||
Log::logger->log(Log::DEBUG, "CVersionKeeperManager: Read version {} matches or is older than running.", *LASTVER);
|
Log::logger->log(Log::DEBUG, "CVersionKeeperManager: Read version {} matches or is older than running major.", *LASTVER);
|
||||||
return;
|
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 CVarList verStrings(ver, 0, '.', true);
|
||||||
|
|
||||||
const int V1 = configStringToInt(verStrings[0]).value_or(0);
|
const int V1 = configStringToInt(verStrings[0]).value_or(0);
|
||||||
const int V2 = configStringToInt(verStrings[1]).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 CVarList runningStrings(HYPRLAND_VERSION, 0, '.', true);
|
||||||
|
|
||||||
static const int R1 = configStringToInt(runningStrings[0]).value_or(0);
|
static const int R1 = configStringToInt(runningStrings[0]).value_or(0);
|
||||||
static const int R2 = configStringToInt(runningStrings[1]).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)
|
if (R1 > V1)
|
||||||
return true;
|
return true;
|
||||||
if (R2 > V2)
|
if (R2 > V2)
|
||||||
return true;
|
return true;
|
||||||
if (R3 > V3)
|
|
||||||
return true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class CVersionKeeperManager {
|
||||||
bool fired();
|
bool fired();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool isVersionOlderThanRunning(const std::string& ver);
|
bool isMajorVersionOlderThanRunning(const std::string& ver);
|
||||||
|
|
||||||
bool m_fired = false;
|
bool m_fired = false;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue