Changeset 34875 in osm for applications/editors/josm
- Timestamp:
- 2019-01-31T16:53:52+01:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/Undelete.java
r34871 r34875 8 8 9 9 /** 10 * Create the undelete plugin.10 * Undelete action allows to restore one or more deleted objects. 11 11 */ 12 12 public class Undelete extends Plugin { 13 13 14 /** 15 * Create the undelete plugin. 16 * @param info plugin information 17 */ 14 18 public Undelete(PluginInformation info) { 15 19 super(info); -
applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java
r34871 r34875 89 89 // If the object is not deleted we get the real object 90 90 DownloadPrimitivesTask download = new DownloadPrimitivesTask(layer, Collections.singletonList(pid), true); 91 download.setZoom(false); 91 92 download.run(); 92 93 … … 100 101 hPrimitive2 = h.getByVersion(n - idx++); 101 102 } 102 if (type .equals(OsmPrimitiveType.NODE)) {103 if (type == OsmPrimitiveType.NODE) { 103 104 // We get version and user from the latest version, 104 105 // coordinates and tags from n-1 version … … 111 112 112 113 primitive = node; 113 } else if (type .equals(OsmPrimitiveType.WAY)) {114 } else if (type == OsmPrimitiveType.WAY) { 114 115 // We get version and user from the latest version, 115 116 // nodes and tags from n-1 version … … 174 175 restored.add(primitive); 175 176 } else { 176 final String msg = OsmPrimitiveType.NODE .equals(type)177 final String msg = OsmPrimitiveType.NODE == type 177 178 ? tr("Unable to undelete node {0}. Object has likely been redacted", id) 178 : OsmPrimitiveType.WAY .equals(type)179 : OsmPrimitiveType.WAY == type 179 180 ? tr("Unable to undelete way {0}. Object has likely been redacted", id) 180 : OsmPrimitiveType.RELATION .equals(type)181 : OsmPrimitiveType.RELATION == type 181 182 ? tr("Unable to undelete relation {0}. Object has likely been redacted", id) 182 183 : null; … … 185 186 } 186 187 } 187 } catch (Exception t) {188 Logging.error( t);188 } catch (Exception e) { 189 Logging.error(e); 189 190 } 190 191 } … … 196 197 ((Way) parent).setNodes(nodes); 197 198 } 198 if ( !restored.isEmpty()) {199 if (parent == null && !restored.isEmpty()) { 199 200 layer.data.setSelected(restored); 200 201 GuiHelper.runInEDT(() -> AutoScaleAction.autoScale(AutoScaleMode.SELECTION)); … … 203 204 } 204 205 206 /** 207 * Create undelete action. 208 */ 205 209 public UndeleteAction() { 206 210 super(tr("Undelete object..."), "undelete", tr("Undelete object by id"),
Note:
See TracChangeset
for help on using the changeset viewer.