File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
python/plugins/MetaSearch Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change 4949from MetaSearch .dialogs .newconnectiondialog import NewConnectionDialog
5050from MetaSearch .dialogs .recorddialog import RecordDialog
5151from MetaSearch .dialogs .xmldialog import XMLDialog
52- from MetaSearch .util import (get_connections_from_file , get_ui_class ,
53- get_help_url , highlight_xml , normalize_text ,
54- open_url , render_template , serialize_string ,
55- StaticContext )
52+ from MetaSearch .util import (clean_ows_url , get_connections_from_file ,
53+ get_ui_class , get_help_url , highlight_xml ,
54+ normalize_text , open_url , render_template ,
55+ serialize_string , StaticContext )
5656
5757BASE_CLASS = get_ui_class ('maindialog.ui' )
5858
@@ -718,7 +718,7 @@ def add_to_ows(self):
718718
719719 # no dups detected or overwrite is allowed
720720 self .settings .beginGroup ('/Qgis/connections-%s' % stype [1 ])
721- self .settings .setValue ('/%s/url' % sname , data_url )
721+ self .settings .setValue ('/%s/url' % sname , clean_ows_url ( data_url ) )
722722 self .settings .endGroup ()
723723
724724 # open provider window
Original file line number Diff line number Diff line change 4040from pygments import highlight
4141from pygments .lexers import XmlLexer
4242from pygments .formatters import HtmlFormatter
43- from qgis .PyQt .QtCore import QSettings
43+ from qgis .PyQt .QtCore import QSettings , QUrl
4444from qgis .PyQt .QtWidgets import QMessageBox
4545from qgis .PyQt .uic import loadUiType
4646
@@ -167,3 +167,15 @@ def serialize_string(input_string):
167167 value = '%s 1' % input_string
168168
169169 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