Ignore:
Timestamp:
2009-11-01T09:22:27+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #3305: Version is UNKNOWN
see also howto create a JOSM build

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

Legend:

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

    r2358 r2369  
    699699        }
    700700        int v = Version.getInstance().getVersion();
    701         String s = ( v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);       
     701        String s = (v == Version.JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);   
     702        if (! Version.getInstance().isLocalBuild() && v != Version.JOSM_UNKNOWN_VERSION) {
     703            s += " SVN";
     704        } else if (Version.getInstance().isLocalBuild() && v != Version.JOSM_UNKNOWN_VERSION) {
     705            s += " Local";
     706        }
    702707        sysProp.put("http.agent", "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+")");
    703708        System.setProperties(sysProp);
  • trunk/src/org/openstreetmap/josm/data/Version.java

    r2358 r2369  
    77import java.io.IOException;
    88import java.io.InputStreamReader;
    9 import java.net.MalformedURLException;
    109import java.net.URL;
    1110import java.util.HashMap;
     
    1716
    1817/**
    19  * Provides basic information about JOSM build currently used.
     18 * Provides basic information about the currently used JOSM build.
    2019 *
    2120 */
     
    6766    private String revision;
    6867    private String time;
    69    
     68    private boolean isLocalBuild;
    7069   
    7170    protected HashMap<String, String> parseManifestStyleFormattedString(String content) {
     
    118117        }
    119118       
     119        // is this a local build ?
     120        //
     121        isLocalBuild = false;
     122        value = properties.get("Is-Local-Build");
     123        if (value != null && value.trim().toLowerCase().equals("true"))  {
     124            isLocalBuild = true;
     125        }
     126       
    120127        // the revision info
    121128        //
     
    149156    }
    150157   
    151     public String getRevision() {
     158    /**
     159     * Replies a text with the release attributes
     160     * 
     161     * @return a text with the release attributes
     162     */
     163    public String getReleaseAttributes() {
    152164        return revision;
    153165    }
    154166
     167    /**
     168     * Replies the build date as string
     169     *
     170     * @return the build date as string
     171     */
    155172    public String getTime() {
    156173        return time;
    157174    }
    158175   
     176    /**
     177     * Replies the JOSM version. Replies {@see #JOSM_UNKNOWN_VERSION} if the version isn't known.
     178     * @return the JOSM version
     179     */
    159180    public int getVersion() {
    160181        return version;
    161182    }
     183
     184    /**
     185     * Replies true if this is a local build, i.e. an inofficial development build.
     186     *
     187     * @return true if this is a local build, i.e. an inofficial development build.
     188     */
     189    public boolean isLocalBuild() {
     190        return isLocalBuild;
     191    }
    162192}
Note: See TracChangeset for help on using the changeset viewer.