Skip to content

Commit

Permalink
resource_sharing_dialog: Do not use reserved keyword id
Browse files Browse the repository at this point in the history
This shadows the builtin keyword id.
  • Loading branch information
ptitjano committed Mar 6, 2024
1 parent b2cb5c6 commit cf20f19
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions qgis_resource_sharing/gui/resource_sharing_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,25 +642,25 @@ def reload_collections_model(self):
"""Reload the collections model with the current collections."""
self.collections_model.clear()
installed_collections = self.collection_manager.get_installed_collections()
for id in config.COLLECTIONS:
collection_name = config.COLLECTIONS[id]["name"]
collection_author = config.COLLECTIONS[id]["author"]
collection_tags = config.COLLECTIONS[id]["tags"]
collection_description = config.COLLECTIONS[id]["description"]
collection_status = config.COLLECTIONS[id]["status"]
for collection_id in config.COLLECTIONS:
collection_name = config.COLLECTIONS[collection_id]["name"]
collection_author = config.COLLECTIONS[collection_id]["author"]
collection_tags = config.COLLECTIONS[collection_id]["tags"]
collection_description = config.COLLECTIONS[collection_id]["description"]
collection_status = config.COLLECTIONS[collection_id]["status"]
repository_name = ""
if "repository_name" in config.COLLECTIONS[id].keys():
repository_name = config.COLLECTIONS[id]["repository_name"]
if "repository_name" in config.COLLECTIONS[collection_id].keys():
repository_name = config.COLLECTIONS[collection_id]["repository_name"]
item = QStandardItem(collection_name + " (" + repository_name + ")")
item.setEditable(False)
item.setData(id, COLLECTION_ID_ROLE)
item.setData(collection_id, COLLECTION_ID_ROLE)
item.setData(collection_name, COLLECTION_NAME_ROLE)
item.setData(collection_description, COLLECTION_DESCRIPTION_ROLE)
item.setData(collection_author, COLLECTION_AUTHOR_ROLE)
item.setData(collection_tags, COLLECTION_TAGS_ROLE)
item.setData(collection_status, COLLECTION_STATUS_ROLE)
# Make installed collections stand out
if installed_collections and id in installed_collections.keys():
if installed_collections and collection_id in installed_collections.keys():
collectionFont = QFont()
collectionFont.setWeight(60)
item.setFont(collectionFont)
Expand Down Expand Up @@ -722,9 +722,9 @@ def filter_collections(self, text):
search = QRegExp(text, Qt.CaseInsensitive, QRegExp.RegExp)
self.collection_proxy.setFilterRegExp(search)

def show_collection_metadata(self, id):
def show_collection_metadata(self, collection_id):
"""Show the collection metadata given the ID."""
html = self.collection_manager.get_html(id)
html = self.collection_manager.get_html(collection_id)
self.web_view_details.setHtml(html)

def reject(self):
Expand Down

0 comments on commit cf20f19

Please sign in to comment.