Skip to content

Commit

Permalink
- add auto index incrementing in case there is already element with s…
Browse files Browse the repository at this point in the history
…pecified index

(cherry picked from commit fa100670c1f8e6c7037d8c1edc16f6e77d3005ae)
  • Loading branch information
DimitarCC authored and Huevos committed Mar 18, 2023
1 parent fee8769 commit cc87a40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/python/skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,11 @@ def processWidget(widget, context):
if not windex:
windex = "0"

wclassname = name + "_" + wclass + "_" + wconnection + "_" + windex
wclassname_base = name + "_" + wclass + "_" + wconnection + "_"
wclassname = wclassname_base + windex
while wclassname in usedComponents:
next_index = int(wclassname.replace(wclassname_base, "")) + 1
wclassname = wclassname_base + str(next_index)

usedComponents.add(wclassname)

Expand Down

0 comments on commit cc87a40

Please sign in to comment.