From 4953a3eff875f3e5846430e9865a43f249ee91dc Mon Sep 17 00:00:00 2001 From: Jean-Baptiste DESBAS Date: Thu, 13 Apr 2023 11:38:13 +0200 Subject: [PATCH] fix preference acces --- plugin/idg/plugin_main.py | 3 +-- plugin/idg/toolbelt/browser.py | 2 +- plugin/idg/toolbelt/plugin_globals.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin/idg/plugin_main.py b/plugin/idg/plugin_main.py index a7b631d..02506b8 100644 --- a/plugin/idg/plugin_main.py +++ b/plugin/idg/plugin_main.py @@ -64,8 +64,7 @@ def __init__(self, iface: QgisInterface): # Read the resources tree file and update the GUI #self.ressources_tree = TreeNodeFactory(PluginGlobals.instance().config_file_path).root_node # dev - - download_all_config_files(PlgOptionsManager().get_value_from_key('idgs').split(',')) + download_all_config_files(PlgOptionsManager().get_plg_settings().idgs.split(',')) def need_download_tree_config_file(self): """ diff --git a/plugin/idg/toolbelt/browser.py b/plugin/idg/toolbelt/browser.py index 226b66b..3fea82a 100644 --- a/plugin/idg/toolbelt/browser.py +++ b/plugin/idg/toolbelt/browser.py @@ -65,7 +65,7 @@ def menus(self, parent): def createChildren(self): children = [] - for idg_id, url in enumerate(PlgOptionsManager().get_value_from_key('idgs').split(',')): + for idg_id, url in enumerate(PlgOptionsManager().get_plg_settings().idgs.split(',')): idg_id = str(idg_id) suffix = os.path.splitext(os.path.basename(url))[-1] local_file_name = os.path.join(PluginGlobals.instance().config_dir_path, idg_id + suffix) diff --git a/plugin/idg/toolbelt/plugin_globals.py b/plugin/idg/toolbelt/plugin_globals.py index c43df6b..39e7c1f 100644 --- a/plugin/idg/toolbelt/plugin_globals.py +++ b/plugin/idg/toolbelt/plugin_globals.py @@ -49,7 +49,7 @@ class PluginGlobals: CONFIG_FILE_NAMES = ["projet_idg.qgs"] CONFIG_FILE_URLS = ["http://127.0.0.1:8000/projet_idg.qgs"] - IDGS = PlgOptionsManager().get_value_from_key('idgs').split(',') + IDGS = PlgOptionsManager().get_plg_settings().idgs.split(',') # Hide resources with status = warn HIDE_RESOURCES_WITH_WARN_STATUS = PlgOptionsManager().get_value_from_key('hide_resources_with_warn_status')