rbutilqt: Replace deprecated macro Q_OS_MACX with Q_OS_MACOS

Co-authored-by: ChatGPT (GPT-5.3 Mini) <chatgpt@openai.com>
Change-Id: I0c51044574b8ec96ceaf0b953c6735ccf5d19e5e
This commit is contained in:
Vencislav Atanasov 2026-06-29 21:52:59 +03:00
parent e0ac7a75a3
commit cac0be6af5
11 changed files with 41 additions and 41 deletions

View file

@ -266,7 +266,7 @@ void Autodetection::mergePatcher(void)
#ifdef Q_OS_LINUX
mp.append("2");
#endif
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
mp.append("s2");
#endif
struct Detected d;
@ -296,7 +296,7 @@ void Autodetection::mergePatcher(void)
#ifdef Q_OS_LINUX
mp.append("1");
#endif
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
mp.append("s1");
#endif
struct Detected d;

View file

@ -25,7 +25,7 @@
#include "mspackutil.h"
#include "Logger.h"
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
@ -155,7 +155,7 @@ int BootloaderInstallBase::logInstall(LogMode mode)
}
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
void BootloaderInstallBase::waitRemount()
{
m_remountTries = 600;
@ -168,7 +168,7 @@ void BootloaderInstallBase::waitRemount()
void BootloaderInstallBase::checkRemount()
{
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
if(m_remountTries--) {
int status = 0;
// check if device has been remounted

View file

@ -90,7 +90,7 @@ class BootloaderInstallBase : public QObject
QTemporaryFile m_tempof; //! temporary file for OF extracted from archive
QDateTime m_blversion; //! download timestamp used for version information
QString m_offile; //! path to the offile
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
void waitRemount(void);
int m_remountTries;

View file

@ -95,7 +95,7 @@ void BootloaderInstallIpod::installStage2(void)
if(add_bootloader(&ipod, blfile.toLatin1().data(), FILETYPE_DOT_IPOD) == 0) {
emit logItem(tr("Successfull added bootloader"), LOGOK);
ipod_close(&ipod);
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
m_remountDevice = ipod.diskname;
connect(this, SIGNAL(remounted(bool)), this, SLOT(installStage3(bool)));
waitRemount();
@ -243,7 +243,7 @@ bool BootloaderInstallIpod::ipodInitialize(struct ipod_t *ipod)
}
#if defined(Q_OS_WIN32)
sprintf(ipod->diskname, "\\\\.\\PhysicalDrive%i", devicename.toInt());
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
sprintf(ipod->diskname, "%s",
qPrintable(devicename.remove(QRegularExpression("s[0-9]+$"))));
#else

View file

@ -113,7 +113,7 @@ void BootloaderInstallSansa::installStage2(void)
if(sansa_add_bootloader(&sansa, buf, len) == 0) {
emit logItem(tr("Successfully installed bootloader"), LOGOK);
sansa_close(&sansa);
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
m_remountDevice = sansa.diskname;
connect(this, SIGNAL(remounted(bool)), this, SLOT(installStage3(bool)));
waitRemount();
@ -246,7 +246,7 @@ bool BootloaderInstallSansa::sansaInitialize(struct sansa_t *sansa)
}
#if defined(Q_OS_WIN32)
sprintf(sansa->diskname, "\\\\.\\PhysicalDrive%i", devicename.toInt());
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
sprintf(sansa->diskname,
"%s", qPrintable(devicename.remove(QRegularExpression("s[0-9]+$"))));
#else

View file

@ -241,7 +241,7 @@ bool EncoderLame::encode(QString input,QString output)
wavbuflen = datalength;
mp3buf = new unsigned char[mp3buflen];
wavbuf = new short int[wavbuflen];
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
// handle byte order -- the host might not be LE.
if(samplesize == 8) {
// no need to convert.

View file

@ -51,7 +51,7 @@ const static struct {
{ RbSettings::InstallManual, "install_manual", "false" },
#if defined(Q_OS_WIN32)
{ RbSettings::Tts, "tts", "sapi" },
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
{ RbSettings::Tts, "tts", "carbon" },
#else
{ RbSettings::Tts, "tts", "espeak" },

View file

@ -38,7 +38,7 @@
#endif
// Linux and Mac includes
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
#include <sys/utsname.h>
#include <unistd.h>
#include <pwd.h>
@ -51,7 +51,7 @@
#endif
// Mac includes
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
@ -145,7 +145,7 @@ QString System::userName(void)
return QString::fromWCharArray(userbuf);
#endif
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
struct passwd *user;
user = getpwuid(geteuid());
return QString(user->pw_name);
@ -176,12 +176,12 @@ QString System::osVersionString(void)
result += QString("<br/>CPU: %1, %2 processor(s)").arg(sysinfo.dwProcessorType)
.arg(sysinfo.dwNumberOfProcessors);
#endif
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
struct utsname u;
int ret;
ret = uname(&u);
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
SInt32 cores;
Gestalt(gestaltCountOfCPUs, &cores);
#else
@ -195,7 +195,7 @@ QString System::osVersionString(void)
else {
result = QString("(Error when retrieving system information)");
}
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
SInt32 major;
SInt32 minor;
SInt32 bugfix;
@ -282,7 +282,7 @@ QMultiMap<uint32_t, QString> System::listUsbDevices(void)
libusb_exit(nullptr);
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
kern_return_t result = KERN_FAILURE;
CFMutableDictionaryRef usb_matching_dictionary;
io_iterator_t usb_iterator = IO_OBJECT_NULL;
@ -469,7 +469,7 @@ QUrl System::systemProxy(void)
return QUrl("http://" + QString::fromWCharArray(proxyval));
else
return QUrl("");
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
CFDictionaryRef dictref;
CFStringRef stringref;

View file

@ -29,7 +29,7 @@
#include "ttsflite.h"
#include "ttsmimic.h"
#include "ttsswift.h"
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
#include "ttscarbon.h"
#endif
@ -60,7 +60,7 @@ void TTSBase::initTTSList()
#if defined(Q_OS_LINUX)
ttsList["festival"] = tr("Festival TTS Engine");
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
ttsList["carbon"] = tr("OS X System Engine");
#endif
}
@ -82,7 +82,7 @@ TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName)
if (ttsName == "festival")
tts = new TTSFestival(parent);
else
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
if(ttsName == "carbon")
tts = new TTSCarbon(parent);
else

View file

@ -32,16 +32,16 @@
#include <cstdlib>
#include <stdio.h>
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
#include <sys/statvfs.h>
#endif
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
#include <stdio.h>
#endif
#if defined(Q_OS_LINUX)
#include <mntent.h>
#endif
#if defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
@ -54,7 +54,7 @@
#include <winioctl.h>
#include <tlhelp32.h>
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
@ -150,7 +150,7 @@ QString Utils::filesystemType(QString path)
endmntent(mn);
#endif
#if defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
int num;
struct statfs *mntinf;
@ -188,7 +188,7 @@ QString Utils::filesystemName(QString path)
name = QString::fromWCharArray(volname);
}
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
// BSD label does not include folder.
QString bsd = Utils::resolveDevicename(path).remove("/dev/");
if(bsd.isEmpty()) {
@ -263,7 +263,7 @@ qulonglong Utils::filesystemTotal(QString path)
qulonglong Utils::filesystemSize(QString path, enum Utils::Size type)
{
qulonglong size = 0;
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS)
// the usage of statfs() is deprecated by the LSB so use statvfs().
struct statvfs fs;
int ret;
@ -316,7 +316,7 @@ qulonglong Utils::filesystemSize(QString path, enum Utils::Size type)
QString Utils::findExecutable(QString name)
{
//try autodetect tts
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if defined(Q_OS_LINUX) || defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
QStringList path = QString(getenv("PATH")).split(":", Qt::SkipEmptyParts);
#elif defined(Q_OS_WIN)
QStringList path = QString(getenv("PATH")).split(";", Qt::SkipEmptyParts);
@ -507,7 +507,7 @@ QString Utils::resolveDevicename(QString path)
#endif
#if defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
int num;
struct statfs *mntinf;
@ -591,7 +591,7 @@ QString Utils::resolveMountPoint(QString device)
#endif
#if defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#if defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
int num;
struct statfs *mntinf;
@ -664,7 +664,7 @@ QStringList Utils::mountpoints(enum MountpointsFilter type)
}
}
#elif defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
#elif defined(Q_OS_MACOS) || defined(Q_OS_OPENBSD)
supported << "vfat" << "msdos" << "hfs";
int num;
struct statfs *mntinf;
@ -747,7 +747,7 @@ QMap<QString, QList<int> > Utils::findRunningProcess(QStringList names)
} while(result);
CloseHandle(hdl);
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
ProcessSerialNumber psn = { 0, kNoProcess };
OSErr err;
do {
@ -904,7 +904,7 @@ QList<int> Utils::suspendProcess(QList<int> pidlist, bool suspend)
CloseHandle(hToken);
}
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
int signal = suspend ? SIGSTOP : SIGCONT;
for(int i = 0; i < pidlist.size(); i++) {
pid_t pid = pidlist[i];
@ -981,7 +981,7 @@ bool Utils::ejectDevice(QString device)
return success;
#endif
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
// FIXME: FSUnmountVolumeSync is deprecated starting with 10.8.
// Use DADiskUnmount / DiskArbitration framework eventually.
// BSD label does not include folder.

View file

@ -89,7 +89,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
QIcon windowIcon(":/icons/rockbox-clef.svg");
this->setWindowIcon(windowIcon);
ui.logoLabel->load(QLatin1String(":/icons/rockbox-logo.svg"));
#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
// don't translate menu entries that are handled specially on OS X
// (Configure, Quit). Qt handles them for us if they use english string.
ui.action_Configure->setText("Configure");
@ -111,7 +111,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
}
#endif
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACX)
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS)
/* eject funtionality is not available on Linux right now. */
ui.buttonEject->setEnabled(false);
#endif
@ -631,7 +631,7 @@ void RbUtilQt::checkUpdate(void)
url += "win32/";
#elif defined(Q_OS_LINUX)
url += "linux/";
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
url += "macosx/";
#endif
@ -698,7 +698,7 @@ void RbUtilQt::downloadUpdateDone(QNetworkReply::NetworkError error)
url += "win32/";
#elif defined(Q_OS_LINUX)
url += "linux/";
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
url += "macosx/";
#endif
url += foundVersion;