Skip to content

Commit f9fade6

Browse files
preserve resource order if renamed
1 parent 8ebe39f commit f9fade6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ui_widgets/DataSetterFromUi.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,14 @@ def set_resource_data_from_ui(self):
366366

367367
# change resource key to a new alias
368368
new_alias = dialog.lineEditResAlias.text()
369-
if res_name in config_data.resources:
370-
config_data.resources[new_alias] = config_data.resources.pop(res_name)
369+
370+
new_resources = {}
371+
for k, v in config_data.resources.items():
372+
if k == res_name:
373+
new_resources[new_alias] = v
374+
else:
375+
new_resources[k] = v
376+
config_data.resources = new_resources
371377

372378
def delete_selected_provider_type_and_name(self, list_widget):
373379
"""Find and remove first matching resource provider with specified type and name."""

0 commit comments

Comments
 (0)