Ignore:
Timestamp:
2018-10-08T01:00:47+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #16816 - new option to show object version in lists, similar to object ID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    r13766 r14306  
    113113
    114114    /**
    115      * Decorates the name of primitive with its id, if the preference
    116      * <code>osm-primitives.showid</code> is set. Shows unique id if osm-primitives.showid.new-primitives is set
    117      *
    118      * @param name  the name without the id
     115     * Decorates the name of primitive with its id and version, if the preferences
     116     * <code>osm-primitives.showid</code> and <code>osm-primitives.showversion</code> are set.
     117     * Shows unique id if <code>osm-primitives.showid.new-primitives</code> is set
     118     *
     119     * @param name the name without the id
    119120     * @param primitive the primitive
    120121     */
    121122    protected void decorateNameWithId(StringBuilder name, IPrimitive primitive) {
    122123        if (Config.getPref().getBoolean("osm-primitives.showid")) {
    123             if (Config.getPref().getBoolean("osm-primitives.showid.new-primitives")) {
    124                 name.append(tr(" [id: {0}]", primitive.getUniqueId()));
     124            long id = Config.getPref().getBoolean("osm-primitives.showid.new-primitives") ?
     125                    primitive.getUniqueId() : primitive.getId();
     126            if (Config.getPref().getBoolean("osm-primitives.showversion")) {
     127                name.append(tr(" [id: {0}, v{1}]", id, primitive.getVersion()));
    125128            } else {
    126                 name.append(tr(" [id: {0}]", primitive.getId()));
    127             }
     129                name.append(tr(" [id: {0}]", id));
     130            }
     131        } else if (Config.getPref().getBoolean("osm-primitives.showversion")) {
     132            name.append(tr(" [v{0}]", primitive.getVersion()));
    128133        }
    129134    }
Note: See TracChangeset for help on using the changeset viewer.