Changeset 5865 in josm
- Timestamp:
- 2013-04-14T23:32:18+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r5761 r5865 315 315 cacheDirFile = new File(path).getAbsoluteFile(); 316 316 } else { 317 path = Main.pref.get("cache.folder", null);317 path = get("cache.folder", null); 318 318 if (path != null) { 319 319 cacheDirFile = new File(path); … … 339 339 public Collection<String> getAllPossiblePreferenceDirs() { 340 340 LinkedList<String> locations = new LinkedList<String>(); 341 locations.add( Main.pref.getPreferencesDir());341 locations.add(getPreferencesDir()); 342 342 String s; 343 343 if ((s = System.getenv("JOSM_RESOURCES")) != null) { … … 1319 1319 public void updateSystemProperties() { 1320 1320 updateSystemProperty("http.agent", Version.getInstance().getAgentString()); 1321 updateSystemProperty("user.language", Main.pref.get("language"));1321 updateSystemProperty("user.language", get("language")); 1322 1322 // Workaround to fix a Java bug. 1323 1323 // Force AWT toolkit to update its internal preferences (fix #3645). -
trunk/src/org/openstreetmap/josm/gui/MainApplet.java
r5829 r5865 102 102 String lang = getParameter("language"); 103 103 I18n.set(lang != null ? lang : Main.pref.get("language", null)); 104 Main.pref.updateSystemProperties(); 104 105 105 106 try … … 132 133 133 134 Main.preConstructorInit(Option.fromStringMap(args)); 135 Main.pref.updateSystemProperties(); 134 136 Main.parent = frame; 135 137 -
trunk/src/org/openstreetmap/josm/gui/io/TagSettingsPanel.java
r3746 r5865 13 13 14 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.data.Version; 15 16 import org.openstreetmap.josm.data.osm.Changeset; 16 17 import org.openstreetmap.josm.gui.tagging.TagEditorPanel; … … 44 45 build(); 45 46 pnlTagEditor.getModel().addTableModelListener(this); 46 }47 48 /**49 * Replies the default value for "created_by"50 *51 * @return the default value for "created_by"52 */53 public static String getDefaultCreatedBy() {54 Object ua = System.getProperties().get("http.agent");55 return(ua == null) ? "JOSM" : ua.toString();56 47 } 57 48 … … 93 84 tags.put("comment", currentComment); 94 85 } 86 String agent = Version.getInstance().getAgentString(); 95 87 String created_by = tags.get("created_by"); 96 if (created_by == null || "".equals(created_by)) {97 tags.put("created_by", getDefaultCreatedBy());98 } else if (!created_by.contains( getDefaultCreatedBy())) {99 tags.put("created_by", created_by + ";" + getDefaultCreatedBy());88 if (created_by == null || created_by.isEmpty()) { 89 tags.put("created_by", agent); 90 } else if (!created_by.contains(agent)) { 91 tags.put("created_by", created_by + ";" + agent); 100 92 } 101 93 pnlTagEditor.getModel().initFromTags(tags);
Note:
See TracChangeset
for help on using the changeset viewer.