mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Do not display name exists dialog if source name does not change
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user