diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d1b7c6aac1..2fe98c57b9 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -54,7 +54,7 @@ priority must-knows that fit in Copilot's chat context window. - C++20, Qt6, no `QSettings`, no naked `new`/`delete`, no `goto`, braces on all control flow. -- Platform guards prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX`. +- Platform guards prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX`. - For new files: classes `PascalCase`, methods `camelCase`, member vars `m_camelCase`, constants `kPascalCase`. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cca07bd3d..20a96a3cc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -356,7 +356,7 @@ jobs: # Cross-platform build check — runs on every PR (no path gating). # # History: previously gated by a `check-paths` job on a hand-maintained - # allow-list of files known to carry `#ifdef Q_OS_WIN` / `Q_OS_MAC` + # allow-list of files known to carry `#ifdef Q_OS_WIN` / `Q_OS_MACOS` # branches (CMakeLists, third_party/, workflows, MainWindow, # AudioEngine). The allow-list was a chronic leaker — every time a # new platform-guarded path got added to a different file, the gap @@ -876,7 +876,7 @@ jobs: key: sccache-windows-${{ github.run_id }} # macOS build check — runs on every PR (no path gating), same rationale - # as check-windows above. Catches Q_OS_MAC / CoreAudio / Cocoa-bridge + # as check-windows above. Catches Q_OS_MACOS / CoreAudio / Cocoa-bridge # breakage that Linux clang misses, which is otherwise only discovered # at release tag time by macos-dmg.yml. Build-only (no code signing, # no DMG, no notarization — those stay in macos-dmg.yml on tag push). diff --git a/AGENTS.md b/AGENTS.md index 235f789247..2e80ec7a53 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -199,7 +199,7 @@ contributors. - **Braces on all control flow** — even single-line `if`/`else`/`for`/`while` - **`auto` sparingly** — use explicit types unless the type is obvious from context (e.g. `auto* ptr = new Foo` is fine, `auto x = foo()` is not) - **Naming**: classes `PascalCase`, methods/variables `camelCase`, constants `kPascalCase`, member variables `m_camelCase` -- **Platform guards**: prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX` for new code. Existing `_WIN32`/`__APPLE__` guards can be migrated opportunistically — don't do a blanket rewrite. +- **Platform guards**: prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX` for new code. Existing `_WIN32`/`__APPLE__` guards can be migrated opportunistically — don't do a blanket rewrite. - **Don't remove code you didn't add** — if rebasing, ensure upstream changes are preserved. Review the diff before submitting. - **Atomic parameters for cross-thread DSP** — main thread writes via `std::atomic`, audio thread reads. Never hold a mutex in the audio callback for parameter updates. - **Error handling**: log with `qCWarning(lcCategory)`, don't throw exceptions diff --git a/GEMINI.md b/GEMINI.md index a8a8a55cd5..708340f309 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -54,7 +54,7 @@ the must-knows that fit in Gemini's chat context efficiently. - C++20, Qt6, no `QSettings`, no naked `new`/`delete`, no `goto`, braces on all control flow. -- Platform guards prefer `Q_OS_WIN` / `Q_OS_MAC` / `Q_OS_LINUX`. +- Platform guards prefer `Q_OS_WIN` / `Q_OS_MACOS` / `Q_OS_LINUX`. - Naming: classes `PascalCase`, methods `camelCase`, member vars `m_camelCase`, constants `kPascalCase`. diff --git a/src/aetherd/main.cpp b/src/aetherd/main.cpp index 2ee572f231..b61151f498 100644 --- a/src/aetherd/main.cpp +++ b/src/aetherd/main.cpp @@ -15,7 +15,7 @@ int main(int argc, char* argv[]) { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // QtKeychain's Apple backend delivers completions on the native main // dispatch queue. Qt's default QCoreApplication UNIX dispatcher does not // service that queue. Select CoreFoundation only for credential runs; @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) } #endif QCoreApplication app(argc, argv); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (credentialDispatcher) { if (hadDispatcherSetting) { qputenv("QT_EVENT_DISPATCHER_CORE_FOUNDATION", dispatcherSetting); diff --git a/src/core/AppSettings.cpp b/src/core/AppSettings.cpp index dbba7d0d3c..7f086ee848 100644 --- a/src/core/AppSettings.cpp +++ b/src/core/AppSettings.cpp @@ -171,7 +171,7 @@ void AppSettings::migrateSettingsPath() return; // already at the correct location } -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) // On Windows and macOS, Qt 6's ConfigLocation resolves to AppConfigLocation // (%LOCALAPPDATA%/AetherSDR/AetherSDR on Windows, // ~/Library/Preferences/AetherSDR/AetherSDR on macOS), so appending diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index 63acfff042..ae3cb24146 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -56,7 +56,7 @@ #include "Resampler.h" #include "TxVoiceProcessor.h" -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include #include #endif @@ -404,7 +404,7 @@ void logAudioOpenFailure(const QString& path, AudioSummaryLogger::logOpenFailure(summary); } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS AudioObjectPropertyAddress macAudioAddress(AudioObjectPropertySelector selector, AudioObjectPropertyScope scope = kAudioObjectPropertyScopeGlobal) { @@ -2889,7 +2889,7 @@ QJsonArray AudioEngine::audioEndpointDiagnostics() const endpoints.append(rx); const bool txRunning = m_audioSource != nullptr; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const bool txDeviceOpen = m_micBuffer && m_micBuffer->isOpen(); #else const bool txDeviceOpen = !m_micDevice.isNull() && m_micDevice->isOpen(); @@ -4181,7 +4181,7 @@ bool AudioEngine::openRxSinkDevice(int producerRate) } } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (!m_allowBluetoothTelephonyOutput.load()) { // Only override devices that look like Bluetooth telephony routes. // Telephony-only (HFP/SCO) routes cap out at 8-16 kHz and cannot @@ -8677,7 +8677,7 @@ TxCaptureHealthTracker::CaptureState AudioEngine::txCaptureState(QAudio::State s qint64 AudioEngine::txCaptureBufferedBytes() const { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS return m_micBuffer ? m_micBuffer->size() : 0; #else return m_micDevice ? m_micDevice->bytesAvailable() : 0; @@ -8931,7 +8931,7 @@ bool AudioEngine::startTxStream(const QHostAddress& radioAddress, quint16 radioP #else bool txBluetoothHfp = false; int txPreferredOverride = 0; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // CoreAudio-HAL detection the factory can't derive from QAudioDevice: if this // is a Bluetooth-HFP capture route, put its native low rate first (#2615). if (const auto nativeRate = macBluetoothNativeInputRate(dev)) { @@ -9022,7 +9022,7 @@ bool AudioEngine::startTxStream(const QHostAddress& radioAddress, quint16 radioP << (m_txInputRate != TxVoiceProcessor::kDspRate) << "RADE resample to 24k:" << m_radeTxNeedsResample; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // macOS: QAudioSource pull mode broken — use push mode with QBuffer const quint64 txLifecycleGeneration = ++m_txLifecycleGeneration; m_micBuffer = new QBuffer(this); @@ -9274,7 +9274,7 @@ void AudioEngine::stopTxStream() logTxCaptureHealthSummary(QStringLiteral("source lifecycle ended"), false); } ++m_txLifecycleGeneration; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS QTimer* pollTimer = m_txPollTimer; m_txPollTimer = nullptr; QBuffer* micBuffer = m_micBuffer; @@ -9284,7 +9284,7 @@ void AudioEngine::stopTxStream() m_audioSource = nullptr; m_micDevice = nullptr; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (pollTimer) { pollTimer->stop(); delete pollTimer; @@ -9299,7 +9299,7 @@ void AudioEngine::stopTxStream() } delete audioSource; } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (micBuffer) { delete micBuffer; } @@ -9466,7 +9466,7 @@ void AudioEngine::onTxAudioReady() } // Capture must keep being consumed while TCI owns TX audio, on every // platform — all three backends accumulate, just in different memory. -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Push mode: QAudioSource writes into m_micBuffer, which only the // unsuppressed path below clears. Left alone it grows for the whole TCI // session (~192 KB/s at 48 kHz stereo Int16) — the same multi-GB @@ -9505,7 +9505,7 @@ void AudioEngine::onTxAudioReady() } return; } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (!m_micBuffer || !m_audioSource) return; if (m_audioSource->state() == QAudio::StoppedState) return; if (!m_micBuffer->isOpen()) return; @@ -9976,7 +9976,7 @@ void AudioEngine::setInputDevice(const QAudioDevice& dev, AudioDeviceSelection s emit inputDeviceChanged(); } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS void AudioEngine::setAllowBluetoothTelephonyOutput(bool on) { const bool changed = (m_allowBluetoothTelephonyOutput.exchange(on) != on); diff --git a/src/core/AudioEngine.h b/src/core/AudioEngine.h index 4adce40545..80c3bab175 100644 --- a/src/core/AudioEngine.h +++ b/src/core/AudioEngine.h @@ -677,7 +677,7 @@ class AudioEngine : public QObject { AudioDeviceSelection selection = AudioDeviceSelection::OperatorChoice); void setInputDevice(const QAudioDevice& dev, AudioDeviceSelection selection = AudioDeviceSelection::OperatorChoice); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS void setAllowBluetoothTelephonyOutput(bool on); #endif QAudioDevice outputDevice() const { return m_outputDevice; } @@ -1125,7 +1125,7 @@ private slots: QUdpSocket m_txSocket; QAudioSource* m_audioSource{nullptr}; QPointer m_micDevice; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS QTimer* m_txPollTimer{nullptr}; QBuffer* m_micBuffer{nullptr}; #endif @@ -1173,7 +1173,7 @@ private slots: // Channel count of the stage-0 open, so the ladder stays stable across // reopens even though fmt.channelCount() changes underneath it. int m_txSilentOpenInitialChannels{2}; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS std::atomic m_allowBluetoothTelephonyOutput{false}; #endif std::atomic m_daxTxUseRadioRoute{false}; // false = low-latency route (dax=0) diff --git a/src/core/AudioFormatNegotiator.cpp b/src/core/AudioFormatNegotiator.cpp index 6a44897fb0..523df19119 100644 --- a/src/core/AudioFormatNegotiator.cpp +++ b/src/core/AudioFormatNegotiator.cpp @@ -295,7 +295,7 @@ TargetOs hostTargetOs() { #if defined(Q_OS_WIN) return TargetOs::Windows; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) return TargetOs::MacOS; #else return TargetOs::Linux; diff --git a/src/core/AutomationServer.cpp b/src/core/AutomationServer.cpp index c884a45c8f..650ab00341 100644 --- a/src/core/AutomationServer.cpp +++ b/src/core/AutomationServer.cpp @@ -2013,7 +2013,7 @@ QJsonObject dspEngineSnapshot(const AudioEngine* a) false}, #endif {"MNR", a->mnrEnabled(), -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS true}, #else false}, diff --git a/src/core/CatPort.cpp b/src/core/CatPort.cpp index 0ffa02dc20..6e78c48dad 100644 --- a/src/core/CatPort.cpp +++ b/src/core/CatPort.cpp @@ -19,7 +19,7 @@ #include #include #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include #else #include diff --git a/src/core/DaxTxPolicy.h b/src/core/DaxTxPolicy.h index ea23008af7..3dc3e1d8b5 100644 --- a/src/core/DaxTxPolicy.h +++ b/src/core/DaxTxPolicy.h @@ -82,7 +82,7 @@ inline DaxTxPlatform currentDaxTxPlatform() { #if defined(Q_OS_WIN) return DaxTxPlatform::Windows; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) return DaxTxPlatform::MacOS; #elif defined(Q_OS_LINUX) return DaxTxPlatform::Linux; @@ -93,7 +93,7 @@ inline DaxTxPlatform currentDaxTxPlatform() inline bool currentBuildHasHostedDax() { -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) return true; #else return false; @@ -104,7 +104,7 @@ inline DaxTxMode currentDaxTxMode() { #if defined(Q_OS_WIN) return DaxTxMode::ExternalDax2; -#elif defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#elif defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) return DaxTxMode::HostedDax; #else return DaxTxMode::None; diff --git a/src/core/FreeDvClient.cpp b/src/core/FreeDvClient.cpp index 60968cb3a1..f83c93998b 100644 --- a/src/core/FreeDvClient.cpp +++ b/src/core/FreeDvClient.cpp @@ -184,7 +184,7 @@ void FreeDvClient::handleEngineIO(const QString& raw) auth["rx_only"] = false; #if defined(Q_OS_WIN) auth["os"] = QString("windows"); -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) auth["os"] = QString("macos"); #else auth["os"] = QString("linux"); diff --git a/src/core/MacMicPermission.h b/src/core/MacMicPermission.h index d7e275d934..3e56419338 100644 --- a/src/core/MacMicPermission.h +++ b/src/core/MacMicPermission.h @@ -3,7 +3,7 @@ // Request microphone permission on macOS at app startup. // Shows the system permission dialog on first launch. // No-op on non-macOS platforms. -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS void requestMicrophonePermission(); #else inline void requestMicrophonePermission() {} diff --git a/src/core/MemoryTelemetry.cpp b/src/core/MemoryTelemetry.cpp index 27bcb54356..14da0f058b 100644 --- a/src/core/MemoryTelemetry.cpp +++ b/src/core/MemoryTelemetry.cpp @@ -18,7 +18,7 @@ #endif #include #include -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) #include #include #include @@ -89,7 +89,7 @@ ProcessMemorySnapshot ProcessMemorySnapshot::capture() if (GetProcessHandleCount(GetCurrentProcess(), &handles)) { snapshot.handleCount = static_cast(handles); } -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) task_vm_info_data_t info{}; mach_msg_type_number_t count = TASK_VM_INFO_COUNT; if (task_info(mach_task_self(), TASK_VM_INFO, diff --git a/src/core/SleepInhibitor.cpp b/src/core/SleepInhibitor.cpp index 693306bf21..bb6752bfcd 100644 --- a/src/core/SleepInhibitor.cpp +++ b/src/core/SleepInhibitor.cpp @@ -1,7 +1,7 @@ #include "SleepInhibitor.h" #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include #endif @@ -67,7 +67,7 @@ void SleepInhibitor::acquire(const QString& reason) if (m_held) return; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS CFStringRef cfReason = reason.toCFString(); IOReturn ret = IOPMAssertionCreateWithName( kIOPMAssertionTypeNoIdleSleep, @@ -155,7 +155,7 @@ void SleepInhibitor::release() if (!m_held) return; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS IOPMAssertionRelease(m_assertionId); m_assertionId = 0; qDebug() << "SleepInhibitor: released (macOS)"; diff --git a/src/core/SleepInhibitor.h b/src/core/SleepInhibitor.h index 5c4a5044bd..50185fd909 100644 --- a/src/core/SleepInhibitor.h +++ b/src/core/SleepInhibitor.h @@ -55,7 +55,7 @@ class SleepInhibitor { private: bool m_held{false}; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS uint32_t m_assertionId{0}; #endif #if defined(Q_OS_LINUX) && defined(HAVE_DBUS) diff --git a/src/core/SystemInfo.cpp b/src/core/SystemInfo.cpp index 63eecc8737..b2054371a9 100644 --- a/src/core/SystemInfo.cpp +++ b/src/core/SystemInfo.cpp @@ -24,7 +24,7 @@ extern "C" __declspec(dllimport) HRESULT WINAPI GetThreadDescription(HANDLE hThread, PWSTR* ppszThreadDescription); #endif -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) #include #include #include @@ -41,7 +41,7 @@ namespace AetherSDR { namespace { -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) // thread_extended_info's pth_run_state, in the shared vocabulary. The constants // are TH_STATE_* from ; anything outside that set is Unknown // rather than mapped to whichever neighbour looks closest. @@ -130,7 +130,7 @@ QVector SystemInfo::enumerateThreads() { QVector result; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) MachThreadArray threads; if (!threads.acquire()) { return result; diff --git a/src/core/UlanziDialBackend.h b/src/core/UlanziDialBackend.h index d1d7616d8a..508b4e3f3e 100644 --- a/src/core/UlanziDialBackend.h +++ b/src/core/UlanziDialBackend.h @@ -14,7 +14,7 @@ #elif defined(Q_OS_WIN) && defined(HAVE_HIDAPI) #include "core/UlanziDialWindowsManager.h" namespace AetherSDR { using UlanziDialBackend = UlanziDialWindowsManager; } -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) #include "core/UlanziDialMacOSManager.h" namespace AetherSDR { using UlanziDialBackend = UlanziDialMacOSManager; } #else diff --git a/src/core/UlanziDialMacOSManager.cpp b/src/core/UlanziDialMacOSManager.cpp index 8b55fc5008..f39530f101 100644 --- a/src/core/UlanziDialMacOSManager.cpp +++ b/src/core/UlanziDialMacOSManager.cpp @@ -1,5 +1,5 @@ #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include "UlanziDialMacOSManager.h" #include "core/LogManager.h" @@ -769,4 +769,4 @@ void UlanziDialMacOSManager::emitKeyTransition(int linuxKey, int value) } // namespace AetherSDR -#endif // Q_OS_MAC +#endif // Q_OS_MACOS diff --git a/src/core/UlanziDialMacOSManager.h b/src/core/UlanziDialMacOSManager.h index 1825bc7dd2..cd621f9cf2 100644 --- a/src/core/UlanziDialMacOSManager.h +++ b/src/core/UlanziDialMacOSManager.h @@ -1,6 +1,6 @@ #pragma once #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include "core/UlanziChordDecoder.h" @@ -97,4 +97,4 @@ class UlanziDialMacOSManager : public QObject { } // namespace AetherSDR -#endif // Q_OS_MAC +#endif // Q_OS_MACOS diff --git a/src/core/control/LocalCredentialHandshake.cpp b/src/core/control/LocalCredentialHandshake.cpp index 53b3c28c1e..3cbba4005a 100644 --- a/src/core/control/LocalCredentialHandshake.cpp +++ b/src/core/control/LocalCredentialHandshake.cpp @@ -65,7 +65,7 @@ bool localServerIsCurrentUser(qintptr descriptor) &owner, nullptr, nullptr, nullptr, &security); const auto freeSecurity = qScopeGuard([security] { if (security) { LocalFree(security); } }); return result == ERROR_SUCCESS && owner && IsValidSid(owner) && EqualSid(currentSid, owner); -#elif defined(Q_OS_MAC) || defined(Q_OS_FREEBSD) +#elif defined(Q_OS_MACOS) || defined(Q_OS_FREEBSD) if (descriptor < 0 || descriptor > std::numeric_limits::max()) { return false; } diff --git a/src/gui/AetherDspWidget.cpp b/src/gui/AetherDspWidget.cpp index 2192822133..21232793e4 100644 --- a/src/gui/AetherDspWidget.cpp +++ b/src/gui/AetherDspWidget.cpp @@ -265,7 +265,7 @@ AetherDspWidget::AetherDspWidget(AudioEngine* audio, QWidget* parent) // MNR (MMSE-Wiener spectral NR) is implemented only on macOS — // dim the selector on Windows / Linux so users can see it exists // but can't enable a path the engine has no backend for. -#ifndef Q_OS_MAC +#ifndef Q_OS_MACOS if (i == MNR) { b->setEnabled(false); b->setToolTip("MNR is only available on macOS."); diff --git a/src/gui/FramelessMoveHelper.h b/src/gui/FramelessMoveHelper.h index 24d294750d..846a2100d5 100644 --- a/src/gui/FramelessMoveHelper.h +++ b/src/gui/FramelessMoveHelper.h @@ -61,7 +61,7 @@ inline bool start(QWidget* handle, QMouseEvent* ev) return false; } -#ifndef Q_OS_MAC +#ifndef Q_OS_MACOS if (!systemMoveResizeUnreliable(window)) { if (QWindow* windowHandle = window->windowHandle()) { if (windowHandle->startSystemMove()) { diff --git a/src/gui/MacCursorCompat.h b/src/gui/MacCursorCompat.h index 964d69f69d..5788324dfb 100644 --- a/src/gui/MacCursorCompat.h +++ b/src/gui/MacCursorCompat.h @@ -9,7 +9,7 @@ namespace AetherSDR { // QImage::toCGImage(), so substitute the native open-hand cursor. inline Qt::CursorShape macSafeCursorShape(Qt::CursorShape shape) { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (shape == Qt::SizeAllCursor) { return Qt::OpenHandCursor; } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 054e2bd9d5..315cf4cc56 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -272,7 +272,7 @@ #include "core/backends/sim/SimBackend.h" // dynamic_cast for demo noise controls #include "workspace/WorkspaceController.h" // prepareShutdown (phase 7 canvas windows) #include "workspace/WorkspaceWindow.h" // shutdown sweep of hidden windows (M1) -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) #include "core/VirtualAudioBridge.h" #include #elif defined(HAVE_PIPEWIRE) @@ -290,7 +290,7 @@ #include #else #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include #include #include @@ -4213,7 +4213,7 @@ void MainWindow::closeEvent(QCloseEvent* event) { m_pendingDisplayWrites.flush(); ShutdownTrace closeEventTrace("main_window.close_event"); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Shared Ulanzi access temporarily remaps only the dial's system key // events. Restore that mapping while the macOS HID event system and Qt // event loop are still live; ~MainWindow runs only after app.exec(). @@ -6288,7 +6288,7 @@ void MainWindow::buildUI() m_memLabel->setAlignment(Qt::AlignCenter); #if defined(Q_OS_WIN) m_memLabel->setToolTip("AetherSDR process working set (matches Task Manager)"); -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) m_memLabel->setToolTip("AetherSDR process physical footprint (matches Activity Monitor)"); #else m_memLabel->setToolTip("AetherSDR process resident set (VmRSS from /proc/self/status)"); @@ -6359,7 +6359,7 @@ void MainWindow::buildUI() if (GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) { memBytes = pmc.WorkingSetSize; } -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) task_vm_info_data_t info{}; mach_msg_type_number_t count = TASK_VM_INFO_COUNT; if (task_info(mach_task_self(), TASK_VM_INFO, @@ -6946,7 +6946,7 @@ void MainWindow::onConnectionStateChanged(bool connected) // Apply saved display settings after panadapter is created m_displaySettingsPushed = false; -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) // Delay DAX bridge start until RadioModel's SmartConnect sequence // is fully complete (streams created, UDP bound, slices discovered). // Auto-start DAX bridge if enabled in settings. @@ -7181,7 +7181,7 @@ void MainWindow::onConnectionStateChanged(bool connected) } updateTMate2Status(); #endif -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) stopDax(); #endif audioStopRx(); @@ -9735,7 +9735,7 @@ void MainWindow::enableNr2WithWisdom() // when the operator clicks back to the main UI. dlg->setWindowFlag(Qt::Tool, true); dlg->setAttribute(Qt::WA_ShowWithoutActivating, true); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Qt maps Qt::Tool to an NSPanel, which AppKit hides whenever the // application deactivates — fatal for a dialog that is modeless by // design and lives for minutes. This attribute is what turns that @@ -9997,7 +9997,7 @@ void MainWindow::applyUiScale(int pct) QString("UI scale changed to %1%. Restart AetherSDR now to apply?").arg(pct), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (answer == QMessageBox::Yes) { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // On macOS, relaunch via 'open -n' so the .app bundle is activated through // Launch Services — direct binary exec bypasses the bundle, causing dock // duplication and incorrect activation policy in notarized builds. diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 49c742fde7..af8451cdb7 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -195,7 +195,7 @@ class UlanziDialMapperDialog; class EvdevEncoderManager; #elif defined(Q_OS_WIN) && defined(HAVE_HIDAPI) class UlanziDialWindowsManager; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) class UlanziDialMacOSManager; #else class UlanziDialBackend; @@ -205,7 +205,7 @@ class DvkPanel; #ifdef HAVE_RADE class RADEEngine; #endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) class VirtualAudioBridge; using DaxBridge = VirtualAudioBridge; #elif defined(HAVE_PIPEWIRE) @@ -1526,7 +1526,7 @@ private slots: EvdevEncoderManager* m_dialBackend{nullptr}; #elif defined(Q_OS_WIN) && defined(HAVE_HIDAPI) UlanziDialWindowsManager* m_dialBackend{nullptr}; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) UlanziDialMacOSManager* m_dialBackend{nullptr}; #else UlanziDialBackend* m_dialBackend{nullptr}; @@ -2245,7 +2245,7 @@ private slots: // mode change) toggled it. void reflectWfmButtons(bool on, int sliceId); -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) DaxBridge* m_daxBridge{nullptr}; QString m_savedMicSelection; // restore on stopDax bool startDax(); diff --git a/src/gui/MainWindowHelpers.cpp b/src/gui/MainWindowHelpers.cpp index a75bdf0b58..203dd5b0ca 100644 --- a/src/gui/MainWindowHelpers.cpp +++ b/src/gui/MainWindowHelpers.cpp @@ -41,7 +41,7 @@ bool requestSlicePanCenter(RadioModel& model, int sliceId, double centerMhz) bool macDaxDriverInstalled() { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QFileInfo driverBundle("/Library/Audio/Plug-Ins/HAL/AetherSDRDAX.driver"); if (!driverBundle.exists() || !driverBundle.isDir()) return false; diff --git a/src/gui/MainWindowHelpers.h b/src/gui/MainWindowHelpers.h index c5f56b3c45..c355e92d26 100644 --- a/src/gui/MainWindowHelpers.h +++ b/src/gui/MainWindowHelpers.h @@ -37,7 +37,7 @@ bool requestSlicePanCenter(RadioModel& model, int sliceId, double centerMhz); // ─── Platform checks ───────────────────────────────────────────────────────── // True when the macOS DAX HAL driver bundle is installed (always true on -// non-mac platforms; the caller is itself #ifdef Q_OS_MAC-gated). +// non-mac platforms; the caller is itself #ifdef Q_OS_MACOS-gated). bool macDaxDriverInstalled(); // ─── Band admissibility ────────────────────────────────────────────────────── diff --git a/src/gui/MainWindow_Controllers.cpp b/src/gui/MainWindow_Controllers.cpp index 589c01cedb..29c1d2d87e 100644 --- a/src/gui/MainWindow_Controllers.cpp +++ b/src/gui/MainWindow_Controllers.cpp @@ -3161,7 +3161,7 @@ void MainWindow::wireExternalControllers() m_dialBackend = new UlanziDialBackend; const auto dialController = TxController::forNativeDevice(&m_radioModel, m_dialBackend); fenceDeviceDisconnect(m_dialBackend, &UlanziDialBackend::connectionChanged, this, dialController); -#ifndef Q_OS_MAC +#ifndef Q_OS_MACOS // macOS keeps the backend on the main thread: IOHIDManager schedules // its callbacks on a CFRunLoop, and only the main thread has one // integrated with Qt's event loop on macOS. Linux + Windows diff --git a/src/gui/MainWindow_DigitalModes.cpp b/src/gui/MainWindow_DigitalModes.cpp index 3e6ef0b80d..b1fe8ace06 100644 --- a/src/gui/MainWindow_DigitalModes.cpp +++ b/src/gui/MainWindow_DigitalModes.cpp @@ -27,7 +27,7 @@ #include "RadeApplet.h" #include "core/RADEEngine.h" #endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) #include "core/VirtualAudioBridge.h" #elif defined(HAVE_PIPEWIRE) #include "core/PipeWireAudioBridge.h" @@ -1199,7 +1199,7 @@ void MainWindow::showFreeDvReporter() } #endif -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) bool MainWindow::startDax() { if (m_daxBridge) return true; @@ -1215,7 +1215,7 @@ bool MainWindow::startDax() return false; } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Only start if the macOS HAL driver bundle is installed. if (!macDaxDriverInstalled()) { qWarning() << "MainWindow: DAX HAL plugin not installed"; diff --git a/src/gui/MainWindow_Menus.cpp b/src/gui/MainWindow_Menus.cpp index ebb7023c46..594883de86 100644 --- a/src/gui/MainWindow_Menus.cpp +++ b/src/gui/MainWindow_Menus.cpp @@ -197,7 +197,7 @@ void populateWindowMenu(QMenu* menu, QWidget* primaryWindow, } }); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QString maximizeLabel = QObject::tr("Zoom"); #else const QString maximizeLabel = target && target->isMaximized() @@ -973,7 +973,7 @@ void MainWindow::buildMenuBar() #endif }); -#if !defined(Q_OS_MAC) && !defined(HAVE_PIPEWIRE) +#if !defined(Q_OS_MACOS) && !defined(HAVE_PIPEWIRE) // DAX audio bridge requires macOS CoreAudio or Linux with PipeWire. // Force off and omit the menu entry on platforms without a bridge (#1556). { diff --git a/src/gui/MainWindow_Session.cpp b/src/gui/MainWindow_Session.cpp index 2d114434cb..a0b89aa899 100644 --- a/src/gui/MainWindow_Session.cpp +++ b/src/gui/MainWindow_Session.cpp @@ -29,7 +29,7 @@ #include "core/CwxLocalKeyer.h" #include "core/IambicKeyer.h" #include "core/PerfTelemetry.h" -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) #include "core/UlanziDialMacOSManager.h" #include "core/VirtualAudioBridge.h" #elif defined(HAVE_PIPEWIRE) @@ -1363,7 +1363,7 @@ void MainWindow::wireRadioModel() // Start/stop PC audio TX when mic_selection changes connect(&m_radioModel.transmitModel(), &TransmitModel::micStateChanged, this, [this]() { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const bool allowBluetoothTelephonyOutput = m_radioModel.transmitModel().micSelection() == "PC"; QMetaObject::invokeMethod(m_audio, [this, allowBluetoothTelephonyOutput]() { @@ -1415,7 +1415,7 @@ void MainWindow::wireRadioModel() } } }); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const bool allowBluetoothTelephonyOutput = m_radioModel.transmitModel().micSelection() == "PC"; QMetaObject::invokeMethod(m_audio, [this, allowBluetoothTelephonyOutput]() { @@ -1634,7 +1634,7 @@ void MainWindow::wireRadioModel() m_audio->setTransmitting(tx); #endif } -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) if (m_daxBridge) m_daxBridge->setTransmitting(tx); #endif @@ -1665,7 +1665,7 @@ void MainWindow::wireRadioModel() m_audio->setTransmitting(false); #endif } -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) if (m_daxBridge) m_daxBridge->setTransmitting(false); #endif @@ -2382,7 +2382,7 @@ void MainWindow::wirePanLifecycle() } }); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS auto repushPanDimensions = [this]() { QTimer::singleShot(200, this, [this]() { if (m_shuttingDown || !m_panStack) { @@ -2817,7 +2817,7 @@ void MainWindow::wireDaxIq() &m_radioModel.daxIqModel(), &DaxIqModel::setSampleRate); } -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) // DAX enable button in DaxApplet → start/stop DAX bridge connect(m_appletPanel->daxApplet(), &DaxApplet::daxToggled, this, [this](bool on) { @@ -3011,7 +3011,7 @@ bool MainWindow::startAutomationBridge(const QString& sockName) QThread* backendThread = m_dialBackend->thread(); bool queued = false; if (lifecycle) { -#if !defined(Q_OS_LINUX) && !defined(Q_OS_MAC) && !(defined(Q_OS_WIN) && defined(HAVE_HIDAPI)) +#if !defined(Q_OS_LINUX) && !defined(Q_OS_MACOS) && !(defined(Q_OS_WIN) && defined(HAVE_HIDAPI)) return QJsonObject{ {QStringLiteral("ok"), false}, {QStringLiteral("supported"), false}, @@ -3045,7 +3045,7 @@ bool MainWindow::startAutomationBridge(const QString& sockName) // queued means accepted for delivery, not completed. A later thread // shutdown can still prevent delivery; do not report device state from // before an asynchronous lifecycle request as its outcome. -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS QJsonObject snapshot = m_dialBackend->diagnostics(); snapshot[QStringLiteral("operation")] = diagnostic; snapshot[QStringLiteral("enabled")] = dialEnabled(); diff --git a/src/gui/MainWindow_Shortcuts.cpp b/src/gui/MainWindow_Shortcuts.cpp index 036307173f..15d0d413dd 100644 --- a/src/gui/MainWindow_Shortcuts.cpp +++ b/src/gui/MainWindow_Shortcuts.cpp @@ -1667,7 +1667,7 @@ void MainWindow::registerShortcutActions() QKeySequence(Qt::Key_Minus), [this]() { zoomActivePanadapter(kPanZoomFactor); }); m_shortcutManager.registerAction("open_memories", "Open Memories Dialog", "Display", QKeySequence(Qt::Key_Slash), [this]() { showMemoryDialog(); }); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QKeySequence windowMinimizeKey(QStringLiteral("Ctrl+M")); const QKeySequence windowFullScreenKey(QStringLiteral("Ctrl+Meta+F")); #else diff --git a/src/gui/MainWindow_Wiring.cpp b/src/gui/MainWindow_Wiring.cpp index 7e796538c9..4b4bac7106 100644 --- a/src/gui/MainWindow_Wiring.cpp +++ b/src/gui/MainWindow_Wiring.cpp @@ -1894,7 +1894,7 @@ void MainWindow::onSliceAdded(SliceModel* s) // digital TX stays on the mic input (#2273). Not on Windows: SmartSDR // DAX2 owns `transmit dax`, and a `transmit set dax=0` from a mode change // parks its TX stream in Busy (#2315). -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) m_audio->setDaxTxMode(isDigital); // `transmit dax` and DAX TX streams belong to Flex's command plane. // Icom and the other typed-seam backends carry their audio through the @@ -3081,7 +3081,7 @@ void MainWindow::runProfileLoadRecoveryPass(const QString& profileType, } #endif -#if defined(Q_OS_MAC) || defined(HAVE_PIPEWIRE) +#if defined(Q_OS_MACOS) || defined(HAVE_PIPEWIRE) if (m_daxBridge) { auto* panStream = m_radioModel.panStream(); bool txSliceIsDigital = false; diff --git a/src/gui/PanadapterStack.cpp b/src/gui/PanadapterStack.cpp index da51e4d93b..e4e4b2d0e4 100644 --- a/src/gui/PanadapterStack.cpp +++ b/src/gui/PanadapterStack.cpp @@ -32,7 +32,7 @@ static void refreshAfterReparent(AetherSDR::SpectrumWidget* sw) { if (!sw) return; -#if defined(Q_OS_MAC) && defined(AETHER_GPU_SPECTRUM) +#if defined(Q_OS_MACOS) && defined(AETHER_GPU_SPECTRUM) const bool wasVisible = sw->isVisible(); sw->hide(); sw->resetGpuResources(); @@ -354,7 +354,7 @@ void PanadapterStack::equalizeSizes() void PanadapterStack::refreshAfterLayoutShift() { -#if defined(Q_OS_MAC) && defined(AETHER_GPU_SPECTRUM) +#if defined(Q_OS_MACOS) && defined(AETHER_GPU_SPECTRUM) // Re-realize each spectrum's NATIVE window, not just its GPU pipelines. // Measured on Metal: after the flip the native surface keeps its pre-flip // width (short by the panel's 260 px), so re-rendering into it — even diff --git a/src/gui/SpectrumWidget.cpp b/src/gui/SpectrumWidget.cpp index b5fde1c574..b58f03b41c 100644 --- a/src/gui/SpectrumWidget.cpp +++ b/src/gui/SpectrumWidget.cpp @@ -505,7 +505,7 @@ static FftFloorClipStats fftFloorClipStats(const QVector& bins) static Qt::CursorShape normalizedSpectrumCursorShape(Qt::CursorShape shape) { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Preserve SpectrumWidget's established vertical split appearance. if (shape == Qt::SplitVCursor) { return Qt::SizeVerCursor; @@ -962,7 +962,7 @@ QVariantMap SpectrumWidget::automationRhiSnapshot() const m[QStringLiteral("widthPx")] = width(); m[QStringLiteral("heightPx")] = height(); m[QStringLiteral("dpr")] = dpr; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS appendNativeWidgetTopology(m, *this); #endif #ifdef AETHER_GPU_SPECTRUM @@ -1940,7 +1940,7 @@ QVariantMap SpectrumWidget::traceDebugSnapshot() void SpectrumWidget::applyNativeWindowIsolationPolicy() { -#if defined(AETHER_GPU_SPECTRUM) && defined(Q_OS_MAC) +#if defined(AETHER_GPU_SPECTRUM) && defined(Q_OS_MACOS) if (nativeWindowPreferred()) { // Order matters: block ancestor promotion *before* requesting the native // window, so realizing the leaf's NSView can't drag its QWidget tree @@ -1981,7 +1981,7 @@ SpectrumWidget::SpectrumWidget(QWidget* parent) }); // Explicitly request Metal on macOS. -# ifdef Q_OS_MAC +# ifdef Q_OS_MACOS setApi(QRhiWidget::Api::Metal); // WA_NativeWindow gives this widget its own NSView; without it QRhiWidget // can't get a Metal QRhi when the parent's surface is RasterSurface (#714). @@ -2404,7 +2404,7 @@ void SpectrumWidget::prepareForShutdown() #ifdef AETHER_GPU_SPECTRUM releaseResources(); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // Drop the native child window while its parent backing store is still // alive, so any remaining platform resources are gone before QWidgetWindow // destruction runs on app exit. @@ -10057,7 +10057,7 @@ void SpectrumWidget::mousePressEvent(QMouseEvent* ev) const QPoint pos = ev->position().toPoint(); const Qt::KeyboardModifiers modifiers = ev->modifiers() | QGuiApplication::keyboardModifiers(); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const bool rateModifier = modifiers.testFlag(Qt::ControlModifier) || modifiers.testFlag(Qt::MetaModifier); const bool rateClick = rateModifier @@ -10118,7 +10118,7 @@ void SpectrumWidget::mousePressEvent(QMouseEvent* ev) ev->modifiers() | QGuiApplication::keyboardModifiers(); const bool primaryClick = ev->button() == Qt::LeftButton; const bool is3D = (m_spectrumRenderMode == SpectrumRenderMode::Mode3D); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const bool rangeDrag = modifiers.testFlag(Qt::ControlModifier) || modifiers.testFlag(Qt::MetaModifier); const bool controlClick = rangeDrag @@ -11394,7 +11394,7 @@ void SpectrumWidget::mouseMoveEvent(QMouseEvent* ev) // rejects preprocessor directives inside macro arguments. const QRect stripRect(stripX, 0, DBM_STRIP_W, specH); const bool is3D = (m_spectrumRenderMode == SpectrumRenderMode::Mode3D); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QString rangeDragTip = "Ctrl-drag or ⌘-drag — zoom span (anchor at bottom)
"; #else @@ -13172,7 +13172,7 @@ void SpectrumWidget::reportRhiFailure(const QString& reason) qCWarning(lcGui) << "SpectrumWidget: QRhi failure:" << detail; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QString messageDetail = tr("%1 Rebuild with -DAETHER_GPU_SPECTRUM=OFF.").arg(detail); #else diff --git a/src/gui/SupportDialog.cpp b/src/gui/SupportDialog.cpp index 9b3eb7d3a5..71490017d9 100644 --- a/src/gui/SupportDialog.cpp +++ b/src/gui/SupportDialog.cpp @@ -255,7 +255,7 @@ void SupportDialog::resetSettings(QWidget* parent) xmlPath + ".corrupt", AudioEngine::wisdomFilePath() }; -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS resetPaths << (QDir::homePath() + "/Library/Preferences/com.aethersdr.AetherSDR.plist"); #endif @@ -365,7 +365,7 @@ void SupportDialog::fileIssue(QWidget* parent, RadioModel* radioModel) QString version = QCoreApplication::applicationVersion(); QString qt = qVersion(); QString os; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) os = "macOS"; #elif defined(Q_OS_WIN) os = "Windows"; diff --git a/src/gui/TitleBar.cpp b/src/gui/TitleBar.cpp index 74530e1ee8..84206e2dad 100644 --- a/src/gui/TitleBar.cpp +++ b/src/gui/TitleBar.cpp @@ -706,7 +706,7 @@ void TitleBar::updateChromeLayout() } const QScopedValueRollback updating(m_updatingChromeLayout, true); QWidget* host = window(); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS mac::updateNativeTitleVisibility(host); #endif const QMargins insets = WindowChrome::contentInsets(host); @@ -761,7 +761,7 @@ QVariantMap TitleBar::barState() const if (m_captionButtons) { chrome.insert(QStringLiteral("captionButtons"), m_captionButtons->state()); } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS const QRectF nativeBounds = mac::nativeCaptionBounds(window()); chrome.insert(QStringLiteral("nativeCaptionRect"), QVariantList{nativeBounds.x(), nativeBounds.y(), nativeBounds.width(), nativeBounds.height()}); diff --git a/src/gui/WaveformWidget.cpp b/src/gui/WaveformWidget.cpp index 53f094497c..ddfcc1611d 100644 --- a/src/gui/WaveformWidget.cpp +++ b/src/gui/WaveformWidget.cpp @@ -127,7 +127,7 @@ WaveformWidget::WaveformWidget(Profile profile, QWidget* parent) "-DAETHER_GPU_SPECTRUM=OFF for the QPainter path."; }); #endif -#if defined(AETHER_GPU_SPECTRUM) && defined(Q_OS_MAC) +#if defined(AETHER_GPU_SPECTRUM) && defined(Q_OS_MACOS) // Unlike the panadapter, every waveform scope lives inside a QScrollArea. // Making that child a native NSView while deliberately keeping its // ancestors non-native disconnects the native surface from QWidget diff --git a/src/gui/WaveformsDialog.cpp b/src/gui/WaveformsDialog.cpp index a0df02c18e..2a616180be 100644 --- a/src/gui/WaveformsDialog.cpp +++ b/src/gui/WaveformsDialog.cpp @@ -1142,7 +1142,7 @@ WaveformsDialog::WaveformsDialog(RadioModel* model, QWidget* parent) m_dstarSerialLabel->setBuddy(m_dstarSerialCombo); #if defined(Q_OS_WIN) m_dstarSerialCombo->lineEdit()->setPlaceholderText(tr("COM3")); -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_MACOS) m_dstarSerialCombo->lineEdit()->setPlaceholderText(tr("/dev/cu.usbserial-*")); #else m_dstarSerialCombo->lineEdit()->setPlaceholderText(tr("/dev/ttyUSB0")); diff --git a/src/gui/WindowChrome.h b/src/gui/WindowChrome.h index eb71efc078..dd5331edd6 100644 --- a/src/gui/WindowChrome.h +++ b/src/gui/WindowChrome.h @@ -11,7 +11,7 @@ #include #include -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include "mac/NativeWindowTitle.h" #endif @@ -186,7 +186,7 @@ inline QMargins contentInsets(const QWidget* window) if (window->isFullScreen()) { return safe; } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (QGuiApplication::platformName() == QStringLiteral("cocoa")) { const QRectF controls = mac::nativeCaptionBounds(window); return QMargins(qMax(safe.left(), qCeil(controls.right())), 0, safe.right(), safe.bottom()); diff --git a/src/gui/map/MapDisplayWidget.cpp b/src/gui/map/MapDisplayWidget.cpp index 2f1941e5df..386c41a00c 100644 --- a/src/gui/map/MapDisplayWidget.cpp +++ b/src/gui/map/MapDisplayWidget.cpp @@ -26,7 +26,7 @@ namespace { // (PR #5595). Not a performance claim — compatibility only. MapView::ViewportMode flatMapViewportMode() { -#if defined(Q_OS_MAC) && defined(AETHER_GPU_SPECTRUM) +#if defined(Q_OS_MACOS) && defined(AETHER_GPU_SPECTRUM) return MapView::ViewportMode::Raster; #else return MapView::ViewportMode::OpenGlIfAvailable; diff --git a/src/main.cpp b/src/main.cpp index 2e09c98d63..9a9bb48cf2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,7 +22,7 @@ #include "core/AutomationServer.h" #include "QtPlatformChoice.h" -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS #include "MacStartupAbortGuard.h" #endif @@ -370,7 +370,7 @@ int main(int argc, char* argv[]) qputenv("QT_SCALE_FACTOR", QByteArray::number(pct / 100.0, 'f', 2)); } -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS // SpectrumWidget and WaveformWidget require native Metal child views, but // their surrounding raster-widget trees must not become native siblings. // Together with WA_DontCreateNativeAncestors on those leaves, this avoids @@ -402,7 +402,7 @@ int main(int argc, char* argv[]) // for ps and pgrep (ThreadName.cpp). AetherSDR::SystemInfo::setCurrentThreadName("AetherSDR-GUI"); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS if (!startupAbortGuard.disarm()) { std::fputs("AetherSDR startup error: could not restore the SIGABRT " "handler after GUI initialization; refusing to continue.\n", diff --git a/src/models/DStarModel.cpp b/src/models/DStarModel.cpp index 80abc61229..c73c02b015 100644 --- a/src/models/DStarModel.cpp +++ b/src/models/DStarModel.cpp @@ -700,7 +700,7 @@ void DStarModel::refreshSerialDevices() if (path.isEmpty()) { path = info.portName(); } -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) if (path.startsWith(QStringLiteral("/dev/tty."))) { continue; } @@ -720,7 +720,7 @@ void DStarModel::refreshSerialDevices() } #endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_MACOS) QDir dev(QStringLiteral("/dev")); const QStringList patterns { QStringLiteral("cu.usbserial*"), diff --git a/tests/app_settings_safety_test.cpp b/tests/app_settings_safety_test.cpp index 04cd9f91b5..001867158c 100644 --- a/tests/app_settings_safety_test.cpp +++ b/tests/app_settings_safety_test.cpp @@ -1175,10 +1175,10 @@ int main(int argc, char** argv) expect(remaining.open(QIODevice::ReadOnly) && remaining.readAll() == bytes, "profile legacy source stays byte-identical"); } else if (scenario == QStringLiteral("explicit-profile-path-isolation")) { -#if defined(Q_OS_MAC) || defined(Q_OS_WIN) +#if defined(Q_OS_MACOS) || defined(Q_OS_WIN) // Windows known folders do not honor HOME overrides. Keep Qt test // mode there, and skip rather than create a fixture outside our root. -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS QStandardPaths::setTestModeEnabled(false); #endif const QString oldPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) diff --git a/tests/audio_engine_rates_test.cpp b/tests/audio_engine_rates_test.cpp index 7f3fb4bb8e..e38e5e57bd 100644 --- a/tests/audio_engine_rates_test.cpp +++ b/tests/audio_engine_rates_test.cpp @@ -762,7 +762,7 @@ bool enableEffect(AudioEngine& engine, Effect effect) engine.setDfnrEnabled(true); return engine.dfnrEnabled(); case Effect::Mnr: -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS engine.setMnrEnabled(true); return engine.mnrEnabled(); #else diff --git a/tests/mac_cursor_compat_test.cpp b/tests/mac_cursor_compat_test.cpp index 77ac916d60..250dd8e13b 100644 --- a/tests/mac_cursor_compat_test.cpp +++ b/tests/mac_cursor_compat_test.cpp @@ -23,7 +23,7 @@ void expectShape(const char* name, int main() { -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS expectShape("vertical split remains unchanged", macSafeCursorShape(Qt::SplitVCursor), Qt::SplitVCursor); diff --git a/tests/unified_title_bar_test.cpp b/tests/unified_title_bar_test.cpp index 50ca0ac776..f84ae77c9c 100644 --- a/tests/unified_title_bar_test.cpp +++ b/tests/unified_title_bar_test.cpp @@ -285,7 +285,7 @@ int main(int argc, char** argv) host.show(); app.processEvents(); -#ifdef Q_OS_MAC +#ifdef Q_OS_MACOS QWidget uncreatedHost; mac::updateNativeTitleVisibility(&uncreatedHost); check(mac::nativeCaptionBounds(&uncreatedHost).isEmpty(), "uncreated window has no native caption bounds"); diff --git a/tests/weather_radar_loading_test.cpp b/tests/weather_radar_loading_test.cpp index 56c78018ac..736e3eda1f 100644 --- a/tests/weather_radar_loading_test.cpp +++ b/tests/weather_radar_loading_test.cpp @@ -1134,7 +1134,7 @@ private slots: void flatControllerLoopRetainsEveryPaint() { -#if defined(Q_OS_MAC) && defined(AETHER_GPU_SPECTRUM) +#if defined(Q_OS_MACOS) && defined(AETHER_GPU_SPECTRUM) // MapDisplayWidget::flatMapViewportMode() deliberately keeps the flat // map on QGraphicsView's raster viewport in this configuration, so // m_flatView owns no QOpenGLWidget for this case to sample. The target diff --git a/tools/docs/gen_reference.py b/tools/docs/gen_reference.py index 4dcaecf028..3dcb538e5a 100644 --- a/tools/docs/gen_reference.py +++ b/tools/docs/gen_reference.py @@ -510,7 +510,7 @@ def key_sequence(expr: str, where: str) -> str: def platform_keys(src: Source, name: str, where: str) -> dict: """{'macOS': ..., 'other': ...} for a QKeySequence variable declared in - an ``#ifdef Q_OS_MAC`` / ``#else`` block.""" + an ``#ifdef Q_OS_MACOS`` / ``#else`` block.""" found = {} for m in re.finditer( r"const\s+QKeySequence\s+%s\s*(\((?:[^;]*)\))?\s*;" % re.escape(name), @@ -520,9 +520,9 @@ def platform_keys(src: Source, name: str, where: str) -> dict: if not conds: raise ParseError(f"{where}: {name} is not inside a platform #ifdef") last = conds[-1] - if last == "Q_OS_MAC": + if last == "Q_OS_MACOS": plat = "macOS" - elif last == "not (Q_OS_MAC)": + elif last == "not (Q_OS_MACOS)": plat = "other" else: raise ParseError(f"{where}: {name} is under unexpected #if {last!r}")