kopia lustrzana https://github.com/JOSM/MapWithAI
Fix JOSM #21623: ACE in MapWithAILayerInfo
Signed-off-by: Taylor Smock <tsmock@fb.com>pull/1/head v1.9.3
rodzic
52f9d8eae2
commit
0f8072833a
|
@ -319,11 +319,10 @@ public class GetDataRunnable extends RecursiveTask<DataSet> {
|
|||
* @param replaceTags The tags to replace
|
||||
*/
|
||||
public static void replaceTags(DataSet dataSet, Map<Tag, Tag> replaceTags) {
|
||||
replaceTags
|
||||
.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().parallelStream()
|
||||
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|
||||
|| prim.hasKey(orig.getKey()) && Utils.isBlank(orig.getValue()))
|
||||
.forEach(prim -> prim.put(replace)));
|
||||
replaceTags.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().parallelStream()
|
||||
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|
||||
|| prim.hasKey(orig.getKey()) && Utils.isBlank(orig.getValue()))
|
||||
.forEach(prim -> prim.put(replace)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.openstreetmap.josm.data.Preferences;
|
|||
import org.openstreetmap.josm.data.StructUtils;
|
||||
import org.openstreetmap.josm.data.imagery.ImageryInfo;
|
||||
import org.openstreetmap.josm.data.preferences.BooleanProperty;
|
||||
import org.openstreetmap.josm.gui.MainApplication;
|
||||
import org.openstreetmap.josm.gui.PleaseWaitRunnable;
|
||||
import org.openstreetmap.josm.io.CachedFile;
|
||||
import org.openstreetmap.josm.io.NetworkManager;
|
||||
|
@ -302,12 +303,14 @@ public class MapWithAILayerInfo {
|
|||
if (preferences != null) {
|
||||
// saveOnPut is pretty much always true
|
||||
preferences.enableSaveOnPut(true);
|
||||
try {
|
||||
preferences.save();
|
||||
} catch (IOException e) {
|
||||
// This is highly unlikely to happen
|
||||
Logging.error(e);
|
||||
}
|
||||
MainApplication.worker.execute(() -> {
|
||||
try {
|
||||
preferences.save();
|
||||
} catch (IOException e) {
|
||||
// This is highly unlikely to happen
|
||||
Logging.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
this.finish();
|
||||
|
|
Ładowanie…
Reference in New Issue