Skip to content
Permalink
Browse files

QGIS Server: Exclude composers in OWS tab does not work

In the current QGIS server, if one uses a list of "Exclude composers" in the OWS tab, QGIS server lists only the excluded composers and not the composers the map author actually wants. So it acts as a white list and not as a black list.
  • Loading branch information
rldhont authored and mhugent committed Sep 4, 2013
1 parent ad942b6 commit b83389724b2160a5c2a4f54a14b3b030f54e2461
Showing with 9 additions and 9 deletions.
  1. +3 −3 src/app/qgsprojectproperties.cpp
  2. +6 −6 src/mapserver/qgsprojectparser.cpp
@@ -316,7 +316,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
grpWMSList->setChecked( mWMSList->count() > 0 );

//composer restriction for WMS
values = QgsProject::instance()->readListEntry( "WMSComposerList", "/", QStringList(), &ok );
values = QgsProject::instance()->readListEntry( "WMSRestrictedComposers", "/", QStringList(), &ok );
mWMSComposerGroupBox->setChecked( ok );
if ( ok )
{
@@ -699,11 +699,11 @@ void QgsProjectProperties::apply()
{
composerTitles << mComposerListWidget->item( i )->text();
}
QgsProject::instance()->writeEntry( "WMSComposerList", "/", composerTitles );
QgsProject::instance()->writeEntry( "WMSRestrictedComposers", "/", composerTitles );
}
else
{
QgsProject::instance()->removeEntry( "WMSComposerList", "/" );
QgsProject::instance()->removeEntry( "WMSRestrictedComposers", "/" );
}

//WMS layer restrictions
@@ -2407,8 +2407,8 @@ QList<QDomElement> QgsProjectParser::publishedComposerElements() const
QDomNodeList composerNodeList = mXMLDoc->elementsByTagName( "Composer" );

QDomElement propertiesElem = mXMLDoc->documentElement().firstChildElement( "properties" );
QDomElement wmsComposerListElem = propertiesElem.firstChildElement( "WMSComposerList" );
if ( wmsComposerListElem.isNull() )
QDomElement wmsRestrictedComposersElem = propertiesElem.firstChildElement( "WMSRestrictedComposers" );
if ( wmsRestrictedComposersElem.isNull() )
{
for ( unsigned int i = 0; i < composerNodeList.length(); ++i )
{
@@ -2417,11 +2417,11 @@ QList<QDomElement> QgsProjectParser::publishedComposerElements() const
return composerElemList;
}

QSet<QString> publishedComposerNames;
QDomNodeList valueList = wmsComposerListElem.elementsByTagName( "value" );
QSet<QString> restrictedComposerNames;
QDomNodeList valueList = wmsRestrictedComposersElem.elementsByTagName( "value" );
for ( int i = 0; i < valueList.size(); ++i )
{
publishedComposerNames.insert( valueList.at( i ).toElement().text() );
restrictedComposerNames.insert( valueList.at( i ).toElement().text() );
}

//remove unpublished composers from list
@@ -2431,7 +2431,7 @@ QList<QDomElement> QgsProjectParser::publishedComposerElements() const
{
currentElem = composerNodeList.at( i ).toElement();
currentComposerName = currentElem.attribute( "title" );
if ( publishedComposerNames.contains( currentComposerName ) )
if ( !restrictedComposerNames.contains( currentComposerName ) )
{
composerElemList.push_back( currentElem );
}

0 comments on commit b833897

Please sign in to comment.
You can’t perform that action at this time.