rbutilqt: Switch to a Qt API to get the CPU cores count

This removes usage of the deprecated macOS Gestalt() API (1/2)

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: Ia3af510412a97258dcd9fc9134708900c04c62c4
This commit is contained in:
Vencislav Atanasov 2026-06-29 22:02:46 +03:00
parent cac0be6af5
commit 1cbf61607e

View file

@ -179,14 +179,10 @@ QString System::osVersionString(void)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
struct utsname u;
int ret;
int cores;
ret = uname(&u);
cores = QThread::idealThreadCount();
#if defined(Q_OS_MACOS)
SInt32 cores;
Gestalt(gestaltCountOfCPUs, &cores);
#else
long cores = sysconf(_SC_NPROCESSORS_ONLN);
#endif
if(ret != -1) {
result = QString("CPU: %1, %2 processor(s)").arg(u.machine).arg(cores);
result += QString("<br/>System: %2<br/>Release: %3<br/>Version: %4")