File tree 2 files changed +18
-6
lines changed
python/plugins/MetaSearch
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 50
50
from MetaSearch .dialogs .newconnectiondialog import NewConnectionDialog
51
51
from MetaSearch .dialogs .recorddialog import RecordDialog
52
52
from MetaSearch .dialogs .xmldialog import XMLDialog
53
- from MetaSearch .util import (get_connections_from_file , get_ui_class ,
54
- get_help_url , highlight_xml , normalize_text ,
55
- open_url , render_template , serialize_string ,
56
- StaticContext )
53
+ from MetaSearch .util import (clean_ows_url , get_connections_from_file ,
54
+ get_ui_class , get_help_url , highlight_xml ,
55
+ normalize_text , open_url , render_template ,
56
+ serialize_string , StaticContext )
57
57
58
58
BASE_CLASS = get_ui_class ('maindialog.ui' )
59
59
@@ -719,7 +719,7 @@ def add_to_ows(self):
719
719
720
720
# no dups detected or overwrite is allowed
721
721
self .settings .beginGroup ('/Qgis/connections-%s' % stype [1 ])
722
- self .settings .setValue ('/%s/url' % sname , data_url )
722
+ self .settings .setValue ('/%s/url' % sname , clean_ows_url ( data_url ) )
723
723
self .settings .endGroup ()
724
724
725
725
# open provider window
Original file line number Diff line number Diff line change 40
40
from pygments import highlight
41
41
from pygments .lexers import XmlLexer
42
42
from pygments .formatters import HtmlFormatter
43
- from PyQt4 .QtCore import QSettings
43
+ from PyQt4 .QtCore import QSettings , QUrl
44
44
from PyQt4 .QtGui import QMessageBox
45
45
from PyQt4 .uic import loadUiType
46
46
@@ -167,3 +167,15 @@ def serialize_string(input_string):
167
167
value = '%s 1' % input_string
168
168
169
169
return value
170
+
171
+
172
+ def clean_ows_url (url ):
173
+ """clean an OWS URL of added basic service parameters"""
174
+
175
+ url2 = QUrl (url )
176
+ url2 .removeEncodedQueryItem ('service' )
177
+ url2 .removeEncodedQueryItem ('SERVICE' )
178
+ url2 .removeEncodedQueryItem ('request' )
179
+ url2 .removeEncodedQueryItem ('REQUEST' )
180
+
181
+ return url2 .toString ()
You can’t perform that action at this time.
0 commit comments