Ticket #21446: 21360.patch
File 21360.patch, 1.7 KB (added by , 3 years ago) |
---|
-
src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
177 177 * Use this as default item for "do not select anything". 178 178 */ 179 179 public TaggingPreset() { 180 MainApplication.getLayerManager().addActiveLayerChangeListener(this);181 180 updateEnabledState(); 182 181 } 183 182 -
src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresets.java
90 90 for (TaggingPreset tp: taggingPresets) { 91 91 if (!(tp instanceof TaggingPresetSeparator)) { 92 92 MainApplication.getToolbar().register(tp); 93 MainApplication.getLayerManager().addActiveLayerChangeListener(tp); 93 94 } 94 95 } 95 96 if (taggingPresets.isEmpty()) { … … 137 138 */ 138 139 public static void destroy() { 139 140 ToolbarPreferences toolBar = MainApplication.getToolbar(); 140 taggingPresets.forEach(toolBar::unregister); 141 for (TaggingPreset tp: taggingPresets) { 142 toolBar.unregister(tp); 143 if (!(tp instanceof TaggingPresetSeparator)) { 144 MainApplication.getLayerManager().removeActiveLayerChangeListener(tp); 145 } 146 } 141 147 taggingPresets.clear(); 142 148 PRESET_TAG_CACHE.clear(); 143 149 PRESET_ROLE_CACHE.clear();