Changeset 13064 in josm


Ignore:
Timestamp:
2017-10-30T23:58:23+01:00 (3 weeks ago)
Author:
Don-vip
Message:

remove legacy properties (pluginmanager.warntime and osm-server.atomic-upload) kind-of-deprecated 8 years ago in r2569 and r2924

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r12854 r13064  
    2525import org.openstreetmap.josm.plugins.PluginHandler;
    2626import org.openstreetmap.josm.spi.preferences.Config;
    27 import org.openstreetmap.josm.tools.Logging;
    2827
    2928/**
     
    184183                .setSelected(true);
    185184
    186         String pref = Config.getPref().get("pluginmanager.warntime", null);
    187         int days = 0;
    188         if (pref != null) {
    189             // remove legacy preference
    190             Config.getPref().put("pluginmanager.warntime", null);
    191             try {
    192                 days = Integer.parseInt(pref.trim());
    193             } catch (NumberFormatException e) {
    194                 // ignore - load from preference pluginmanager.time-based-update.interval
    195                 Logging.trace(e);
    196             }
    197             if (days <= 0) {
    198                 days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    199             }
    200         }
    201         if (days == 0) {
    202             days = Config.getPref().getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    203         }
     185        int days = Config.getPref().getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    204186        tfUpdateInterval.setText(Integer.toString(days));
    205187    }
  • trunk/src/org/openstreetmap/josm/io/UploadStrategy.java

    r12894 r13064  
    66import java.util.Locale;
    77
    8 import org.openstreetmap.josm.data.PreferencesUtils;
    98import org.openstreetmap.josm.spi.preferences.Config;
    109import org.openstreetmap.josm.tools.Logging;
     
    6867     * Replies the upload strategy currently configured in the preferences.
    6968     *
    70      * First checks for the preference key <pre>osm-server.upload-strategy</pre>. If not
    71      * present, checks for the legacy preference key <pre>osm-server.atomic-upload</pre>.
     69     * Checks for the preference key <pre>osm-server.upload-strategy</pre>.
    7270     *
    73      * If both are missing or if the preference value is illegal, {@link #DEFAULT_UPLOAD_STRATEGY}
     71     * If missing or if the preference value is illegal, {@link #DEFAULT_UPLOAD_STRATEGY}
    7472     * is replied.
    7573     *
     
    7977        String v = Config.getPref().get("osm-server.upload-strategy", null);
    8078        if (v == null) {
    81             // legacy support. Until 12/2009 we had osm-server.atomic-upload only.
    82             // If we still find "osm-server.atomic-upload" we use it and remove it.
    83             // When the preferences are saved the next time, "osm-server.upload-strategy"
    84             // will be inserted.
    85             v = Config.getPref().get("osm-server.atomic-upload", null);
    86             if (v != null) {
    87                 PreferencesUtils.removeFromList(Config.getPref(), "osm-server.atomic-upload", v);
    88             } else {
    89                 v = "";
    90             }
    91             v = v.trim().toLowerCase(Locale.ENGLISH);
    92             if ("true".equals(v))
    93                 return SINGLE_REQUEST_STRATEGY;
    94             else if ("false".equals(v))
    95                 return INDIVIDUAL_OBJECTS_STRATEGY;
    96             else
    97                 return DEFAULT_UPLOAD_STRATEGY;
     79            return DEFAULT_UPLOAD_STRATEGY;
    9880        }
    9981        UploadStrategy strategy = fromPreference(v);
Note: See TracChangeset for help on using the changeset viewer.