The mentioned message reads :
Can not enumerate files '/usr/share/myspell/dicts/th*.dat' (error 2: No such file or directory)
This is from the patch to the SpellChecker plugin to make it search the system for resources; the warnings can be removed with:
Index: src/plugins/contrib/SpellChecker/Thesaurus.cpp
===================================================================
--- src/plugins/contrib/SpellChecker/Thesaurus.cpp (revision 8322)
+++ src/plugins/contrib/SpellChecker/Thesaurus.cpp (working copy)
@@ -58,12 +58,17 @@
else
{
Manager::Get()->GetLogManager()->Log(_T("SpellChecker: Thesaurus files '") + idxpath + _T("' not found!"));
- wxString altIdx = wxFindFirstFile(idxpath.BeforeLast(wxT('.')) + wxT("*.idx"), wxFILE); // "*_v2.idx"
+ wxString altIdx;
+ {
+ wxLogNull logno;
+ altIdx = wxFindFirstFile(idxpath.BeforeLast(wxT('.')) + wxT("*.idx"), wxFILE); // "*_v2.idx"
+ }
if (altIdx.IsEmpty()) // try again with more wildcards
{
altIdx = idxpath.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.')) + wxT("*.idx");
altIdx.Replace(wxT("_"), wxT("*"));
altIdx.Replace(wxT("-"), wxT("*"));
+ wxLogNull logno;
altIdx = wxFindFirstFile(idxpath.BeforeLast(wxFILE_SEP_PATH) + wxFILE_SEP_PATH + altIdx, wxFILE);
}
if (altIdx.IsEmpty()) // try to find the thesaurus of a related language (something is better than nothing)
@@ -72,6 +77,7 @@
altIdx.Replace(wxT("_"), wxT("*"));
altIdx.Replace(wxT("-"), wxT("*"));
altIdx = altIdx.BeforeLast(wxT('*')) + wxT("*.idx");
+ wxLogNull logno;
altIdx = wxFindFirstFile(idxpath.BeforeLast(wxFILE_SEP_PATH) + wxFILE_SEP_PATH + altIdx, wxFILE);
}
@@ -81,6 +87,7 @@
altDat = datpath.AfterLast(wxFILE_SEP_PATH).BeforeLast(wxT('.')) + wxT("*.dat");
altDat.Replace(wxT("_"), wxT("*"));
altDat.Replace(wxT("-"), wxT("*"));
+ wxLogNull logno;
altDat = wxFindFirstFile(datpath.BeforeLast(wxFILE_SEP_PATH) + wxFILE_SEP_PATH + altDat, wxFILE);
}
if (altDat.IsEmpty()) // try to find the thesaurus of a related language (something is better than nothing)
@@ -89,6 +96,7 @@
altDat.Replace(wxT("_"), wxT("*"));
altDat.Replace(wxT("-"), wxT("*"));
altDat = altDat.BeforeLast(wxT('*')) + wxT("*.dat");
+ wxLogNull logno;
altDat = wxFindFirstFile(datpath.BeforeLast(wxFILE_SEP_PATH) + wxFILE_SEP_PATH + altDat, wxFILE);
}
Index: src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp
===================================================================
--- src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp (revision 8322)
+++ src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp (working copy)
@@ -139,6 +139,7 @@
dictPaths.Add(m_pPlugin->GetOnlineCheckerConfigPath());
for (size_t i = 0; i < dictPaths.GetCount(); ++i)
{
+ wxLogNull logno;
if (!wxFindFirstFile(dictPaths[i] + wxFILE_SEP_PATH + wxT("*.dic"), wxFILE).IsEmpty())
return dictPaths[i];
}
@@ -172,6 +173,7 @@
thesPaths.Add(m_pPlugin->GetOnlineCheckerConfigPath());
for (size_t i = 0; i < thesPaths.GetCount(); ++i)
{
+ wxLogNull logno;
if (!wxFindFirstFile(thesPaths[i] + wxFILE_SEP_PATH + wxT("th*.dat"), wxFILE).IsEmpty())
return thesPaths[i];
}
Index: src/plugins/contrib/SpellChecker/Thesaurus.cpp
===================================================================
--- src/plugins/contrib/SpellChecker/Thesaurus.cpp (revision 8330)
+++ src/plugins/contrib/SpellChecker/Thesaurus.cpp (working copy)
@@ -58,6 +58,8 @@
else
{
Manager::Get()->GetLogManager()->Log(_T("SpellChecker: Thesaurus files '") + idxpath + _T("' not found!"));
+ if (!wxDirExists(idxpath.BeforeLast(wxFILE_SEP_PATH)) || !wxDirExists(datpath.BeforeLast(wxFILE_SEP_PATH)))
+ return; // path does not exist, silence invalid directory warnings
wxString altIdx = wxFindFirstFile(idxpath.BeforeLast(wxT('.')) + wxT("*.idx"), wxFILE); // "*_v2.idx"
if (altIdx.IsEmpty()) // try again with more wildcards
{
Index: src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp
===================================================================
--- src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp (revision 8330)
+++ src/plugins/contrib/SpellChecker/SpellCheckerConfig.cpp (working copy)
@@ -139,7 +139,7 @@
dictPaths.Add(m_pPlugin->GetOnlineCheckerConfigPath());
for (size_t i = 0; i < dictPaths.GetCount(); ++i)
{
- if (!wxFindFirstFile(dictPaths[i] + wxFILE_SEP_PATH + wxT("*.dic"), wxFILE).IsEmpty())
+ if (wxDirExists(dictPaths[i]) && !wxFindFirstFile(dictPaths[i] + wxFILE_SEP_PATH + wxT("*.dic"), wxFILE).IsEmpty())
return dictPaths[i];
}
return dictPaths[0];
@@ -172,7 +172,7 @@
thesPaths.Add(m_pPlugin->GetOnlineCheckerConfigPath());
for (size_t i = 0; i < thesPaths.GetCount(); ++i)
{
- if (!wxFindFirstFile(thesPaths[i] + wxFILE_SEP_PATH + wxT("th*.dat"), wxFILE).IsEmpty())
+ if (wxDirExists(thesPaths[i]) && !wxFindFirstFile(thesPaths[i] + wxFILE_SEP_PATH + wxT("th*.dat"), wxFILE).IsEmpty())
return thesPaths[i];
}
return thesPaths[0];
@@ -181,9 +181,9 @@
{
wxString bitmPath = m_BitmPath;
Manager::Get()->GetMacrosManager()->ReplaceEnvVars(bitmPath);
- if (wxFindFirstFile(bitmPath + wxFILE_SEP_PATH + wxT("*.png"), wxFILE).IsEmpty())
- return m_pPlugin->GetOnlineCheckerConfigPath();
- return bitmPath;
+ if (wxDirExists(bitmPath) && !wxFindFirstFile(bitmPath + wxFILE_SEP_PATH + wxT("*.png"), wxFILE).IsEmpty())
+ return bitmPath;
+ return m_pPlugin->GetOnlineCheckerConfigPath();
}
const wxString SpellCheckerConfig::GetRawDictionaryPath()const{return m_DictPath;}