[QGIS Commit] r14116 - trunk/qgis/src/mapserver

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Aug 21 08:15:27 EDT 2010


Author: mhugent
Date: 2010-08-21 12:15:27 +0000 (Sat, 21 Aug 2010)
New Revision: 14116

Modified:
   trunk/qgis/src/mapserver/qgsgetrequesthandler.cpp
Log:
Fix problem with parameter map in getrequesthandler

Modified: trunk/qgis/src/mapserver/qgsgetrequesthandler.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsgetrequesthandler.cpp	2010-08-21 10:10:49 UTC (rev 14115)
+++ trunk/qgis/src/mapserver/qgsgetrequesthandler.cpp	2010-08-21 12:15:27 UTC (rev 14116)
@@ -36,55 +36,51 @@
   QStringList elements = queryString.split( "&" );
 
   QString element, key, value;
-  int separator = -1;
 
   //insert key and value into the map
   for ( QStringList::const_iterator it = elements.begin(); it != elements.end(); ++it )
   {
     element = *it;
-    if ( separator != -1 )
-    {
-      int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive );
+    int sepidx = element.indexOf( "=", 0, Qt::CaseSensitive );
 
-      key = element.left( sepidx );
-      value = element.mid( sepidx + 1 );
-      value = QUrl::fromPercentEncoding( value.toLocal8Bit() ); //replace encoded special caracters and utf-8 encodings
+    key = element.left( sepidx );
+    value = element.mid( sepidx + 1 );
+    value = QUrl::fromPercentEncoding( value.toLocal8Bit() ); //replace encoded special caracters and utf-8 encodings
 
 
-      if ( key.compare( "SLD_BODY", Qt::CaseInsensitive ) == 0 )
+    if ( key.compare( "SLD_BODY", Qt::CaseInsensitive ) == 0 )
+    {
+      key = "SLD";
+    }
+    else if ( key.compare( "SLD", Qt::CaseInsensitive ) == 0 )
+    {
+      QByteArray fileContents;
+      if ( value.startsWith( "http", Qt::CaseInsensitive ) )
       {
-        key = "SLD";
+        QgsHttpTransaction http( value );
+        if ( !http.getSynchronously( fileContents ) )
+        {
+          continue;
+        }
       }
-      else if ( key.compare( "SLD", Qt::CaseInsensitive ) == 0 )
+      else if ( value.startsWith( "ftp", Qt::CaseInsensitive ) )
       {
-        QByteArray fileContents;
-        if ( value.startsWith( "http", Qt::CaseInsensitive ) )
+        QgsFtpTransaction ftp;
+        if ( !ftp.get( value, fileContents ) )
         {
-          QgsHttpTransaction http( value );
-          if ( !http.getSynchronously( fileContents ) )
-          {
-            continue;
-          }
+          continue;
         }
-        else if ( value.startsWith( "ftp", Qt::CaseInsensitive ) )
-        {
-          QgsFtpTransaction ftp;
-          if ( !ftp.get( value, fileContents ) )
-          {
-            continue;
-          }
-          value = QUrl::fromPercentEncoding( fileContents );
-        }
-        else
-        {
-          continue; //only http and ftp supported at the moment
-        }
         value = QUrl::fromPercentEncoding( fileContents );
-
       }
-      parameters.insert( std::make_pair( key.toUpper(), value ) );
-      QgsMSDebugMsg( "qgsgetrequesthandler.cpp: inserting pair " + key.toUpper() + " // " + value + " into the parameter map" )
+      else
+      {
+        continue; //only http and ftp supported at the moment
+      }
+      value = QUrl::fromPercentEncoding( fileContents );
+
     }
+    parameters.insert( std::make_pair( key.toUpper(), value ) );
+    QgsMSDebugMsg( "qgsgetrequesthandler.cpp: inserting pair " + key.toUpper() + " // " + value + " into the parameter map" )
   }
 
   //feature info format?



More information about the QGIS-commit mailing list