Always write user dictionaries to ?user/dictionaries

The value of Path/Dictionary is not guaranteed to be writable, and on
linux is likely to not be.

Originally committed to SVN as r6713.
This commit is contained in:
Thomas Goyne 2012-04-21 15:13:57 +00:00
parent fb5f94ca74
commit 95344fdb7c

View file

@ -212,15 +212,15 @@ void HunspellSpellChecker::OnLanguageChanged() {
std::string language = OPT_GET("Tool/Spell Checker/Language")->GetString();
if (language.empty()) return;
wxString userDicRoot = StandardPaths::DecodePath(lagi_wxString(OPT_GET("Path/Dictionary")->GetString()));
wxString custDicRoot = StandardPaths::DecodePath(lagi_wxString(OPT_GET("Path/Dictionary")->GetString()));
wxString dataDicRoot = StandardPaths::DecodePath("?data/dictionaries");
// If the user has a dic/aff pair in their dictionary path for this language
// use that; otherwise use the one from Aegisub's install dir, adding words
// from the dic in the user's dictionary path if it exists
wxString affPath = wxString::Format("%s/%s.aff", userDicRoot, language);
wxString dicPath = wxString::Format("%s/%s.dic", userDicRoot, language);
userDicPath = wxString::Format("%s/user_%s.dic", userDicRoot, language);
wxString affPath = wxString::Format("%s/%s.aff", custDicRoot, language);
wxString dicPath = wxString::Format("%s/%s.dic", custDicRoot, language);
userDicPath = wxString::Format("%s/user_%s.dic", StandardPaths::DecodePath("?user/dictionaries"), language);
if (!wxFileExists(affPath) || !wxFileExists(dicPath)) {
affPath = wxString::Format("%s/%s.aff", dataDicRoot, language);
dicPath = wxString::Format("%s/%s.dic", dataDicRoot, language);