|
a/src/qtgui/ssearch_w.cpp |
|
b/src/qtgui/ssearch_w.cpp |
|
... |
|
... |
82 |
}
|
82 |
}
|
83 |
|
83 |
|
84 |
void SSearch::timerDone()
|
84 |
void SSearch::timerDone()
|
85 |
{
|
85 |
{
|
86 |
QString qs = queryText->currentText();
|
86 |
QString qs = queryText->currentText();
|
87 |
LOGDEB0(("SSearch::timerDone: qs [%s]\n", qs2utf8s(qs).c_str()));
|
87 |
LOGDEB1(("SSearch::timerDone: qs [%s]\n", qs2utf8s(qs).c_str()));
|
88 |
searchTextChanged(qs);
|
88 |
searchTextChanged(qs);
|
89 |
}
|
89 |
}
|
90 |
|
90 |
|
91 |
void SSearch::searchTextChanged(const QString& text)
|
91 |
void SSearch::searchTextChanged(const QString& text)
|
92 |
{
|
92 |
{
|
93 |
QString qs = queryText->currentText();
|
93 |
QString qs = queryText->currentText();
|
94 |
LOGDEB0(("SSearch::searchTextChanged. ks %d qs [%s]\n",
|
94 |
LOGDEB1(("SSearch::searchTextChanged. ks %d qs [%s]\n",
|
95 |
m_keystroke, qs2utf8s(text).c_str()));
|
95 |
m_keystroke, qs2utf8s(text).c_str()));
|
96 |
if (text.isEmpty()) {
|
96 |
if (text.isEmpty()) {
|
97 |
searchPB->setEnabled(false);
|
97 |
searchPB->setEnabled(false);
|
98 |
clearqPB->setEnabled(false);
|
98 |
clearqPB->setEnabled(false);
|
99 |
queryText->setFocus();
|
99 |
queryText->setFocus();
|
|
... |
|
... |
107 |
if (prefs.ssearchAsYouType && !m_disableAutosearch &&
|
107 |
if (prefs.ssearchAsYouType && !m_disableAutosearch &&
|
108 |
!m_keystroke && m_tstartqs == qs) {
|
108 |
!m_keystroke && m_tstartqs == qs) {
|
109 |
m_disableAutosearch = true;
|
109 |
m_disableAutosearch = true;
|
110 |
string s;
|
110 |
string s;
|
111 |
int cs = partialWord(s);
|
111 |
int cs = partialWord(s);
|
112 |
LOGDEB0(("SSearch::searchTextChanged: autosearch. cs %d s [%s]\n",
|
112 |
LOGDEB1(("SSearch::searchTextChanged: autosearch. cs %d s [%s]\n",
|
113 |
cs, s.c_str()));
|
113 |
cs, s.c_str()));
|
114 |
if (cs < 0) {
|
114 |
if (cs < 0) {
|
115 |
startSimpleSearch();
|
115 |
startSimpleSearch();
|
116 |
} else if (!m_stroketimeout->isActive() && s.size() >= 2) {
|
116 |
} else if (!m_stroketimeout->isActive() && s.size() >= 2) {
|
117 |
s = qs2utf8s(queryText->currentText());
|
117 |
s = qs2utf8s(queryText->currentText());
|