File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -132,24 +132,34 @@ QgsComposition* QgsWMSConfigParser::createPrintComposition( const QString& compo
132
132
if ( !layers.isEmpty () )
133
133
{
134
134
QStringList layerSet;
135
- QStringList wmsLayerList = layers.split ( " ," );
135
+ QStringList wmsLayerList = layers.split ( " ," , QString::SkipEmptyParts );
136
136
QStringList wmsStyleList;
137
137
138
138
if ( !styles.isEmpty () )
139
139
{
140
- wmsStyleList = styles.split ( " ," );
140
+ wmsStyleList = styles.split ( " ," , QString::SkipEmptyParts );
141
141
}
142
142
143
143
for ( int i = 0 ; i < wmsLayerList.size (); ++i )
144
144
{
145
+ QString wmsLayer = wmsLayerList.at ( i );
145
146
QString styleName;
146
147
if ( wmsStyleList.size () > i )
147
148
{
148
149
styleName = wmsStyleList.at ( i );
149
150
}
151
+
152
+ bool allowCaching = true ;
153
+ if ( wmsLayerList.count ( wmsLayer ) > 1 )
154
+ {
155
+ allowCaching = false ;
156
+ }
150
157
151
- Q_FOREACH ( QgsMapLayer *layer, mapLayerFromStyle ( wmsLayerList.at ( i ), styleName ) )
158
+ QList<QgsMapLayer*> layerList = mapLayerFromStyle ( wmsLayer, styleName, allowCaching );
159
+ int listIndex;
160
+ for ( listIndex = layerList.size () - 1 ; listIndex >= 0 ; listIndex-- )
152
161
{
162
+ QgsMapLayer* layer = layerList.at ( listIndex );
153
163
if ( layer )
154
164
{
155
165
layerSet.push_back ( layer->id () );
You can’t perform that action at this time.
0 commit comments