From 444a0802187bdecf976e81990f3183637c0cdd52 Mon Sep 17 00:00:00 2001 From: Palana Date: Mon, 13 Oct 2014 18:09:06 +0200 Subject: [PATCH] Do not display name exists dialog if source name does not change --- obs/window-basic-main.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 90d44c70f..3cd02cc39 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -1922,14 +1922,17 @@ void OBSBasic::logUploadFinished() static void RenameListItem(OBSBasic *parent, QListWidget *listWidget, obs_source_t *source, const string &name) { - const char *prevName = obs_source_get_name(source); - obs_source_t *foundSource = obs_get_source_by_name(name.c_str()); - QListWidgetItem *listItem = listWidget->currentItem(); + const char *prevName = obs_source_get_name(source); + if (name == prevName) + return; - if (foundSource || name.compare(prevName) == 0 || name.empty()) { + obs_source_t *foundSource = obs_get_source_by_name(name.c_str()); + QListWidgetItem *listItem = listWidget->currentItem(); + + if (foundSource || name.empty()) { listItem->setText(QT_UTF8(prevName)); - if (foundSource || name.compare(prevName) == 0) { + if (foundSource) { QMessageBox::information(parent, QTStr("NameExists.Title"), QTStr("NameExists.Text"));