Skip to content

Commit

Permalink
remove 'layercount' attribute from project file
Browse files Browse the repository at this point in the history
The 'layercount' attribute was not used anyway and the calculated number could already be outdated when loading the project file again due to changes to embedded projects.
  • Loading branch information
SebDieBln committed Jan 8, 2016
1 parent 95a56b9 commit d26bd46
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/plugins/processing/tests/data/project.qgs
Expand Up @@ -45,7 +45,7 @@
</filegroup>
</legendlayer>
</legend>
<projectlayers layercount="4">
<projectlayers>
<maplayer minimumScale="0" maximumScale="1e+08" geometry="Line" type="vector" hasScaleBasedVisibilityFlag="0">
<id>lines20130323011923044</id>
<datasource>./lines.shp</datasource>
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -1058,7 +1058,6 @@ bool QgsProject::write()
// Iterate over layers in zOrder
// Call writeXML() on each
QDomElement projectLayersNode = doc->createElement( "projectlayers" );
projectLayersNode.setAttribute( "layercount", qulonglong( layers.size() ) );

QMap<QString, QgsMapLayer*>::ConstIterator li = layers.constBegin();
while ( li != layers.end() )
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/labeling/test-labeling.qgs
Expand Up @@ -42,7 +42,7 @@
</filegroup>
</legendlayer>
</legend>
<projectlayers layercount="3">
<projectlayers>
<maplayer minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
<id>aoi20130902095858570</id>
<datasource>dbname='./pal_features_v3.sqlite' table="aoi" (geometry) sql=</datasource>
Expand Down
Expand Up @@ -37,7 +37,7 @@
</filegroup>
</legendlayer>
</legend>
<projectlayers layercount="2">
<projectlayers>
<maplayer minimumScale="0" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
<id>aoi20130902095858570</id>
<datasource>dbname='./features_v3.sqlite' table="aoi" (geometry) sql=</datasource>
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server/test+project.qgs
Expand Up @@ -47,7 +47,7 @@
</filegroup>
</legendlayer>
</legend>
<projectlayers layercount="1">
<projectlayers>
<maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" simplifyDrawingHints="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Point" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
<id>testlayer20150528120452665</id>
<datasource>./testlayer.shp</datasource>
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server/test+project_wfs.qgs
Expand Up @@ -72,7 +72,7 @@
<layer_coordinate_transform destAuthId="EPSG:4326" srcAuthId="EPSG:4326" srcDatumTransform="-1" destDatumTransform="-1" layerid="testlayer20150528120452665"/>
</layer_coordinate_transform_info>
</mapcanvas>
<projectlayers layercount="1">
<projectlayers>
<maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" simplifyDrawingHints="0" minLabelScale="0" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Point" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
<id>testlayer20150528120452665</id>
<datasource>./testlayer.shp</datasource>
Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server_accesscontrol/project.qgs
Expand Up @@ -375,7 +375,7 @@
</ComposerLabel>
</Composition>
</Composer>
<projectlayers layercount="5">
<projectlayers>
<maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" simplifyDrawingHints="1" minLabelScale="1" maxLabelScale="1e+08" simplifyDrawingTol="1" geometry="Polygon" simplifyMaxScale="1" type="vector" hasScaleBasedVisibilityFlag="0" simplifyLocal="1" scaleBasedLabelVisibilityFlag="0">
<id>Hello_copy20150804164427541</id>
<datasource>dbname='./helloworld.db' table="hello" (geom) sql=</datasource>
Expand Down

0 comments on commit d26bd46

Please sign in to comment.