File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
python/plugins/MetaSearch Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 54
54
from MetaSearch .dialogs .newconnectiondialog import NewConnectionDialog
55
55
from MetaSearch .dialogs .recorddialog import RecordDialog
56
56
from MetaSearch .dialogs .xmldialog import XMLDialog
57
- from MetaSearch .util import (get_connections_from_file , get_ui_class ,
58
- get_help_url , highlight_xml , normalize_text ,
59
- open_url , render_template , serialize_string ,
60
- StaticContext )
57
+ from MetaSearch .util import (clean_ows_url , get_connections_from_file ,
58
+ get_ui_class , get_help_url , highlight_xml ,
59
+ normalize_text , open_url , render_template ,
60
+ serialize_string , StaticContext )
61
61
62
62
BASE_CLASS = get_ui_class ('maindialog.ui' )
63
63
@@ -723,7 +723,7 @@ def add_to_ows(self):
723
723
724
724
# no dups detected or overwrite is allowed
725
725
self .settings .beginGroup ('/Qgis/connections-%s' % stype [1 ])
726
- self .settings .setValue ('/%s/url' % sname , data_url )
726
+ self .settings .setValue ('/%s/url' % sname , clean_ows_url ( data_url ) )
727
727
self .settings .endGroup ()
728
728
729
729
# open provider window
Original file line number Diff line number Diff line change 44
44
from pygments import highlight
45
45
from pygments .lexers import XmlLexer
46
46
from pygments .formatters import HtmlFormatter
47
+ from qgis .PyQt .QtCore import QUrl
47
48
from qgis .PyQt .QtWidgets import QMessageBox
48
49
from qgis .PyQt .uic import loadUiType
49
50
@@ -171,3 +172,15 @@ def serialize_string(input_string):
171
172
value = '%s 1' % input_string
172
173
173
174
return value
175
+
176
+
177
+ def clean_ows_url (url ):
178
+ """clean an OWS URL of added basic service parameters"""
179
+
180
+ url2 = QUrl (url )
181
+ url2 .removeEncodedQueryItem ('service' )
182
+ url2 .removeEncodedQueryItem ('SERVICE' )
183
+ url2 .removeEncodedQueryItem ('request' )
184
+ url2 .removeEncodedQueryItem ('REQUEST' )
185
+
186
+ return url2 .toString ()
You can’t perform that action at this time.
0 commit comments