- Timestamp:
- 2022-03-21T22:01:04+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/server/OverpassServerPanel.java
r18173 r18403 16 16 import org.openstreetmap.josm.io.OverpassDownloadReader; 17 17 import org.openstreetmap.josm.tools.GBC; 18 import org.openstreetmap.josm.tools.Utils; 18 19 19 20 /** … … 51 52 */ 52 53 public final void saveToPreferences() { 53 OverpassDownloadReader.OVERPASS_SERVER.put(overpassServer.getText()); 54 // Get the new server -- add the trailing `/` if it does not exist to avoid duplicate entries. 55 // Other code locations assume that the URL has a trailing `/` as well. 56 String newServer = Utils.strip(overpassServer.getText()); 57 if (!newServer.endsWith("/")) { 58 newServer += "/"; 59 } 60 OverpassDownloadReader.OVERPASS_SERVER.put(newServer); 61 // Ensure that the new overpass server is added to history 62 overpassServer.setText(newServer); 63 overpassServer.addCurrentItemToHistory(); 54 64 overpassServer.getModel().prefs().save(OverpassDownloadReader.OVERPASS_SERVER_HISTORY); 55 65 OverpassDownloadReader.FOR_MULTI_FETCH.put(forMultiFetch.isSelected());
Note:
See TracChangeset
for help on using the changeset viewer.