https://bugs.kde.org/show_bug.cgi?id=499882

--- Comment #59 from Oleg Gorobets <[email protected]> ---
It looks like the problem is here:
https://invent.kde.org/plasma/kinfocenter/-/blob/master/kcms/about-distro/src/GPUEntryFactory.cpp#L53

See https://doc.qt.io/qt-6/qfile.html#platform-specific-issues

On Unix, there are some special system files (e.g. in /proc) for which size()
will always return 0, yet you may still be able to read more data from such a
file; the data is generated in direct response to you calling read(). In this
case, however, you cannot use atEnd() to determine if there is more data to
read (since atEnd() will return true for a file that claims to have size 0).
Instead, you should either call readAll(), or call read() or readLine()
repeatedly until no more data can be read.

So if we rewrite the 'while' loop into something like this, it should work:

QTextStream in(&file);
QString line = in.readLine();
while (!line.isNull()) {
    if (line.startsWith("nvidia"_L1)) {
        return true;
    }
    line = in.readLine();
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to