-void Backbone::search(QString word) {
+void Backbone::search(QStringList words) {
_timer.stop();
_result.clear();
_innerResult.clear();
_timer.start(_interval);
- foreach(CommonDictInterface* dict, _dicts.keys())
- if(_dicts[dict] == 1) {
- QFuture<QList<Translation*> > tr =
- QtConcurrent::run(dict,
+ foreach(QString word, words)
+ foreach(CommonDictInterface* dict, _dicts.keys())
+ if(_dicts[dict] == 1) {
+ QFuture<QList<Translation*> > tr =
+ QtConcurrent::run(dict,
&CommonDictInterface::searchWordList,word,
searchLimit());
- _innerResult.append(tr);
- }
+ _innerResult.append(tr);
+ }
}
void stopSearching();
/*! search for a word translation
- \param word word to be translated
+ \param word list of words to be translated
*/
- void search(QString word);
+ void search(QStringList word);
/*! sets active dictionaries (searches are performed only in active dicts
\param List of dictionaris to be activated
}
qDebug() << "main " << this->thread()->currentThreadId();
- back->search("pigwa");
+ QStringList list;
+ list << "pigwa";
+
+ back->search(list);
usleep(2000);
for(int i = 0; i < total; i++) {
QTime time;
time.start();
- back->search("nic");
+ QStringList list;
+ list << "nic";
+ back->search(list);
qDebug() << "Time for backbone.search: " << time.elapsed();
usleep(2000);
time.start();