Changeset 5024 in josm
- Timestamp:
- 2012-02-26T15:14:34+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r4899 r5024 7 7 import java.util.Collection; 8 8 import java.util.concurrent.Future; 9 import java.util.regex.Matcher; 10 import java.util.regex.Pattern; 9 11 10 12 import org.openstreetmap.josm.Main; … … 35 37 36 38 protected OsmDataLayer targetLayer; 39 40 protected String newLayerName = null; 37 41 38 42 protected void rememberDownloadedData(DataSet ds) { … … 64 68 progressMonitor); 65 69 currentBounds = null; 70 // Extract .osm filename from URL to set the new layer name 71 Matcher matcher = Pattern.compile("http://.*/(.*\\.osm)").matcher(url); 72 newLayerName = matcher.matches() ? matcher.group(1) : null; 66 73 return Main.worker.submit(downloadTask); 67 74 } … … 150 157 } 151 158 159 protected OsmDataLayer createNewLayer(String layerName) { 160 if (layerName == null || layerName.isEmpty()) { 161 layerName = OsmDataLayer.createNewName(); 162 } 163 return new OsmDataLayer(dataSet, layerName, null); 164 } 165 152 166 protected OsmDataLayer createNewLayer() { 153 return new OsmDataLayer(dataSet, OsmDataLayer.createNewName(),null);167 return createNewLayer(null); 154 168 } 155 169 … … 172 186 // or it is not clear which layer to merge to 173 187 // 174 targetLayer = createNewLayer( );188 targetLayer = createNewLayer(newLayerName); 175 189 final boolean isDisplayingMapView = Main.isDisplayingMapView(); 176 190
Note:
See TracChangeset
for help on using the changeset viewer.