mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-05 20:39:59 -08:00
[Oracle] Qt version guard for regexp
This commit is contained in:
@@ -37,7 +37,11 @@ qulonglong SystemMemoryQuerier::totalMemoryBytes()
|
|||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
QString line = in.readLine();
|
QString line = in.readLine();
|
||||||
if (line.startsWith("MemTotal:")) {
|
if (line.startsWith("MemTotal:")) {
|
||||||
QStringList parts = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QStringList parts = line.split(QRegExp("\\s+"), QString::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
QStringList parts = line.split(QRegularExpression("\\s+"), Qt::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
if (parts.size() >= 2)
|
if (parts.size() >= 2)
|
||||||
return parts[1].toULongLong() * 1024; // kB → bytes
|
return parts[1].toULongLong() * 1024; // kB → bytes
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user