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 49
49
from MetaSearch .dialogs .newconnectiondialog import NewConnectionDialog
50
50
from MetaSearch .dialogs .recorddialog import RecordDialog
51
51
from 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 )
56
56
57
57
BASE_CLASS = get_ui_class ('maindialog.ui' )
58
58
@@ -718,7 +718,7 @@ def add_to_ows(self):
718
718
719
719
# no dups detected or overwrite is allowed
720
720
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 ) )
722
722
self .settings .endGroup ()
723
723
724
724
# 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 qgis .PyQt .QtCore import QSettings
43
+ from qgis .PyQt .QtCore import QSettings , QUrl
44
44
from qgis .PyQt .QtWidgets import QMessageBox
45
45
from qgis .PyQt .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