Ignore:
Timestamp:
2014-01-05T20:09:34+01:00 (10 years ago)
Author:
simon04
Message:

fix #9539 - *.cfg tag checker: display when custom files are loaded together with their type (tag checker, ignore tags, spellchecker)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r6593 r6638  
    135135    protected static final Entities entities = new Entities();
    136136
     137    static final List<String> DEFAULT_SOURCES = Arrays.asList(DATA_FILE, IGNORE_FILE, SPELL_FILE);
     138
    137139    /**
    138140     * Constructor
     
    167169       
    168170        String errorSources = "";
    169         for (String source : Main.pref.getCollection(PREF_SOURCES, Arrays.asList(DATA_FILE, IGNORE_FILE, SPELL_FILE))) {
     171        for (String source : Main.pref.getCollection(PREF_SOURCES, DEFAULT_SOURCES)) {
    170172            BufferedReader reader = null;
    171173            try {
     
    176178                boolean tagcheckerfile = false;
    177179                boolean ignorefile = false;
     180                boolean isFirstLine = true;
    178181                String line;
    179182                while ((line = reader.readLine()) != null && (tagcheckerfile || line.length() != 0)) {
     
    181184                        if (line.startsWith("# JOSM TagChecker")) {
    182185                            tagcheckerfile = true;
    183                         }
     186                            if (!DEFAULT_SOURCES.contains(source)) {
     187                                Main.info(tr("Adding {0} to tag checker", source));
     188                            }
     189                        } else
    184190                        if (line.startsWith("# JOSM IgnoreTags")) {
    185191                            ignorefile = true;
     192                            if (!DEFAULT_SOURCES.contains(source)) {
     193                                Main.info(tr("Adding {0} to ignore tags", source));
     194                            }
    186195                        }
    187                         continue;
    188196                    } else if (ignorefile) {
    189197                        line = line.trim();
     
    208216                            ignoreDataKeyPair.add(tmp);
    209217                        }
    210                         continue;
    211218                    } else if (tagcheckerfile) {
    212219                        if (line.length() > 0) {
     
    226233                    } else {
    227234                        Main.error(tr("Invalid spellcheck line: {0}", line));
     235                    }
     236                    if (isFirstLine) {
     237                        isFirstLine = false;
     238                        if (!(tagcheckerfile || ignorefile) && !DEFAULT_SOURCES.contains(source)) {
     239                            Main.info(tr("Adding {0} to spellchecker", source));
     240                        }
    228241                    }
    229242                }
Note: See TracChangeset for help on using the changeset viewer.