@@ -36,55 +36,51 @@ std::map<QString, QString> QgsGetRequestHandler::parseInput()
36
36
QStringList elements = queryString.split ( " &" );
37
37
38
38
QString element, key, value;
39
- int separator = -1 ;
40
39
41
40
// insert key and value into the map
42
41
for ( QStringList::const_iterator it = elements.begin (); it != elements.end (); ++it )
43
42
{
44
43
element = *it;
45
- if ( separator != -1 )
46
- {
47
- int sepidx = element.indexOf ( " =" , 0 , Qt::CaseSensitive );
44
+ int sepidx = element.indexOf ( " =" , 0 , Qt::CaseSensitive );
48
45
49
- key = element.left ( sepidx );
50
- value = element.mid ( sepidx + 1 );
51
- value = QUrl::fromPercentEncoding ( value.toLocal8Bit () ); // replace encoded special caracters and utf-8 encodings
46
+ key = element.left ( sepidx );
47
+ value = element.mid ( sepidx + 1 );
48
+ value = QUrl::fromPercentEncoding ( value.toLocal8Bit () ); // replace encoded special caracters and utf-8 encodings
52
49
53
50
54
- if ( key.compare ( " SLD_BODY" , Qt::CaseInsensitive ) == 0 )
55
- {
56
- key = " SLD" ;
57
- }
58
- else if ( key.compare ( " SLD" , Qt::CaseInsensitive ) == 0 )
51
+ if ( key.compare ( " SLD_BODY" , Qt::CaseInsensitive ) == 0 )
52
+ {
53
+ key = " SLD" ;
54
+ }
55
+ else if ( key.compare ( " SLD" , Qt::CaseInsensitive ) == 0 )
56
+ {
57
+ QByteArray fileContents;
58
+ if ( value.startsWith ( " http" , Qt::CaseInsensitive ) )
59
59
{
60
- QByteArray fileContents ;
61
- if ( value. startsWith ( " http " , Qt::CaseInsensitive ) )
60
+ QgsHttpTransaction http ( value ) ;
61
+ if ( !http. getSynchronously ( fileContents ) )
62
62
{
63
- QgsHttpTransaction http ( value );
64
- if ( !http.getSynchronously ( fileContents ) )
65
- {
66
- continue ;
67
- }
63
+ continue ;
68
64
}
69
- else if ( value.startsWith ( " ftp" , Qt::CaseInsensitive ) )
70
- {
71
- QgsFtpTransaction ftp;
72
- if ( !ftp.get ( value, fileContents ) )
73
- {
74
- continue ;
75
- }
76
- value = QUrl::fromPercentEncoding ( fileContents );
77
- }
78
- else
65
+ }
66
+ else if ( value.startsWith ( " ftp" , Qt::CaseInsensitive ) )
67
+ {
68
+ QgsFtpTransaction ftp;
69
+ if ( !ftp.get ( value, fileContents ) )
79
70
{
80
- continue ; // only http and ftp supported at the moment
71
+ continue ;
81
72
}
82
73
value = QUrl::fromPercentEncoding ( fileContents );
83
-
84
74
}
85
- parameters.insert ( std::make_pair ( key.toUpper (), value ) );
86
- QgsMSDebugMsg ( " qgsgetrequesthandler.cpp: inserting pair " + key.toUpper () + " // " + value + " into the parameter map" )
75
+ else
76
+ {
77
+ continue ; // only http and ftp supported at the moment
78
+ }
79
+ value = QUrl::fromPercentEncoding ( fileContents );
80
+
87
81
}
82
+ parameters.insert ( std::make_pair ( key.toUpper (), value ) );
83
+ QgsMSDebugMsg ( " qgsgetrequesthandler.cpp: inserting pair " + key.toUpper () + " // " + value + " into the parameter map" )
88
84
}
89
85
90
86
// feature info format?
0 commit comments