Skip to content

Commit

Permalink
fixes editing twice a service
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Sep 28, 2020
1 parent a569e95 commit e3ead81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions geomapfish_locator/core/geomapfish_locator_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def unload(self):
self.iface.invalidateLocatorResults()
for menu_action in self.menu_actions:
self.iface.removePluginMenu(self.plugin_name, menu_action)
del self.menu_actions[:]
for locator_filter in self.locator_filters:
self.iface.deregisterLocatorFilter(locator_filter)
self.locator_filters = {}

def save_services(self):
services = []
Expand All @@ -129,8 +131,10 @@ def save_services(self):
def refresh_menu(self):
for menu_action in self.menu_actions[1:]:
self.iface.removePluginMenu(self.plugin_name, menu_action)
for locator_filter in self.locator_filters:
self.add_locator_menu_action(locator_filter)
del self.menu_actions[1:]
# use index based loop to avoid changing the variable used in the lambda !
for i in range(len(self.locator_filters)):
self.add_locator_menu_action(self.locator_filters[i])

def show_settings(self, _):
if GeomapfishSettingsDialog(self.iface.mainWindow()).exec_():
Expand Down
2 changes: 1 addition & 1 deletion geomapfish_locator/core/locator_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def openConfigWidget(self, parent=None):
cfg = FilterConfigurationDialog(self.service, parent)
if cfg.exec_():
self.service = cfg.service.clone()
self.crs = QgsCoordinateReferenceSystem(self.service.c
self.crs = QgsCoordinateReferenceSystem(self.service.crs)
self.changed.emit()

def reset_rubberband(self):
Expand Down

0 comments on commit e3ead81

Please sign in to comment.