Ignore:
Timestamp:
2016-02-18T11:07:38+01:00 (10 years ago)
Author:
bastiK
Message:

fixed #12522 - Advanced preferences: display default entries consistently

Saves default preference entries to a cache file (cache/default_preferences.xml), so the list of advanced preferences is filled with all known default values consistently from the start and not gradually as you use different features during a session.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/preferences/Setting.java

    r9759 r9821  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.preferences;
     3
     4import org.openstreetmap.josm.data.Preferences;
    35
    46/**
     
    4648     */
    4749    Setting<T> getNullInstance();
     50
     51    /**
     52     * Set the time for this setting.
     53     *
     54     * For default preferences. They are saved in a cache file. Keeping the
     55     * time allows to discard very old default settings.
     56     * @param time the time in seconds since epoch
     57     */
     58    void setTime(Long time);
     59
     60    /**
     61     * Get the time for this setting.
     62     * @return the time for this setting
     63     * @see #setTime(java.lang.Long)
     64     */
     65    Long getTime();
     66
     67    /**
     68     * Mark setting as new.
     69     *
     70     * For default preferences. A setting is marked as new, if it has been seen
     71     * in the current session.
     72     * Methods like {@link Preferences#get(java.lang.String, java.lang.String)},
     73     * can be called from different parts of the code with the same key. In this case,
     74     * the supplied default value must match. However, this is only an error if the mismatching
     75     * default value has been seen in the same session (and not loaded from cache).
     76     * @param isNew true, if it is new
     77     */
     78    void setNew(boolean isNew);
     79
     80    /**
     81     * Return if the setting has been marked as new.
     82     * @return true, if the setting has been marked as new
     83     * @see #setNew(boolean)
     84     */
     85    boolean isNew();
    4886}
Note: See TracChangeset for help on using the changeset viewer.