Ignore:
Timestamp:
2017-09-13T16:30:27+02:00 (2 years ago)
Author:
bastiK
Message:

see #15229 - fix deprecations caused by [12840]

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
6 edited

Legend:

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

    r12711 r12841  
    4545    private URL url;
    4646    private final String requestMethod;
    47     private int connectTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.connect", 15));
    48     private int readTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInteger("socket.timeout.read", 30));
     47    private int connectTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.connect", 15));
     48    private int readTimeout = (int) TimeUnit.SECONDS.toMillis(Main.pref.getInt("socket.timeout.read", 30));
    4949    private byte[] requestBody;
    5050    private long ifModifiedSince;
    5151    private final Map<String, String> headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
    52     private int maxRedirects = Main.pref.getInteger("socket.maxredirects", 5);
     52    private int maxRedirects = Main.pref.getInt("socket.maxredirects", 5);
    5353    private boolean useCache;
    5454    private String reasonForRequest;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r12808 r12841  
    122122    public enum ImageSizes {
    123123        /** SMALL_ICON value of an Action */
    124         SMALLICON(Main.pref.getInteger("iconsize.smallicon", 16)),
     124        SMALLICON(Main.pref.getInt("iconsize.smallicon", 16)),
    125125        /** LARGE_ICON_KEY value of an Action */
    126         LARGEICON(Main.pref.getInteger("iconsize.largeicon", 24)),
     126        LARGEICON(Main.pref.getInt("iconsize.largeicon", 24)),
    127127        /** map icon */
    128         MAP(Main.pref.getInteger("iconsize.map", 16)),
     128        MAP(Main.pref.getInt("iconsize.map", 16)),
    129129        /** map icon maximum size */
    130         MAPMAX(Main.pref.getInteger("iconsize.mapmax", 48)),
     130        MAPMAX(Main.pref.getInt("iconsize.mapmax", 48)),
    131131        /** cursor icon size */
    132         CURSOR(Main.pref.getInteger("iconsize.cursor", 32)),
     132        CURSOR(Main.pref.getInt("iconsize.cursor", 32)),
    133133        /** cursor overlay icon size */
    134134        CURSOROVERLAY(CURSOR),
     
    142142         * @since 8323
    143143         */
    144         LAYER(Main.pref.getInteger("iconsize.layer", 16)),
     144        LAYER(Main.pref.getInt("iconsize.layer", 16)),
    145145        /** Toolbar button icon size
    146146         * @since 9253
     
    150150         * @since 9253
    151151         */
    152         SIDEBUTTON(Main.pref.getInteger("iconsize.sidebutton", 20)),
     152        SIDEBUTTON(Main.pref.getInt("iconsize.sidebutton", 20)),
    153153        /** Settings tab icon size
    154154         * @since 9253
    155155         */
    156         SETTINGS_TAB(Main.pref.getInteger("iconsize.settingstab", 48)),
     156        SETTINGS_TAB(Main.pref.getInt("iconsize.settingstab", 48)),
    157157        /**
    158158         * The default image size
    159159         * @since 9705
    160160         */
    161         DEFAULT(Main.pref.getInteger("iconsize.default", 24)),
     161        DEFAULT(Main.pref.getInt("iconsize.default", 24)),
    162162        /**
    163163         * Splash dialog logo size
     
    10131013     */
    10141014    private static ImageResource getIfAvailableWiki(String name, ImageType type) {
    1015         final Collection<String> defaultBaseUrls = Arrays.asList(
     1015        final List<String> defaultBaseUrls = Arrays.asList(
    10161016                "https://wiki.openstreetmap.org/w/images/",
    10171017                "https://upload.wikimedia.org/wikipedia/commons/",
    10181018                "https://wiki.openstreetmap.org/wiki/File:"
    10191019                );
    1020         final Collection<String> baseUrls = Main.pref.getCollection("image-provider.wiki.urls", defaultBaseUrls);
     1020        final Collection<String> baseUrls = Main.pref.getList("image-provider.wiki.urls", defaultBaseUrls);
    10211021
    10221022        final String fn = name.substring(name.lastIndexOf('/') + 1);
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java

    r12830 r12841  
    5151    @Override
    5252    public void openUrl(String url) throws IOException {
    53         for (String program : Main.pref.getCollection("browser.unix",
     53        for (String program : Main.pref.getList("browser.unix",
    5454                Arrays.asList("xdg-open", "#DESKTOP#", "$BROWSER", "gnome-open", "kfmclient openURL", "firefox"))) {
    5555            try {
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r12748 r12841  
    170170    // create a shortcut object from an string as saved in the preferences
    171171    private Shortcut(String prefString) {
    172         List<String> s = new ArrayList<>(Main.pref.getCollection(prefString));
     172        List<String> s = new ArrayList<>(Main.pref.getList(prefString));
    173173        this.shortText = prefString.substring(15);
    174174        this.longText = s.get(0);
     
    182182
    183183    private void saveDefault() {
    184         Main.pref.getCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     184        Main.pref.getList("shortcut.entry."+shortText, Arrays.asList(longText,
    185185            String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(requestedKey),
    186186            String.valueOf(getGroupModifier(requestedGroup)), String.valueOf(true), String.valueOf(false)));
     
    190190    private boolean save() {
    191191        if (isAutomatic() || isReset() || !isAssignedUser()) {
    192             return Main.pref.putCollection("shortcut.entry."+shortText, null);
     192            return Main.pref.putList("shortcut.entry."+shortText, null);
    193193        } else {
    194             return Main.pref.putCollection("shortcut.entry."+shortText, Arrays.asList(longText,
     194            return Main.pref.putList("shortcut.entry."+shortText, Arrays.asList(longText,
    195195                String.valueOf(requestedKey), String.valueOf(requestedGroup), String.valueOf(assignedKey),
    196196                String.valueOf(assignedModifier), String.valueOf(assignedDefault), String.valueOf(assignedUser)));
  • trunk/src/org/openstreetmap/josm/tools/TextTagParser.java

    r12683 r12841  
    2020
    2121    // properties need JOSM restart to apply, modified rarely enough
    22     private static final int MAX_KEY_LENGTH = Main.pref.getInteger("tags.paste.max-key-length", 50);
    23     private static final int MAX_KEY_COUNT = Main.pref.getInteger("tags.paste.max-key-count", 30);
     22    private static final int MAX_KEY_LENGTH = Main.pref.getInt("tags.paste.max-key-length", 50);
     23    private static final int MAX_KEY_COUNT = Main.pref.getInt("tags.paste.max-key-count", 30);
    2424    private static final String KEY_PATTERN = Main.pref.get("tags.paste.tag-pattern", "[0-9a-zA-Z:_]*");
    2525    private static final int MAX_VALUE_LENGTH = 255;
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r12830 r12841  
    12461246     */
    12471247    public static ForkJoinPool newForkJoinPool(String pref, final String nameFormat, final int threadPriority) {
    1248         int noThreads = Main.pref.getInteger(pref, Runtime.getRuntime().availableProcessors());
     1248        int noThreads = Main.pref.getInt(pref, Runtime.getRuntime().availableProcessors());
    12491249        return new ForkJoinPool(noThreads, new ForkJoinPool.ForkJoinWorkerThreadFactory() {
    12501250            final AtomicLong count = new AtomicLong(0);
Note: See TracChangeset for help on using the changeset viewer.