File tree 2 files changed +24
-6
lines changed
python/plugins/MetaSearch
2 files changed +24
-6
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
@@ -137,7 +138,12 @@ def get_help_url():
137
138
"""return QGIS MetaSearch help documentation link"""
138
139
139
140
locale_name = QgsSettings ().value ('locale/userLocale' )[0 :2 ]
140
- version = Qgis .QGIS_VERSION .rsplit ('.' , 1 )[0 ]
141
+ major , minor = QGis .QGIS_VERSION .split ('.' )[:2 ]
142
+
143
+ if minor == '99' : # master
144
+ version = 'testing'
145
+ else :
146
+ version = '.' .join ([major , minor ])
141
147
142
148
path = '%s/%s/docs/user_manual/plugins/plugins_metasearch.html' % \
143
149
(version , locale_name )
@@ -171,3 +177,15 @@ def serialize_string(input_string):
171
177
value = '%s 1' % input_string
172
178
173
179
return value
180
+
181
+
182
+ def clean_ows_url (url ):
183
+ """clean an OWS URL of added basic service parameters"""
184
+
185
+ url2 = QUrl (url )
186
+ url2 .removeEncodedQueryItem ('service' )
187
+ url2 .removeEncodedQueryItem ('SERVICE' )
188
+ url2 .removeEncodedQueryItem ('request' )
189
+ url2 .removeEncodedQueryItem ('REQUEST' )
190
+
191
+ return url2 .toString ()
You can’t perform that action at this time.
0 commit comments