UI: If group's name exist, start it from 2

Currently if you making a new group it named "Group 1" by default
instead of just "Group". This fixes it. The second group will be
named "Group 2".
master
SuslikV 2018-06-15 12:53:47 +02:00 committed by GitHub
parent 6b37de3c65
commit 488c087d69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -640,15 +640,15 @@ Qt::DropActions SourceTreeModel::supportedDropActions() const
QString SourceTreeModel::GetNewGroupName()
{
OBSScene scene = GetCurrentScene();
QString name;
QString name = QTStr("Group");
int i = 1;
int i = 2;
for (;;) {
name = QTStr("Basic.Main.Group").arg(QString::number(i++));
obs_sceneitem_t *group = obs_scene_get_group(scene,
QT_TO_UTF8(name));
if (!group)
break;
name = QTStr("Basic.Main.Group").arg(QString::number(i++));
}
return name;