Skip to content

Commit

Permalink
enh: strip http(s):// from DCOR server string in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Nov 30, 2022
1 parent 7808a63 commit 4d6e81a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2.11.11
- enh: strip http(s):// from DCOR server string in settings
2.11.10
- fix: detect chaged files on disk when reloading metadata
- setup: bump dclab from 0.46.4 to 0.47.0 (new bg_med feature
Expand Down
7 changes: 7 additions & 0 deletions shapeout2/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ def on_settings_apply(self):
curtext = self.dcor_servers.currentText()
items = self.settings.value(key, default)
if curtext in items:
# We do it again below to be on the safe side
items.remove(curtext)
for bad_start in ["https://", "http://"]:
if curtext.startswith(bad_start):
curtext = curtext[len(bad_start):]
if curtext in items:
# We do it again with the stripped version
items.remove(curtext)
items.insert(0, curtext)
value = items
Expand Down

0 comments on commit 4d6e81a

Please sign in to comment.