Changeset 10876 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2016-08-22T22:05:45+02:00 (4 years ago)
Author:
Don-vip
Message:

fix #13309 - fix unit tests (patch by michael2402) - gsoc-core

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r10858 r10876  
    168168     * Global application preferences
    169169     */
    170     public static Preferences pref;
     170    public static final Preferences pref = new Preferences();
    171171
    172172    /**
     
    513513     */
    514514    public static volatile PlatformHook platform;
    515 
    516     /**
    517      * Initializes {@code Main.pref} in normal application context.
    518      * @since 6471
    519      */
    520     public static void initApplicationPreferences() {
    521         Main.pref = new Preferences();
    522     }
    523515
    524516    /**
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r10839 r10876  
    779779    }
    780780
     781    /**
     782     * Resets the preferences to their initial state. This resets all values and file associations.
     783     * The default values and listeners are not removed.
     784     * <p>
     785     * It is meant to be called before {@link #init(boolean)}
     786     * @since 10876
     787     */
     788    public void resetToInitialState() {
     789        resetToDefault();
     790        preferencesDir = null;
     791        cacheDir = null;
     792        userdataDir = null;
     793        saveOnPut = true;
     794        initSuccessful = false;
     795    }
     796
     797    /**
     798     * Reset all values stored in this map to the default values. This clears the preferences.
     799     */
    781800    public final void resetToDefault() {
    782801        settingsMap.clear();
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r10824 r10876  
    326326        }
    327327
    328         initApplicationPreferences();
    329 
    330328        Policy.setPolicy(new Policy() {
    331329            // Permissions for plug-ins loaded when josm is started via webstart
Note: See TracChangeset for help on using the changeset viewer.