stopsuffixes: old user value if set overrides new variable
This commit is contained in:
parent
2dafff9a8c
commit
4da2e34b2f
@ -611,7 +611,7 @@ bool RclConfig::inStopSuffixes(const string& fni)
|
|||||||
// Beware: both needrecompute() need to be called always hence the
|
// Beware: both needrecompute() need to be called always hence the
|
||||||
// bizarre way we do things
|
// bizarre way we do things
|
||||||
bool needrecompute = m_stpsuffstate.needrecompute();
|
bool needrecompute = m_stpsuffstate.needrecompute();
|
||||||
needrecompute = needrecompute || m_oldstpsuffstate.needrecompute();
|
needrecompute = m_oldstpsuffstate.needrecompute() || needrecompute;
|
||||||
if (needrecompute || m_stopsuffixes == 0) {
|
if (needrecompute || m_stopsuffixes == 0) {
|
||||||
// Need to initialize the suffixes
|
// Need to initialize the suffixes
|
||||||
delete STOPSUFFIXES;
|
delete STOPSUFFIXES;
|
||||||
@ -619,12 +619,15 @@ bool RclConfig::inStopSuffixes(const string& fni)
|
|||||||
LOGERR(("RclConfig::inStopSuffixes: out of memory\n"));
|
LOGERR(("RclConfig::inStopSuffixes: out of memory\n"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// Let the old customisation have priority: if recoll_noindex
|
||||||
|
// from mimemap is set, it the user's (the default value is
|
||||||
|
// gone). Else use the new variable
|
||||||
vector<string> stoplist;
|
vector<string> stoplist;
|
||||||
stringToStrings(m_stpsuffstate.savedvalue, stoplist);
|
if (!m_oldstpsuffstate.savedvalue.empty()) {
|
||||||
vector<string> ostoplist;
|
stringToStrings(m_oldstpsuffstate.savedvalue, stoplist);
|
||||||
stringToStrings(m_oldstpsuffstate.savedvalue, ostoplist);
|
} else {
|
||||||
stoplist.resize(stoplist.size() + ostoplist.size());
|
stringToStrings(m_stpsuffstate.savedvalue, stoplist);
|
||||||
stoplist.insert(stoplist.end(), ostoplist.begin(), ostoplist.end());
|
}
|
||||||
for (vector<string>::const_iterator it = stoplist.begin();
|
for (vector<string>::const_iterator it = stoplist.begin();
|
||||||
it != stoplist.end(); it++) {
|
it != stoplist.end(); it++) {
|
||||||
STOPSUFFIXES->insert(SfString(stringtolower(*it)));
|
STOPSUFFIXES->insert(SfString(stringtolower(*it)));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user