Ignore:
Timestamp:
2009-10-31T13:15:29+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #3305: Version is UNKNOWN
fixed #3429: created_by=* includes the wrong language when uploading from a new layer

Location:
trunk/src/org/openstreetmap/josm/data
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r2334 r2358  
    3030
    3131import org.openstreetmap.josm.Main;
    32 import org.openstreetmap.josm.actions.AboutAction;
    3332import org.openstreetmap.josm.gui.preferences.ProxyPreferences;
    3433import org.openstreetmap.josm.tools.ColorHelper;
     34import org.openstreetmap.josm.tools.LanguageInfo;
    3535
    3636/**
     
    324324    public void save() throws IOException {
    325325        /* currently unused, but may help to fix configuration issues in future */
    326         properties.put("josm.version", AboutAction.getVersionString());
    327 
    328         setSystemProperties();
     326        properties.put("josm.version", Version.getInstance().getVersionString());
     327
     328        updateSystemProperties();
    329329        File prefFile = new File(getPreferencesDirFile(), "preferences");
    330330
     
    394394        if (!errLines.isEmpty())
    395395            throw new IOException(tr("Malformed config file at lines {0}", errLines));
    396         setSystemProperties();
     396        updateSystemProperties();
    397397    }
    398398
     
    679679            }
    680680        }
    681 
    682681        return put(key, s);
    683682    }
    684 
    685     private void setSystemProperties() {
     683   
     684    /**
     685     * Updates system properties with the current values in the preferences.
     686     *
     687     */
     688    public void updateSystemProperties() {
     689        Properties sysProp = System.getProperties();
    686690        if (getBoolean(ProxyPreferences.PROXY_ENABLE)) {
    687             Properties sysProp = System.getProperties();
    688691            sysProp.put("proxySet", "true");
    689692            sysProp.put("http.proxyHost", get(ProxyPreferences.PROXY_HOST));
     
    693696                sysProp.put("proxyPassword", get(ProxyPreferences.PROXY_PASS));
    694697            }
    695             System.setProperties(sysProp);
    696         }
    697         AboutAction.setUserAgent();
     698         
     699        }
     700        int v = Version.getInstance().getVersion();
     701        String s = ( v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);       
     702        sysProp.put("http.agent", "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+")");
     703        System.setProperties(sysProp);
    698704    }
    699705}
Note: See TracChangeset for help on using the changeset viewer.