Merge pull request #2486 from okrc/patch-1

Fixed issue with empty group blinking sequence.
This commit is contained in:
DavidXanatos 2022-11-26 13:44:27 +01:00 committed by GitHub
commit 78170a0d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -165,7 +165,7 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
QString ParentGroup = pNode->Path.isEmpty() ? "" : CSbieModel__RemoveGroupMark(pNode->Path.last().toString()); QString ParentGroup = pNode->Path.isEmpty() ? "" : CSbieModel__RemoveGroupMark(pNode->Path.last().toString());
int OrderNumber = Groups[ParentGroup].indexOf(Group); int OrderNumber = Groups[ParentGroup].indexOf(Group);
if (pNode->OrderNumber != OrderNumber) { if (pNode->OrderNumber != OrderNumber) {
pNode->OrderNumber = OrderNumber; pNode->OrderNumber = (OrderNumber == -1) ? Groups[ParentGroup].size() : OrderNumber;
Changed = 1; Changed = 1;
} }
@ -209,7 +209,7 @@ QList<QVariant> CSbieModel::Sync(const QMap<QString, CSandBoxPtr>& BoxList, cons
QString Group = pNode->Path.isEmpty() ? "" : CSbieModel__RemoveGroupMark(pNode->Path.last().toString()); QString Group = pNode->Path.isEmpty() ? "" : CSbieModel__RemoveGroupMark(pNode->Path.last().toString());
int OrderNumber = Groups[Group].indexOf(pBox->GetName()); int OrderNumber = Groups[Group].indexOf(pBox->GetName());
if (pNode->OrderNumber != OrderNumber) { if (pNode->OrderNumber != OrderNumber) {
pNode->OrderNumber = OrderNumber; pNode->OrderNumber = (OrderNumber == -1) ? Groups[Group].size() : OrderNumber;
Changed = 1; Changed = 1;
} }