MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / getDistroName

Function getDistroName

src/client/client-common/utils/linuxutils.cpp:354–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354QString getDistroName()
355{
356 QString distro;
357
358 QFile osReleaseFile("/etc/os-release");
359 if (osReleaseFile.open(QIODevice::ReadOnly)) {
360 QTextStream in(&osReleaseFile);
361 while (!in.atEnd()) {
362 QString line = in.readLine();
363 if (line.startsWith("PRETTY_NAME=")) {
364 distro = line.mid(12).removeFirst().removeLast();
365 }
366 }
367 }
368
369 if (distro.isEmpty()) {
370 return "Unknown";
371 }
372
373 return distro;
374}
375
376bool isImmutableDistro() {
377 // There isn't a perfect way to do this, but one good hint is if either / or /usr is mounted read-only.

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

openMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected