Ignore:
Timestamp:
11/02/20 15:47:20 (4 years ago)
Author:
bnemhaus
Message:

Removed reliance of System.getProperty("user.name") by introducing some functions and a variable to Browser to be used instead. All previous occurrences of System.getProperty("user.name") now use these functions.

At the time, introduced new piping into various functions related to the creation and management of profile frames that distinguished between a profile name and a user name. This allows functions to be more specific about what is being used. For example, when modifying the users profile frames (in the profiles directory) that users profile name can be used instead of naming the variable 'username'. This distinction is important because while username's can end with numbers, profile names cannot and therefore get an 'A' on the end.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/account/Create.java

    r1505 r1540  
    3131import org.expeditee.core.Colour;
    3232import org.expeditee.encryption.CryptographyConstants;
     33import org.expeditee.gui.Browser;
    3334import org.expeditee.gui.DisplayController;
    3435import org.expeditee.gui.Frame;
     
    8687                // Update in memory settings
    8788                ProfileManager.ensureDefaultProfile();
    88                 System.setProperty("user.name", username);
     89                Browser.setExpediteeUserName(username);
    8990                UserSettings.UserName.set(username);
    9091                //UserSettings.ProfileName.set(username);
    91                 UserSettings.ProfileName.set(FrameIO.ConvertToValidFramesetName(username));
     92                final String profileName = FrameIO.ConvertToValidFramesetName(username);
     93                UserSettings.ProfileName.set(profileName);
    9294                UserSettings.setupDefaultFolders();
    9395                               
    9496                Frame profile;
    9597                try {
    96                         profile = createNewProfile(username, email, personalKey, privateKey, publicKey);
     98                        profile = createNewProfile(username, profileName, email, personalKey, privateKey, publicKey);
    9799                } catch (InvalidFramesetNameException | ExistingFramesetException e) {
    98100                        return CreateResult.ErrorNewProfile;
     
    201203        }
    202204
    203         private static Frame createNewProfile(String username, String email, String personalKey, String privateKey,
     205        private static Frame createNewProfile(String username, String profileName, String email, String personalKey, String privateKey,
    204206                        String publicKey) throws InvalidFramesetNameException, ExistingFramesetException {
    205207                // Establish the initial settings for the created user.
     
    241243               
    242244                // Create users profile
    243                 Frame profile = FrameIO.CreateNewProfile(username, initialSettings, notifiers);
     245                Frame profile = FrameIO.CreateNewProfile(username, profileName, initialSettings, notifiers);
    244246                int lastNumber = FrameIO.getLastNumber(profile.getFramesetName());
    245247                for (int i = 1; i <= lastNumber; i++) {
Note: See TracChangeset for help on using the changeset viewer.