From 95344fdb7c1090f028cf026fd8d9c6f33ca1769d Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sat, 21 Apr 2012 15:13:57 +0000 Subject: [PATCH] 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. --- aegisub/src/spellchecker_hunspell.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aegisub/src/spellchecker_hunspell.cpp b/aegisub/src/spellchecker_hunspell.cpp index d1ed6ed60..df0be56a6 100644 --- a/aegisub/src/spellchecker_hunspell.cpp +++ b/aegisub/src/spellchecker_hunspell.cpp @@ -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);