Changeset 9527 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-18T20:08:51+01:00 (9 years ago)
Author:
simon04
Message:

fix #10306 - Changeset manager does not know username of current uploaded and open changeset

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java

    r9519 r9527  
    189189
    190190    /**
     191     * Returns the identity as a {@link User} object
     192     *
     193     * @return the identity as user, or {@link User#getAnonymous()} if {@link #isAnonymous()}
     194     */
     195    public User asUser() {
     196        return isAnonymous() ? User.getAnonymous() : User.createOsmUser(userInfo != null ? userInfo.getId() : 0, userName);
     197    }
     198
     199    /**
    191200     * Initializes the user identity manager from Basic Authentication values in the {@link org.openstreetmap.josm.data.Preferences}
    192201     * This method should be called if {@code osm-server.auth-method} is set to {@code basic}.
  • trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java

    r9078 r9527  
    2626import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    2727import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
     28import org.openstreetmap.josm.gui.JosmUserIdentityManager;
    2829import org.openstreetmap.josm.gui.Notification;
    2930import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    294295                }
    295296            }
     297            // update the user information
     298            if (changeset.getUser() == null) {
     299                changeset.setUser(JosmUserIdentityManager.getInstance().asUser());
     300            }
    296301            // if required close the changeset
    297302            //
Note: See TracChangeset for help on using the changeset viewer.