Deltares / Ribasim

Water resources modeling
https://ribasim.org/
MIT License
42 stars 5 forks source link

Deleting Edge layer from a geopackage makes it impossible to open in QGIS anymore #1684

Open deltamarnix opened 3 months ago

deltamarnix commented 3 months ago

Expected: Not such a big crash, but more like a validation error. Or we should not allow deletion of "Edge" and "Node" layers from the database.

Huite commented 3 months ago

Indeed, it shouldn't be possible to delete the Node and Edge layers.

In QGIS-Tim, I have two mandatory layers as well, they are always removed from the deletion selection:

        # Collect the selected items
        selection = self.selectedItems()
        selection = [
            item
            for item in selection
            if not isinstance(item.element, (Aquifer, Domain))
        ]

This is currently silent though, you probably want a an info message that mentions that these layers cannot be deleted.