Skip to content

Commit

Permalink
Use case insensitive string comparison for wms request names
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 7, 2013
1 parent aeda1ef commit 58f762b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/mapserver/qgis_map_serv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ int main( int argc, char * argv[] )
continue;
}

if ( request.toLower() == QString( "GetCapabilities" ).toLower() )
if ( request.compare( "GetCapabilities", Qt::CaseInsensitive ) == 0 )
{
QDomDocument capabilitiesDocument;
try
Expand All @@ -349,7 +349,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "DescribeFeatureType" ).toLower() )
else if ( request.compare( "DescribeFeatureType", Qt::CaseInsensitive ) == 0 )
{
QDomDocument describeDocument;
try
Expand All @@ -369,7 +369,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "GetFeature" ).toLower() )
else if ( request.compare( "GetFeature", Qt::CaseInsensitive ) == 0 )
{
//output format for GetFeature
QString outputFormat = parameterMap.value( "OUTPUTFORMAT" );
Expand All @@ -396,7 +396,7 @@ int main( int argc, char * argv[] )
continue;
}
}
else if ( request.toLower() == QString( "Transaction" ).toLower() )
else if ( request.compare( "Transaction", Qt::CaseInsensitive ) == 0 )
{
QDomDocument transactionDocument;
try
Expand Down Expand Up @@ -446,13 +446,13 @@ int main( int argc, char * argv[] )
}

QString version = parameterMap.value( "VERSION", "1.3.0" );
bool getProjectSettings = ( request.toLower() == QString( "GetProjectSettings" ).toLower() );
bool getProjectSettings = ( request.compare( "GetProjectSettings", Qt::CaseInsensitive ) == 0 );
if ( getProjectSettings )
{
version = "1.3.0"; //getProjectSettings extends WMS 1.3.0 capabilities
}

if ( request.toLower() == QString( "GetCapabilities" ).toLower() || getProjectSettings )
if ( request.compare( "GetCapabilities", Qt::CaseInsensitive ) == 0 || getProjectSettings )
{
const QDomDocument* capabilitiesDocument = capabilitiesCache.searchCapabilitiesDocument( configFilePath, getProjectSettings ? "projectSettings" : version );
if ( !capabilitiesDocument ) //capabilities xml not in cache. Create a new one
Expand Down Expand Up @@ -486,7 +486,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "GetMap" ).toLower() )
else if ( request.compare( "GetMap", Qt::CaseInsensitive ) == 0 )
{
QImage* result = 0;
try
Expand Down Expand Up @@ -518,7 +518,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "GetFeatureInfo" ).toLower() )
else if ( request.compare( "GetFeatureInfo", Qt::CaseInsensitive ) == 0 )
{
QDomDocument featureInfoDoc;
try
Expand All @@ -544,7 +544,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "GetStyles" ).toLower() || request.toLower() == QString( "GetStyle" ).toLower() ) // GetStyle for compatibility with earlier QGIS versions
else if ( request.compare( "GetStyles", Qt::CaseInsensitive ) == 0 || request.compare( "GetStyle", Qt::CaseInsensitive ) == 0 ) // GetStyle for compatibility with earlier QGIS versions
{
try
{
Expand All @@ -560,7 +560,7 @@ int main( int argc, char * argv[] )
delete theServer;
continue;
}
else if ( request.toLower() == QString( "GetLegendGraphic" ).toLower() || request.toLower() == QString( "GetLegendGraphics" ).toLower() ) // GetLegendGraphics for compatibility with earlier QGIS versions
else if ( request.compare( "GetLegendGraphic", Qt::CaseInsensitive ) == 0 || request.compare( "GetLegendGraphics", Qt::CaseInsensitive ) == 0 ) // GetLegendGraphics for compatibility with earlier QGIS versions
{
QImage* result = 0;
try
Expand Down Expand Up @@ -589,7 +589,7 @@ int main( int argc, char * argv[] )
continue;

}
else if ( request.toLower() == QString( "GetPrint" ).toLower() )
else if ( request.compare( "GetPrint", Qt::CaseInsensitive ) == 0 )
{
QByteArray* printOutput = 0;
try
Expand Down

0 comments on commit 58f762b

Please sign in to comment.