Changeset 35767 in osm for applications/editors/josm/plugins
- Timestamp:
- 2021-05-24T20:23:08+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/PhotoPropertyEditor.java
r35600 r35767 67 67 */ 68 68 private static class PropertyEditorAction extends JosmAction implements LayerChangeListener, ImageDataUpdateListener { 69 boolean imgDataUpdLstReg = false; 70 69 71 public PropertyEditorAction() { 70 72 super(tr("Edit photo GPS data"), // String name … … 135 137 if (layer instanceof GeoImageLayer) { 136 138 ((GeoImageLayer) layer).getImageData().addImageDataUpdateListener(this); 139 imgDataUpdLstReg = true; 137 140 } 138 141 } … … 143 146 144 147 if (layer instanceof GeoImageLayer) { 145 ((GeoImageLayer) layer).getImageData().removeImageDataUpdateListener(this); 148 // In some combinations the listener might not be registered, 149 // e.g. if the plugin was added while the geo image layer 150 // existed and then the layer is removed. 151 if (imgDataUpdLstReg) { 152 ((GeoImageLayer) layer).getImageData().removeImageDataUpdateListener(this); 153 imgDataUpdLstReg = false; 154 } 146 155 } 147 156 this.updateEnabledState();
Note:
See TracChangeset
for help on using the changeset viewer.