|
a/src/qtgui/ssearch_w.cpp |
|
b/src/qtgui/ssearch_w.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.8 2006-10-24 11:42:13 dockes Exp $ (C) 2006 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: ssearch_w.cpp,v 1.9 2006-10-30 12:59:44 dockes Exp $ (C) 2006 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
156 |
cs++;
|
156 |
cs++;
|
157 |
if (txt.size() == 0 || cs == txt.size()) {
|
157 |
if (txt.size() == 0 || cs == txt.size()) {
|
158 |
QApplication::beep();
|
158 |
QApplication::beep();
|
159 |
return;
|
159 |
return;
|
160 |
}
|
160 |
}
|
161 |
string s = txt.substr(cs);
|
161 |
string s = txt.substr(cs) + "*";
|
162 |
LOGDEB(("Completing: [%s]\n", s.c_str()));
|
162 |
LOGDEB(("Completing: [%s]\n", s.c_str()));
|
163 |
|
163 |
|
164 |
// Query database
|
164 |
// Query database
|
165 |
const int max = 100;
|
165 |
const int max = 100;
|
166 |
list<string> strs = rcldb->completions(s, prefs.queryStemLang.ascii(),max);
|
166 |
list<string> strs;
|
|
|
167 |
|
|
|
168 |
if (!rcldb->termMatch(Rcl::Db::ET_WILD, s, strs,
|
|
|
169 |
prefs.queryStemLang.ascii(),max)
|
167 |
if (strs.size() == 0) {
|
170 |
|| strs.size() == 0) {
|
168 |
QApplication::beep();
|
171 |
QApplication::beep();
|
169 |
return;
|
172 |
return;
|
170 |
}
|
173 |
}
|
171 |
if (strs.size() == (unsigned int)max) {
|
174 |
if (strs.size() == (unsigned int)max) {
|
172 |
QMessageBox::warning(0, "Recoll", tr("Too many completions"));
|
175 |
QMessageBox::warning(0, "Recoll", tr("Too many completions"));
|