Ignore:
Timestamp:
2016-11-20T17:33:33+01:00 (2 years ago)
Author:
simon04
Message:

see #13376 - Use TimeUnit instead of combinations of 1000/60/60/24

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

Legend:

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

    r10611 r11288  
    1616import java.util.LinkedList;
    1717import java.util.List;
     18import java.util.concurrent.TimeUnit;
    1819
    1920import javax.swing.Action;
     
    149150        hcbUploadComment.addCurrentItemToHistory();
    150151        Main.pref.putCollection(HISTORY_KEY, hcbUploadComment.getHistory());
    151         Main.pref.putInteger(HISTORY_LAST_USED_KEY, (int) (System.currentTimeMillis() / 1000));
     152        Main.pref.putInteger(HISTORY_LAST_USED_KEY, (int) (TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())));
    152153        // store the history of sources
    153154        hcbUploadSource.addCurrentItemToHistory();
  • trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java

    r10791 r11288  
    2525import java.util.Map;
    2626import java.util.Map.Entry;
     27import java.util.concurrent.TimeUnit;
    2728
    2829import javax.swing.AbstractAction;
     
    640641        Collection<String> history = Main.pref.getCollection(historyKey, def);
    641642        int age = (int) (System.currentTimeMillis() / 1000 - Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_LAST_USED_KEY, 0));
    642         if (age < Main.pref.getInteger(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, 4 * 3600 * 1000) && history != null && !history.isEmpty()) {
     643        if (age < Main.pref.getLong(BasicUploadSettingsPanel.HISTORY_MAX_AGE_KEY, TimeUnit.HOURS.toMillis(4)) && history != null && !history.isEmpty()) {
    643644            return history.iterator().next();
    644645        } else {
Note: See TracChangeset for help on using the changeset viewer.