From 133fa04db34c41c05d4e0b6ebcbc9972313df01a Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sun, 26 Feb 2017 08:23:31 -0800 Subject: [PATCH] UI: If scene/source names exist, start from 2 Currently if you have a scene, "Scene" for example, and you create a new scene, the dialog will pop up with a default name, but it'll start with "Scene 1" instead of "Scene 2". Same thing occurs with sources. This fixes that to start from 2 instead. --- UI/window-basic-main.cpp | 2 +- UI/window-basic-source-select.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 2f9fbf719..73994e5aa 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -3051,7 +3051,7 @@ void OBSBasic::on_actionAddScene_triggered() string name; QString format{QTStr("Basic.Main.DefaultSceneName.Text")}; - int i = 1; + int i = 2; QString placeHolderText = format.arg(i); obs_source_t *source = nullptr; while ((source = obs_get_source_by_name(QT_TO_UTF8(placeHolderText)))) { diff --git a/UI/window-basic-source-select.cpp b/UI/window-basic-source-select.cpp index 826fb8bbb..b66ba088d 100644 --- a/UI/window-basic-source-select.cpp +++ b/UI/window-basic-source-select.cpp @@ -204,7 +204,7 @@ OBSBasicSourceSelect::OBSBasicSourceSelect(OBSBasic *parent, const char *id_) QString placeHolderText{QT_UTF8(GetSourceDisplayName(id))}; QString text{placeHolderText}; - int i = 1; + int i = 2; obs_source_t *source = nullptr; while ((source = obs_get_source_by_name(QT_TO_UTF8(text)))) { obs_source_release(source);