From daee83373ccef39a91fbb0d5d7f585a1450951c4 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 6 Oct 2022 23:34:54 +0200 Subject: [PATCH] UI: Remove unused assignments --- UI/obs-app.cpp | 4 +--- UI/record-button.cpp | 3 +-- UI/source-tree.cpp | 1 - UI/window-basic-main-transitions.cpp | 2 +- UI/window-basic-main.cpp | 3 --- UI/window-basic-preview.cpp | 4 ---- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 2de469676..6a439c35d 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -2284,10 +2284,8 @@ static int run_program(fstream &logFile, int argc, char *argv[]) } #endif - if (!created_log) { + if (!created_log) create_log_file(logFile); - created_log = true; - } #ifdef __APPLE__ MacPermissionStatus audio_permission = diff --git a/UI/record-button.cpp b/UI/record-button.cpp index a0f028938..c368d1d6f 100644 --- a/UI/record-button.cpp +++ b/UI/record-button.cpp @@ -29,7 +29,7 @@ static QWidget *firstWidget(QLayoutItem *item) return nullptr; auto n = layout->count(); - for (auto i = 0, n = layout->count(); i < n; i++) { + for (auto i = 0; i < n; i++) { widget = firstWidget(layout->itemAt(i)); if (widget) return widget; @@ -47,7 +47,6 @@ static QWidget *lastWidget(QLayoutItem *item) if (!layout) return nullptr; - auto n = layout->count(); for (auto i = layout->count(); i > 0; i--) { widget = lastWidget(layout->itemAt(i - 1)); if (widget) diff --git a/UI/source-tree.cpp b/UI/source-tree.cpp index 9ab28320a..3d9f03a33 100644 --- a/UI/source-tree.cpp +++ b/UI/source-tree.cpp @@ -1266,7 +1266,6 @@ void SourceTree::dropEvent(QDropEvent *event) if (hasGroups) { if (!itemBelow || obs_sceneitem_get_group(scene, itemBelow) != dropGroup) { - indicator = QAbstractItemView::BelowItem; dropGroup = nullptr; dropOnCollapsed = false; } diff --git a/UI/window-basic-main-transitions.cpp b/UI/window-basic-main-transitions.cpp index a64030e57..427db5199 100644 --- a/UI/window-basic-main-transitions.cpp +++ b/UI/window-basic-main-transitions.cpp @@ -455,7 +455,7 @@ void OBSBasic::AddTransition() obs_source_t *source = nullptr; int i = 1; - while ((source = FindTransition(QT_TO_UTF8(placeHolderText)))) { + while ((FindTransition(QT_TO_UTF8(placeHolderText)))) { placeHolderText = format.arg(++i); } diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 848da0492..068888204 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -4364,9 +4364,6 @@ void OBSBasic::ResetUI() bool studioPortraitLayout = config_get_bool( GetGlobalConfig(), "BasicWindow", "StudioPortraitLayout"); - bool labels = config_get_bool(GetGlobalConfig(), "BasicWindow", - "StudioModeLabels"); - if (studioPortraitLayout) ui->previewLayout->setDirection(QBoxLayout::BottomToTop); else diff --git a/UI/window-basic-preview.cpp b/UI/window-basic-preview.cpp index c0d18e724..c56e63d3a 100644 --- a/UI/window-basic-preview.cpp +++ b/UI/window-basic-preview.cpp @@ -1718,8 +1718,6 @@ static void DrawLine(float x1, float y1, float x2, float y2, float thickness, static void DrawSquareAtPos(float x, float y, float pixelRatio) { - OBSBasic *main = OBSBasic::Get(); - struct vec3 pos; vec3_set(&pos, x, y, 0.0f); @@ -1743,8 +1741,6 @@ static void DrawSquareAtPos(float x, float y, float pixelRatio) static void DrawRotationHandle(gs_vertbuffer_t *circle, float rot, float pixelRatio) { - OBSBasic *main = OBSBasic::Get(); - struct vec3 pos; vec3_set(&pos, 0.5f, 0.0f, 0.0f);