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


Ignore:
Timestamp:
2012-03-31T19:22:21+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #7311 - lower value of default plugin update interval: 30 days

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

Legend:

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

    r4310 r5145  
    2222import org.openstreetmap.josm.gui.JMultilineLabel;
    2323import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
     24import org.openstreetmap.josm.plugins.PluginHandler;
    2425
    2526/**
     
    192193            }
    193194            if (days <= 0) {
    194                 days = 60;
     195                days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    195196            }
    196197        }
    197198        if (days == 0) {
    198             days =Main.pref.getInteger("pluginmanager.time-based-update.interval", 60);
     199            days = Main.pref.getInteger("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    199200        }
    200201        tfUpdateInterval.setText(Integer.toString(days));
     
    230231            days = Integer.parseInt(tfUpdateInterval.getText().trim());
    231232            if (days <= 0) {
    232                 days = 60;
     233                days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    233234            }
    234235        } catch(NumberFormatException e) {
    235             days = 60;
     236            days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL;
    236237        }
    237238        Main.pref.putInteger("pluginmanager.time-based-update.interval", days);
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r5121 r5145  
    145145
    146146    final public static String [] UNMAINTAINED_PLUGINS = new String[] {"gpsbabelgui", "Intersect_way"};
     147   
     148    /**
     149     * Default time-based update interval, in days (pluginmanager.time-based-update.interval)
     150     */
     151    public static final int DEFAULT_TIME_BASED_UPDATE_INTERVAL = 30;
    147152
    148153    /**
     
    268273            long tim = System.currentTimeMillis();
    269274            long last = Main.pref.getLong("pluginmanager.lastupdate", 0);
    270             Integer maxTime = Main.pref.getInteger("pluginmanager.time-based-update.interval", 60);
     275            Integer maxTime = Main.pref.getInteger("pluginmanager.time-based-update.interval", DEFAULT_TIME_BASED_UPDATE_INTERVAL);
    271276            long d = (tim - last) / (24 * 60 * 60 * 1000l);
    272277            if ((last <= 0) || (maxTime <= 0)) {
Note: See TracChangeset for help on using the changeset viewer.