icons: fix quoting issues
This commit is contained in:
parent
ba45106e7e
commit
9743a2e9b8
1 changed files with 3 additions and 3 deletions
|
|
@ -237,11 +237,11 @@ Singleton {
|
||||||
path: "/etc/os-release"
|
path: "/etc/os-release"
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
const lines = text().split("\n");
|
const lines = text().split("\n");
|
||||||
let osId = lines.find(l => l.startsWith("ID="))?.split("=")[1];
|
let osId = lines.find(l => l.startsWith("ID="))?.split("=")[1].replace(/"/g, "");
|
||||||
if (root.osIcons.hasOwnProperty(osId))
|
if (root.osIcons.hasOwnProperty(osId))
|
||||||
root.osIcon = root.osIcons[osId];
|
root.osIcon = root.osIcons[osId];
|
||||||
else {
|
else {
|
||||||
const osIdLike = lines.find(l => l.startsWith("ID_LIKE="))?.split("=")[1];
|
const osIdLike = lines.find(l => l.startsWith("ID_LIKE="))?.split("=")[1].replace(/"/g, "");
|
||||||
if (osIdLike)
|
if (osIdLike)
|
||||||
for (const id of osIdLike.split(" "))
|
for (const id of osIdLike.split(" "))
|
||||||
if (root.osIcons.hasOwnProperty(id))
|
if (root.osIcons.hasOwnProperty(id))
|
||||||
|
|
@ -251,7 +251,7 @@ Singleton {
|
||||||
let nameLine = lines.find(l => l.startsWith("PRETTY_NAME="));
|
let nameLine = lines.find(l => l.startsWith("PRETTY_NAME="));
|
||||||
if (!nameLine)
|
if (!nameLine)
|
||||||
nameLine = lines.find(l => l.startsWith("NAME="));
|
nameLine = lines.find(l => l.startsWith("NAME="));
|
||||||
root.osName = nameLine.split("=")[1].slice(1, -1);
|
root.osName = nameLine.split("=")[1].replace(/"/g, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue