From 1ffc172cb09b43fea2beb585d29a0b2ef54bb7b7 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Fri, 17 Jan 2025 17:06:50 +0100 Subject: [PATCH] Tip - Trailing spaces can be added --- lizmap/plugin.py | 1 + lizmap/project_checker_tools.py | 6 ++++++ lizmap/widgets/check_project.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lizmap/plugin.py b/lizmap/plugin.py index 7b250785..590a6385 100755 --- a/lizmap/plugin.py +++ b/lizmap/plugin.py @@ -3182,6 +3182,7 @@ def check_project( if results: self.dlg.log_panel.append(tr("Duplicated labels in the legend"), Html.H2) self.dlg.log_panel.append("
") + self.dlg.log_panel.append("" + tr("A leading space can be added.") + "") self.dlg.log_panel.start_table() self.dlg.log_panel.append( "{}{}{}".format(tr('Layer'), tr('Label'), tr('Count')) diff --git a/lizmap/project_checker_tools.py b/lizmap/project_checker_tools.py index b8911e64..09e9dfd6 100644 --- a/lizmap/project_checker_tools.py +++ b/lizmap/project_checker_tools.py @@ -586,6 +586,12 @@ def _clean_result(results: dict) -> dict: for layer_id, labels in results.items(): data[layer_id] = {} for label, count in labels.items(): + if label == "": + # In a rule based symbology, this can be an empty string + label = tr("(empty string)") + else: + # Add some quotes, to see if they are some leading trailing spaces + label = f'"{label}"' if count >= 2: data[layer_id][label] = count diff --git a/lizmap/widgets/check_project.py b/lizmap/widgets/check_project.py index 309018cc..4f4261c3 100644 --- a/lizmap/widgets/check_project.py +++ b/lizmap/widgets/check_project.py @@ -1028,7 +1028,7 @@ class SourceType: Field = SourceField Layer = SourceLayer - Groupe = SourceGroup + Group = SourceGroup class Error: @@ -1188,7 +1188,7 @@ def add_error(self, error: Error, lizmap_cloud: bool = False, severity=None, ico layer = QgsProject.instance().mapLayer(error.source_type.layer_id) item.setIcon(QgsMapLayerModel.iconForLayer(layer)) item.setData(self.JSON, error.source_type.layer_id) - elif isinstance(error.source_type, SourceType.Groupe): + elif isinstance(error.source_type, SourceType.Group): item.setToolTip(error.source_type.name) item.setIcon(QIcon(":images/themes/default/mActionFolder.svg")) item.setData(self.JSON, error.source_type.name)