From 3ff7cd56256b4e94061f983b225a8db0bebc4bfc Mon Sep 17 00:00:00 2001 From: gxalpha Date: Mon, 4 Sep 2023 13:42:55 +0200 Subject: [PATCH] UI: Untangle ifdef'd if-statement to un-confuse Xcode Like many IDEs, Xcode has this feature where it shows the declaration of the method currently being worked in. However it gets confused by scopes starting inside of preprocessor guards and ending outside them, resulting in the declaration of OBSBasic::ReceivedIntroJson always being shown in window-basic-main.cpp from that method downwards. We can work around that by starting and ending the if-scope outside of the ifdefs. --- UI/window-basic-main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 523253ac0..943e8cac1 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -2451,15 +2451,16 @@ void OBSBasic::ReceivedIntroJson(const QString &text) #if defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0 if (major == OBS_RELEASE_CANDIDATE_MAJOR && minor == OBS_RELEASE_CANDIDATE_MINOR && - item.RC == OBS_RELEASE_CANDIDATE) { + item.RC == OBS_RELEASE_CANDIDATE) #elif OBS_BETA > 0 if (major == OBS_BETA_MAJOR && minor == OBS_BETA_MINOR && - item.Beta == OBS_BETA) { + item.Beta == OBS_BETA) #else if (major == LIBOBS_API_MAJOR_VER && minor == LIBOBS_API_MINOR_VER && item.RC == 0 && - item.Beta == 0) { + item.Beta == 0) #endif + { info_url = item.url; info_increment = item.increment; } @@ -9474,12 +9475,13 @@ void OBSBasic::on_resetDocks_triggered(bool force) #ifdef BROWSER_AVAILABLE if ((oldExtraDocks.size() || extraDocks.size() || extraCustomDocks.size() || extraBrowserDocks.size()) && - !force) { + !force) #else if ((oldExtraDocks.size() || extraDocks.size() || extraCustomDocks.size()) && - !force) { + !force) #endif + { QMessageBox::StandardButton button = QMessageBox::question( this, QTStr("ResetUIWarning.Title"), QTStr("ResetUIWarning.Text"));