Merge pull request #1333 from SuslikV/patch-8

UI: If group's name exist, start it from 2
This commit is contained in:
Jim 2018-06-19 18:06:38 -07:00 committed by GitHub
commit d818377ccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;