UI: Fix preprocessor directives for platform integrations

The macros `YOUTUBE_ENABLED`, `RESTREAM_ENABLED`, and `TWITCH_ENABLED`
are not defined when the associated features are not enabled.
When the code was originally implemented, there were definitions to set
`0` if the feature is disabled. However a later commit 349372b removes
the definition. Now, the use of `#ifdef` is better than just `#if`.
This commit is contained in:
Norihiro Kamae
2023-07-12 23:10:52 +09:00
committed by Ryan Foster
parent 8789c43959
commit 39d4b53f6b
4 changed files with 26 additions and 26 deletions

View File

@@ -16,7 +16,7 @@
#include "ui-config.h"
#if YOUTUBE_ENABLED
#ifdef YOUTUBE_ENABLED
#include "youtube-api-wrappers.hpp"
#endif
@@ -458,7 +458,7 @@ static void reset_service_ui_fields(Ui::OBSBasicSettings *ui,
ui->disconnectAccount->setVisible(false);
}
#if YOUTUBE_ENABLED
#ifdef YOUTUBE_ENABLED
static void get_yt_ch_title(Ui::OBSBasicSettings *ui)
{
const char *name = config_get_string(OBSBasic::Get()->Config(),
@@ -560,7 +560,7 @@ void OBSBasicSettings::ServiceChanged()
auto system_auth_service = main->auth->service();
bool service_check = service.find(system_auth_service) !=
std::string::npos;
#if YOUTUBE_ENABLED
#ifdef YOUTUBE_ENABLED
service_check = service_check ? service_check
: IsYouTubeService(system_auth_service) &&
IsYouTubeService(service);
@@ -728,7 +728,7 @@ void OBSBasicSettings::OnOAuthStreamKeyConnected()
} else {
ui->bandwidthTestEnable->setChecked(false);
}
#if YOUTUBE_ENABLED
#ifdef YOUTUBE_ENABLED
if (IsYouTubeService(a->service())) {
ui->key->clear();
@@ -983,7 +983,7 @@ void OBSBasicSettings::UpdateServiceRecommendations()
}
#undef ENFORCE_TEXT
#if YOUTUBE_ENABLED
#ifdef YOUTUBE_ENABLED
if (IsYouTubeService(QT_TO_UTF8(ui->service->currentText()))) {
if (!text.isEmpty())
text += "<br><br>";