Merge pull request #2 from Nohus/remove_plasmaVersion

Removed plasmaVersion incorrectly interpreting version as a double
master
Robinson 2023-11-19 21:39:53 +01:00 committed by GitHub
commit 4b90e718ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 21 deletions

View File

@ -1019,8 +1019,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)
}
@ -1057,25 +1056,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