Ignore:
Timestamp:
2017-09-13T23:24:50+02:00 (7 years ago)
Author:
bastiK
Message:

see #15229 - use Config.getPref() wherever possible

File:
1 edited

Legend:

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

    r12841 r12846  
    2828import javax.swing.event.HyperlinkEvent;
    2929
    30 import org.openstreetmap.josm.Main;
    3130import org.openstreetmap.josm.data.osm.Changeset;
    3231import org.openstreetmap.josm.gui.MainApplication;
    3332import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
    3433import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
     34import org.openstreetmap.josm.spi.preferences.Config;
    3535import org.openstreetmap.josm.tools.CheckParameterUtil;
    3636import org.openstreetmap.josm.tools.GBC;
     
    7878        hcbUploadComment.setToolTipText(tr("Enter an upload comment"));
    7979        hcbUploadComment.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    80         List<String> cmtHistory = new LinkedList<>(Main.pref.getList(HISTORY_KEY, new LinkedList<String>()));
     80        List<String> cmtHistory = new LinkedList<>(Config.getPref().getList(HISTORY_KEY, new LinkedList<String>()));
    8181        Collections.reverse(cmtHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    8282        hcbUploadComment.setPossibleItems(cmtHistory);
     
    100100        hcbUploadSource.setToolTipText(tr("Enter a source"));
    101101        hcbUploadSource.setMaxTextLength(Changeset.MAX_CHANGESET_TAG_LENGTH);
    102         List<String> sourceHistory = new LinkedList<>(Main.pref.getList(SOURCE_HISTORY_KEY, getDefaultSources()));
     102        List<String> sourceHistory = new LinkedList<>(Config.getPref().getList(SOURCE_HISTORY_KEY, getDefaultSources()));
    103103        Collections.reverse(sourceHistory); // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    104104        hcbUploadSource.setPossibleItems(sourceHistory);
     
    166166        // store the history of comments
    167167        hcbUploadComment.addCurrentItemToHistory();
    168         Main.pref.putList(HISTORY_KEY, hcbUploadComment.getHistory());
    169         Main.pref.putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
     168        Config.getPref().putList(HISTORY_KEY, hcbUploadComment.getHistory());
     169        Config.getPref().putInt(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
    170170        // store the history of sources
    171171        hcbUploadSource.addCurrentItemToHistory();
    172         Main.pref.putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
     172        Config.getPref().putList(SOURCE_HISTORY_KEY, hcbUploadSource.getHistory());
    173173    }
    174174
Note: See TracChangeset for help on using the changeset viewer.