clang-format: Apply formatting

Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
This commit is contained in:
jp9000 committed 2019-06-23 23:49:10 -07:00
1 parent 53615ee10f
commit f53df7da64
567 files changed
+34068 -32903

No files matched your search

+48 -43
View File
@@ -14,7 +14,7 @@
struct QCef;
struct QCefCookieManager;
extern QCef *cef;
extern QCef *cef;
extern QCefCookieManager *panel_cookies;
enum class ListOpt : int {
@@ -54,10 +54,10 @@ void OBSBasicSettings::InitStreamPage()
LoadServices(false);
connect(ui->service, SIGNAL(currentIndexChanged(int)),
this, SLOT(UpdateServerList()));
connect(ui->service, SIGNAL(currentIndexChanged(int)),
this, SLOT(UpdateKeyLink()));
connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
SLOT(UpdateServerList()));
connect(ui->service, SIGNAL(currentIndexChanged(int)), this,
SLOT(UpdateKeyLink()));
}
void OBSBasicSettings::LoadStream1Settings()
@@ -78,8 +78,10 @@ void OBSBasicSettings::LoadStream1Settings()
ui->customServer->setText(server);
bool use_auth = obs_data_get_bool(settings, "use_auth");
const char *username = obs_data_get_string(settings, "username");
const char *password = obs_data_get_string(settings, "password");
const char *username =
obs_data_get_string(settings, "username");
const char *password =
obs_data_get_string(settings, "password");
ui->authUsername->setText(QT_UTF8(username));
ui->authPw->setText(QT_UTF8(password));
ui->useAuth->setChecked(use_auth);
@@ -126,9 +128,7 @@ void OBSBasicSettings::LoadStream1Settings()
void OBSBasicSettings::SaveStream1Settings()
{
bool customServer = IsCustomService();
const char *service_id = customServer
? "rtmp_custom"
: "rtmp_common";
const char *service_id = customServer ? "rtmp_custom" : "rtmp_common";
obs_service_t *oldService = main->GetService();
OBSData hotkeyData = obs_hotkeys_save_service(oldService);
@@ -139,27 +139,30 @@ void OBSBasicSettings::SaveStream1Settings()
if (!customServer) {
obs_data_set_string(settings, "service",
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(settings, "server",
QT_TO_UTF8(ui->server->currentData().toString()));
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(
settings, "server",
QT_TO_UTF8(ui->server->currentData().toString()));
} else {
obs_data_set_string(settings, "server",
QT_TO_UTF8(ui->customServer->text()));
QT_TO_UTF8(ui->customServer->text()));
obs_data_set_bool(settings, "use_auth",
ui->useAuth->isChecked());
ui->useAuth->isChecked());
if (ui->useAuth->isChecked()) {
obs_data_set_string(settings, "username",
QT_TO_UTF8(ui->authUsername->text()));
obs_data_set_string(
settings, "username",
QT_TO_UTF8(ui->authUsername->text()));
obs_data_set_string(settings, "password",
QT_TO_UTF8(ui->authPw->text()));
QT_TO_UTF8(ui->authPw->text()));
}
}
obs_data_set_bool(settings, "bwtest", ui->bandwidthTestEnable->isChecked());
obs_data_set_bool(settings, "bwtest",
ui->bandwidthTestEnable->isChecked());
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
OBSService newService = obs_service_create(service_id,
"default_service", settings, hotkeyData);
OBSService newService = obs_service_create(
service_id, "default_service", settings, hotkeyData);
obs_service_release(newService);
if (!newService)
@@ -185,13 +188,15 @@ void OBSBasicSettings::UpdateKeyLink()
text += " <a href=\"https://";
text += "www.twitch.tv/broadcast/dashboard/streamkey";
text += "\">";
text += QTStr("Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += QTStr(
"Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += "</a>";
} else if (serviceName == "YouTube / YouTube Gaming") {
text += " <a href=\"https://";
text += "www.youtube.com/live_dashboard";
text += "\">";
text += QTStr("Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += QTStr(
"Basic.AutoConfig.StreamPage.StreamKey.LinkToSite");
text += "</a>";
}
@@ -234,9 +239,9 @@ void OBSBasicSettings::LoadServices(bool showAll)
QVariant((int)ListOpt::ShowAll));
}
ui->service->insertItem(0,
QTStr("Basic.AutoConfig.StreamPage.Service.Custom"),
QVariant((int)ListOpt::Custom));
ui->service->insertItem(
0, QTStr("Basic.AutoConfig.StreamPage.Service.Custom"),
QVariant((int)ListOpt::Custom));
if (!lastService.isEmpty()) {
int idx = ui->service->findText(lastService);
@@ -256,8 +261,8 @@ static inline bool is_auth_service(const std::string &service)
void OBSBasicSettings::on_service_currentIndexChanged(int)
{
bool showMore =
ui->service->currentData().toInt() == (int)ListOpt::ShowAll;
bool showMore = ui->service->currentData().toInt() ==
(int)ListOpt::ShowAll;
if (showMore)
return;
@@ -273,8 +278,8 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
QString key = ui->key->text();
bool can_auth = is_auth_service(service);
int page = can_auth && (!loading || key.isEmpty())
? (int)Section::Connect
: (int)Section::StreamKey;
? (int)Section::Connect
: (int)Section::StreamKey;
ui->streamStackWidget->setCurrentIndex(page);
ui->streamKeyWidget->setVisible(true);
@@ -296,7 +301,7 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
if (custom) {
ui->streamkeyPageLayout->insertRow(1, ui->serverLabel,
ui->serverStackedWidget);
ui->serverStackedWidget);
ui->serverStackedWidget->setCurrentIndex(1);
ui->serverStackedWidget->setVisible(true);
@@ -320,8 +325,8 @@ void OBSBasicSettings::on_service_currentIndexChanged(int)
void OBSBasicSettings::UpdateServerList()
{
QString serviceName = ui->service->currentText();
bool showMore =
ui->service->currentData().toInt() == (int)ListOpt::ShowAll;
bool showMore = ui->service->currentData().toInt() ==
(int)ListOpt::ShowAll;
if (showMore) {
LoadServices(true);
@@ -386,17 +391,18 @@ OBSService OBSBasicSettings::SpawnTempService()
if (!custom) {
obs_data_set_string(settings, "service",
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(settings, "server",
QT_TO_UTF8(ui->server->currentData().toString()));
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(
settings, "server",
QT_TO_UTF8(ui->server->currentData().toString()));
} else {
obs_data_set_string(settings, "server",
QT_TO_UTF8(ui->customServer->text()));
QT_TO_UTF8(ui->customServer->text()));
}
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
OBSService newService = obs_service_create(service_id,
"temp_service", settings, nullptr);
OBSService newService = obs_service_create(service_id, "temp_service",
settings, nullptr);
obs_service_release(newService);
return newService;
@@ -405,7 +411,7 @@ OBSService OBSBasicSettings::SpawnTempService()
void OBSBasicSettings::OnOAuthStreamKeyConnected()
{
#ifdef BROWSER_AVAILABLE
OAuthStreamKey *a = reinterpret_cast<OAuthStreamKey*>(auth.get());
OAuthStreamKey *a = reinterpret_cast<OAuthStreamKey *>(auth.get());
if (a) {
bool validKey = !a->key().empty();
@@ -461,9 +467,8 @@ void OBSBasicSettings::on_disconnectAccount_clicked()
{
QMessageBox::StandardButton button;
button = OBSMessageBox::question(this,
QTStr(DISCONNECT_COMFIRM_TITLE),
QTStr(DISCONNECT_COMFIRM_TEXT));
button = OBSMessageBox::question(this, QTStr(DISCONNECT_COMFIRM_TITLE),
QTStr(DISCONNECT_COMFIRM_TEXT));
if (button == QMessageBox::No) {
return;