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/gui/FrameIO.java

    r1532 r1540  
    11001100               
    11011101                if (toSave == null || !toSave.hasChanged() || toSave.isSaved()) {
     1102                        System.err.println("FrameIO::SaveFrame::Nothing to save, backing out.");
    11021103                        return "";
     1104                }
     1105               
     1106                if (toSave.getName().toLowerCase().equals("abc146a1")) {
     1107                        System.out.println("here");
    11031108                }
    11041109
     
    12001205                        boolean fileModifyConflict = fileLastModify > frameLastModify && !isBayFrameset;
    12011206                        boolean versionConflict = savedVersion > toSave.getVersion() && !isBayFrameset;
     1207                       
     1208                        System.err.println("FrameIO::SaveFrame::Checking for conflicts for frame:" + toSave.getName());
    12021209                       
    12031210                        if ((fileModifyConflict || versionConflict) && savedVersion > 0) {
     
    14051412        }
    14061413
    1407         public static Frame LoadProfile(String userName)
     1414        public static Frame LoadProfile(String profileName)
    14081415        {
    14091416                final String profilesLoc = System.getProperty("profiles.loc");
    14101417                if (profilesLoc != null) {
    1411                         return LoadFrame(userName + "1", profilesLoc);
     1418                        return LoadFrame(profileName + "1", profilesLoc);
    14121419                } else {
    1413                         return LoadFrame(userName + "1");
    1414                 }
    1415         }
    1416 
    1417         public static Frame CreateNewProfile(String username, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException {
     1420                        return LoadFrame(profileName + "1");
     1421                }
     1422        }
     1423
     1424        public static Frame CreateNewProfile(String userName, String profileName, Map<String, Setting> initialSettings, Map<String, Consumer<Frame>> toNotifyOnSet) throws InvalidFramesetNameException, ExistingFramesetException { //TODO: Investigate these throws, they never seem to be thrown up this far.
    14181425//              Frame profile = CreateFrameset(username, PROFILE_PATH, true);
    14191426//              if (profile != null) {
     
    14251432//              }
    14261433//              return profile;
    1427                 if (username.equals(UserSettings.DEFAULT_PROFILE_NAME)) {
    1428                         ProfileManager.ensureDefaultProfile();
    1429                         return FrameIO.LoadFrame(UserSettings.DEFAULT_PROFILE_NAME + "1");
     1434                if (profileName.equals(UserSettings.DEFAULT_PROFILE_NAME)) {
     1435                        System.err.println("FrameIO::CreateNewProfile::DEPRECATED::CreateNewProfile should no longer be called to create a default profile.  Use FrameIO::CreateNewDefaultProfile instead.");
     1436                        return CreateNewDefaultProfile();
    14301437                } else {
    1431                         return ProfileManager.createProfile(username, initialSettings, toNotifyOnSet);
    1432                 }
     1438                        return ProfileManager.createProfile(userName, profileName, initialSettings, toNotifyOnSet);
     1439                }
     1440        }
     1441       
     1442        public static Frame CreateNewDefaultProfile() throws InvalidFramesetNameException, ExistingFramesetException  { //TODO: Investigate these throws, they never seem to be thrown up this far.
     1443                ProfileManager.ensureDefaultProfile();
     1444                return FrameIO.LoadFrame(UserSettings.DEFAULT_PROFILE_NAME + "1");
    14331445        }
    14341446
Note: See TracChangeset for help on using the changeset viewer.