Skip to content

Commit

Permalink
rename the remove_sld_comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gpetrak committed Nov 25, 2024
1 parent 4b5466e commit a55a7b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/qgis_geonode/styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from qgis.PyQt import QtXml

from . import network
from .utils import remove_sld_comments
from .utils import remove_comments_from_sld


def deserialize_sld_doc(
Expand All @@ -22,7 +22,7 @@ def deserialize_sld_doc(

# We remove all the comments from the SLD since they cause a QGIS crash
# during the SLD serialization (serialize_sld_named_layer, save() method)
remove_sld_comments(root)
remove_comments_from_sld(root)

if not root.isNull():
sld_named_layer = root.firstChildElement("NamedLayer")
Expand Down
4 changes: 2 additions & 2 deletions src/qgis_geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def show_message(
message_bar.pushWidget(message_item, level=level)


def remove_sld_comments(element):
def remove_comments_from_sld(element):
child = element.firstChild()
while not child.isNull():
if child.isComment():
element.removeChild(child)
else:
if child.isElement():
remove_sld_comments(child)
remove_comments_from_sld(child)
child = child.nextSibling()

0 comments on commit a55a7b7

Please sign in to comment.