mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[Oracle] Qt version guard for regexp
This commit is contained in:
parent
65a3423009
commit
2c0c8b416a
1 changed files with 5 additions and 1 deletions
|
|
@ -37,7 +37,11 @@ qulonglong SystemMemoryQuerier::totalMemoryBytes()
|
|||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
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)
|
||||
return parts[1].toULongLong() * 1024; // kB → bytes
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue