Ignore:
Timestamp:
2006-03-28T23:37:37+02:00 (18 years ago)
Author:
imi
Message:

changed Preferences system to more flexible one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/io/RawCsvReader.java

    r71 r74  
    3030        public Collection<LatLon> parse() throws JDOMException, IOException {
    3131                Collection<LatLon> data = new LinkedList<LatLon>();
    32                 String formatStr = Main.pref.csvImportString;
     32                String formatStr = Main.pref.get("csvImportString");
    3333                if (formatStr == null)
    3434                        formatStr = in.readLine();
     
    5252                // test for completness
    5353                if (!format.contains("lat") || !format.contains("lon")) {
    54                         if (Main.pref.csvImportString != null)
    55                                 throw new JDOMException("Format string is incomplete. Need at least 'lat' and 'lon' specification");
    56                         throw new JDOMException("Format string in data is incomplete or not found. Try setting an manual format string in Preferences.");
     54                        if (Main.pref.get("csvImportString").equals(""))
     55                                throw new JDOMException("Format string in data is incomplete or not found. Try setting an manual format string in Preferences.");
     56                        throw new JDOMException("Format string is incomplete. Need at least 'lat' and 'lon' specification");
    5757                }
    5858               
     
    7171                                                st.nextToken();
    7272                                        else
    73                                                 throw new JDOMException("Unknown data type: '"+token+"'."+(Main.pref.csvImportString == null ? " Maybe add an format string in preferences." : ""));
     73                                                throw new JDOMException("Unknown data type: '"+token+"'."+(Main.pref.get("csvImportString").equals("") ? " Maybe add an format string in preferences." : ""));
    7474                                }
    7575                                data.add(new LatLon(lat, lon));
Note: See TracChangeset for help on using the changeset viewer.