Switch to unified view

a/src/qtgui/ssearch_w.cpp b/src/qtgui/ssearch_w.cpp
...
...
124
124
125
    trimstring(u8);
125
    trimstring(u8);
126
    if (u8.length() == 0)
126
    if (u8.length() == 0)
127
    return;
127
    return;
128
128
129
    string stemlang = prefs.stemlang();
130
129
    SSearchType tp = (SSearchType)searchTypCMB->currentIndex();
131
    SSearchType tp = (SSearchType)searchTypCMB->currentIndex();
130
    Rcl::SearchData *sdata = 0;
132
    Rcl::SearchData *sdata = 0;
131
133
132
    if (tp == SST_LANG) {
134
    if (tp == SST_LANG) {
133
    string reason;
135
    string reason;
134
        if (prefs.autoSuffsEnable)
136
        if (prefs.autoSuffsEnable)
135
            sdata = wasaStringToRcl(theconfig, u8, reason, 
137
            sdata = wasaStringToRcl(theconfig, stemlang, u8, reason, 
136
                    (const char *)prefs.autoSuffs.toUtf8());
138
                    (const char *)prefs.autoSuffs.toUtf8());
137
        else
139
        else
138
            sdata = wasaStringToRcl(theconfig, u8, reason);
140
            sdata = wasaStringToRcl(theconfig, stemlang, u8, reason);
139
    if (sdata == 0) {
141
    if (sdata == 0) {
140
        QMessageBox::warning(0, "Recoll", tr("Bad query string") + ": " +
142
        QMessageBox::warning(0, "Recoll", tr("Bad query string") + ": " +
141
                 QString::fromAscii(reason.c_str()));
143
                 QString::fromAscii(reason.c_str()));
142
        return;
144
        return;
143
    }
145
    }
144
    } else {
146
    } else {
145
    sdata = new Rcl::SearchData(Rcl::SCLT_OR);
147
    sdata = new Rcl::SearchData(Rcl::SCLT_OR, stemlang);
146
    if (sdata == 0) {
148
    if (sdata == 0) {
147
        QMessageBox::warning(0, "Recoll", tr("Out of memory"));
149
        QMessageBox::warning(0, "Recoll", tr("Out of memory"));
148
        return;
150
        return;
149
    }
151
    }
150
    Rcl::SearchDataClause *clp = 0;
152
    Rcl::SearchDataClause *clp = 0;
...
...
164
    }
166
    }
165
    sdata->addClause(clp);
167
    sdata->addClause(clp);
166
    }
168
    }
167
169
168
    if (prefs.ssearchAutoPhrase && rcldb) {
170
    if (prefs.ssearchAutoPhrase && rcldb) {
169
  string stemLang = (const char *)prefs.queryStemLang.toAscii();
170
  if (stemLang == "ALL") {
171
      theconfig->getConfParam("indexstemminglanguages", stemLang);
172
  }
173
  sdata->setStemlang(stemLang);
174
    sdata->maybeAddAutoPhrase(*rcldb, 
171
    sdata->maybeAddAutoPhrase(*rcldb, 
175
                  prefs.ssearchAutoPhraseThreshPC / 100.0);
172
                  prefs.ssearchAutoPhraseThreshPC / 100.0);
176
    }
173
    }
177
174
178
    // Search terms history
175
    // Search terms history
...
...
275
    LOGDEB(("Completing: [%s]\n", s.c_str()));
272
    LOGDEB(("Completing: [%s]\n", s.c_str()));
276
273
277
    // Query database
274
    // Query database
278
    const int max = 100;
275
    const int max = 100;
279
    Rcl::TermMatchResult tmres;
276
    Rcl::TermMatchResult tmres;
280
    string stemLang = (const char *)prefs.queryStemLang.toAscii();
277
281
    if (stemLang == "ALL") {
278
    string stemLang = prefs.stemlang();
282
  theconfig->getConfParam("indexstemminglanguages", stemLang);
279
283
    }
284
    if (!rcldb->termMatch(Rcl::Db::ET_WILD, stemLang, s, tmres, max) || 
280
    if (!rcldb->termMatch(Rcl::Db::ET_WILD, stemLang, s, tmres, max) || 
285
    tmres.entries.size() == 0) {
281
    tmres.entries.size() == 0) {
286
    QApplication::beep();
282
    QApplication::beep();
287
    return;
283
    return;
288
    }
284
    }