I created an empty qgis project, then chose New GeoPackage Layer, chose a
new file "foo.gpkg" and layername "mytable".

Everything seems fine. But if I save, and reopen the project it cant find
the source. So I inspect the qgz XML and find the source for the layer in
two places:

### Layer-Tree-Layer:

<layer-tree-layer
    id="mytable_d645cad7_6637_434d_9295_dc62a7ff198e"
    source="./foo.gpkg|layername=mytable"
    legend_split_behavior="0"
    name="mytable" expanded="1"
    checked="Qt::Checked"
    providerKey="ogr"
    legend_exp=""
    patch_size="-1,-1"
>

### MapLayer

<projectlayers>
    <maplayer (...) >
        <id>mytable_d645cad7_6637_434d_9295_dc62a7ff198e</id>

<datasource>../../OneDrive/Dokumenter/foo.gpkg|layername=mytable</datasource>
        (...)
        <layername>foo — mytable</layername>
        (...)
    </maplayer>
</projectlayers>


The latter for some reason has a wrong value in datasource. I have no
projects or data files in that location, so I guess QGIS somehow defaulted
to my users document folder. This seems like some kind of bug.

But I wonder, why, in the first place, is datasource in two different
places in that file?

Running QGIS 3.36.3 on Windows 10.

Sincerely, Thomas
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to