Skip to content

Commit

Permalink
Tool (pg/gpkg/mssql) mode is set in the get_configuration_from_source…
Browse files Browse the repository at this point in the history
…provider function, so redundancy is removed
  • Loading branch information
signedav committed Oct 29, 2024
1 parent 25c7e95 commit e272c85
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion QgisModelBaker/gui/dataset_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ def _evaluated_configuration(self):
valid, mode = db_utils.get_configuration_from_sourceprovider(
source_provider, configuration
)
configuration.tool = mode
source_info_text = self.tr(
"<body><p>It's the datasource of the current project, evaluated by layer <b>{}</b>.</p>"
).format(layer.name())
Expand Down
5 changes: 3 additions & 2 deletions QgisModelBaker/gui/panel/tid_configurator_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ def setup_dialog(self, qgis_project, configuration=None):
valid, mode = db_utils.get_configuration_from_sourceprovider(
source_provider, self.configuration
)
if valid:
self.configuration.tool = mode
if not valid:
# invalidate tool
self.configuration.tool = ""

if self.configuration and self.configuration.tool:
self._reset_tid_configuration()
Expand Down
1 change: 0 additions & 1 deletion QgisModelBaker/gui/topping_wizard/ili2dbsettings_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ def _refresh_combobox(self):
source_provider, configuration
)
if valid and mode:
configuration.tool = mode
db_connector = db_utils.get_db_connector(configuration)
# only load it when it exists and metadata there (contains interlis data)
if (
Expand Down
1 change: 0 additions & 1 deletion QgisModelBaker/gui/topping_wizard/layers_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ def _load_ili_schema_identificators(self):
source_provider, configuration
)
if valid and mode:
configuration.tool = mode
db_connector = db_utils.get_db_connector(configuration)

if (
Expand Down
1 change: 0 additions & 1 deletion QgisModelBaker/gui/topping_wizard/models_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _load_available_models_and_sources(self):
source_provider, current_configuration
)
if valid and mode:
current_configuration.tool = mode
db_connector = db_utils.get_db_connector(current_configuration)
if db_connector:
db_connectors.append(db_connector)
Expand Down
1 change: 0 additions & 1 deletion QgisModelBaker/gui/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def set_current_layer(self, layer):
QStandardPaths.writableLocation(QStandardPaths.TempLocation),
f"dataexport_{output_file_name}",
)
self.current_configuration.tool = mode
if mode == DbIliMode.gpkg:
self.info_label.setText(
self.tr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def restore_configuration(self, configuration, get_config_from_project=False):
if valid and mode:
# uses the settings from the project and provides it to the gui
configuration = layer_configuration
configuration.tool = mode
self._lst_panel[mode].set_fields(configuration)
else:
# takes settings from QSettings and provides it to the gui
Expand Down

0 comments on commit e272c85

Please sign in to comment.