Commit a7940fbe authored by Olga Strizhenko's avatar Olga Strizhenko
Browse files

Spellchecker: (minor) cleanup FileLoader(String url)

parent c3aa704d
Branches unavailable Tags unavailable
No related merge requests found
Showing with 8 additions and 4 deletions
+8 -4
......@@ -35,6 +35,10 @@ public class FileLoader implements Loader {
this.name = name;
}
public FileLoader(String url) {
this(url, url);
}
@Override
public String getName() {
return name;
......
......@@ -91,7 +91,7 @@ public class SpellCheckerManager implements Disposable {
boolean customDic = FileUtilRt.extensionEquals(path, "dic") &&
settings.getDictionaryFoldersPaths().stream().anyMatch(dicFolderPath -> isAncestor(dicFolderPath, path, true));
if (customDic) {
spellChecker.loadDictionary(new FileLoader(path, path));
spellChecker.loadDictionary(new FileLoader(path));
restartInspections();
}
}
......@@ -103,7 +103,7 @@ public class SpellCheckerManager implements Disposable {
if (spellChecker.isDictionaryLoad(path)) {
spellChecker.removeDictionary(path);
spellChecker.loadDictionary(new FileLoader(path, path));
spellChecker.loadDictionary(new FileLoader(path));
restartInspections();
}
}
......@@ -146,7 +146,7 @@ public class SpellCheckerManager implements Disposable {
spellChecker.removeDictionary(s);
}
else if (!dictionaryIsLoad && dictionaryShouldBeLoad) {
spellChecker.loadDictionary(new FileLoader(s, s));
spellChecker.loadDictionary(new FileLoader(s));
}
});
}
......@@ -192,7 +192,7 @@ public class SpellCheckerManager implements Disposable {
for (String folder : settings.getDictionaryFoldersPaths()) {
SPFileUtil.processFilesRecursively(folder, s -> {
if (!disabledDictionaries.contains(s)) {
loaders.add(new FileLoader(s, s));
loaders.add(new FileLoader(s));
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment