Removed plasmaVersion incorrectly interpreting version as a double

master
Nohus 2023-11-18 19:19:01 +00:00
parent 509e4c8e0a
commit 6a37f3e652
1 changed files with 1 additions and 21 deletions

View File

@ -1018,8 +1018,7 @@ object OS {
val XDG = getEnv("XDG_CURRENT_DESKTOP")
if (XDG == null) {
// Check if plasmashell is running, if it is -- then we are most likely KDE
val plasmaVersion = plasmaVersion
plasmaVersion > 0
plasmaVersionFull != null && !plasmaVersionFull!!.startsWith("0")
} else {
"kde".equals(XDG, ignoreCase = true)
}
@ -1056,25 +1055,6 @@ object OS {
}
}
/**
* The first two decimal places of the version number of plasma shell (if running) as a double.
*
* @return cannot represent '5.6.5' as a number, so we return just the first two decimal places instead
*/
val plasmaVersion: Double by lazy {
if (plasmaVersionFull == null || plasmaVersionFull!!.startsWith("0")) {
0.0
} else {
// this isn't the BEST way to do this, but it's simple and easy to understand
val split = plasmaVersionFull!!.split(".", limit = 3).toTypedArray()
if (split.size > 2) {
(split[0] + "." + split[1]).toDouble()
} else {
split[0].toDouble()
}
}
}
val isXfce: Boolean by lazy {
if (!isLinux && !isUnix) {
false