Parcourir la source

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.
gxalpha il y a 2 ans
Parent
commit
3ff7cd5625
1 fichiers modifiés avec 7 ajouts et 5 suppressions
  1. 7 5
      UI/window-basic-main.cpp

+ 7 - 5
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 defined(OBS_RELEASE_CANDIDATE) && OBS_RELEASE_CANDIDATE > 0
 		if (major == OBS_RELEASE_CANDIDATE_MAJOR &&
 		if (major == OBS_RELEASE_CANDIDATE_MAJOR &&
 		    minor == OBS_RELEASE_CANDIDATE_MINOR &&
 		    minor == OBS_RELEASE_CANDIDATE_MINOR &&
-		    item.RC == OBS_RELEASE_CANDIDATE) {
+		    item.RC == OBS_RELEASE_CANDIDATE)
 #elif OBS_BETA > 0
 #elif OBS_BETA > 0
 		if (major == OBS_BETA_MAJOR && minor == OBS_BETA_MINOR &&
 		if (major == OBS_BETA_MAJOR && minor == OBS_BETA_MINOR &&
-		    item.Beta == OBS_BETA) {
+		    item.Beta == OBS_BETA)
 #else
 #else
 		if (major == LIBOBS_API_MAJOR_VER &&
 		if (major == LIBOBS_API_MAJOR_VER &&
 		    minor == LIBOBS_API_MINOR_VER && item.RC == 0 &&
 		    minor == LIBOBS_API_MINOR_VER && item.RC == 0 &&
-		    item.Beta == 0) {
+		    item.Beta == 0)
 #endif
 #endif
+		{
 			info_url = item.url;
 			info_url = item.url;
 			info_increment = item.increment;
 			info_increment = item.increment;
 		}
 		}
@@ -9474,12 +9475,13 @@ void OBSBasic::on_resetDocks_triggered(bool force)
 #ifdef BROWSER_AVAILABLE
 #ifdef BROWSER_AVAILABLE
 	if ((oldExtraDocks.size() || extraDocks.size() ||
 	if ((oldExtraDocks.size() || extraDocks.size() ||
 	     extraCustomDocks.size() || extraBrowserDocks.size()) &&
 	     extraCustomDocks.size() || extraBrowserDocks.size()) &&
-	    !force) {
+	    !force)
 #else
 #else
 	if ((oldExtraDocks.size() || extraDocks.size() ||
 	if ((oldExtraDocks.size() || extraDocks.size() ||
 	     extraCustomDocks.size()) &&
 	     extraCustomDocks.size()) &&
-	    !force) {
+	    !force)
 #endif
 #endif
+	{
 		QMessageBox::StandardButton button = QMessageBox::question(
 		QMessageBox::StandardButton button = QMessageBox::question(
 			this, QTStr("ResetUIWarning.Title"),
 			this, QTStr("ResetUIWarning.Title"),
 			QTStr("ResetUIWarning.Text"));
 			QTStr("ResetUIWarning.Text"));