/*! \return translation text for corresponding Translation object */
QString toHtml() const {
QString trans;
- trans = _tr->toHtml();
+ trans = _tr->toXml();
return trans;
-
}
};
//Install default config files
ConfigGenerator confGen;
- confGen.generateCss(_dir + "style.css");
+ ///confGen.generateCss(_dir + "style.css");
confGen.generateDefaultConfig(_configPath);
loadPrefs(_configPath);
loadDicts(_configPath);
connect(&_resultWatcher, SIGNAL(finished()), this, SLOT(translationReady()));
- connect(&_htmlResultWatcher, SIGNAL(finished()), this,
- SLOT(htmlTranslationReady()));
+ connect(&_xmlResultWatcher, SIGNAL(finished()), this,
+ SLOT(xmlTranslationReady()));
connect(&_bookmarkWatcher, SIGNAL(finished()), this,
SLOT(bookmarksListReady()));
connect(&_bookmarkSearchWatcher, SIGNAL(finished()), this,
SLOT(translationReady()));
// In common opinion perfect thread count is cores_number+1 (in qt perfect
- // thread count is set to cores number)
+ // thread count is set to cores number) so iam changin it
QThreadPool::globalInstance()->setMaxThreadCount(
QThreadPool::globalInstance()->maxThreadCount()+1);
while(it2.hasNext())
delete it2.next().value();
+ delete _history;
}
foreach(CommonDictInterface* dict, _dicts.keys())
dict->stop();
stopped = true;
- _innerHtmlResult.cancel();
+ _innerXmlResult.cancel();
_innerResult.cancel();
Q_EMIT searchCanceled();
}
void Backbone::quit() {
stopSearching();
+ usleep(100);
Q_EMIT closeOk();
}
if(!exists) {
_plugins.append(plugin);
plugin->retranslate();
+ connect(plugin, SIGNAL(notify(Notify::NotifyType,QString)),
+ this, SIGNAL(notify(Notify::NotifyType,QString)));
}
}
}
// For convienence this function is called for each change in dictionaries
// and each call dumps configuration for all dictionaries into file.
- // Maybe better way would be to store new/changed configuration but
+ // Maybe a better way would be to store new/changed configuration but
// parsing settings file and figuring out what was changed, in my opinion,
// would take more time
_history->setMaxSize(_historyLen);
-QStringList Backbone::htmls() {
- return _htmlResult;
+QStringList Backbone::xmls() {
+ return _xmlResult;
}
-void Backbone::searchHtml(QList<Translation *> translations) {
- _htmlResult.clear();
+void Backbone::searchXml(QList<Translation *> translations) {
+ _xmlResult.clear();
QList<TranslationPtr> dummy;
stopped = false;
foreach(Translation* tr, translations) {
if(containsDict(tr->dict()) || !tr->dict())
dummy.append(TranslationPtr(tr));
- /* foreach(CommonDictInterface* dict, activeDicts()) {
- Translation* trans = dict->getTranslationFor(tr->key());
- if(trans)
- dummy.append(TranslationPtr(trans));
- } */
}
if(translations.size()>0) {
Translation *tr = translations.at(0);
}
}
- _innerHtmlResult = QtConcurrent::mapped(dummy,
+ _innerXmlResult = QtConcurrent::mapped(dummy,
&TranslationPtr::toHtml);
- _htmlResultWatcher.setFuture(_innerHtmlResult);
+ _xmlResultWatcher.setFuture(_innerXmlResult);
}
-void Backbone::htmlTranslationReady() {
+void Backbone::xmlTranslationReady() {
- QFutureIterator<QString> it(_innerHtmlResult);
+ QFutureIterator<QString> it(_innerXmlResult);
QSet<QString> uniqe;
while(it.hasNext())
uniqe.insert(it.next());
- _htmlResult.clear();
- _htmlResult = uniqe.toList();
+ _xmlResult.clear();
+ _xmlResult = uniqe.toList();
if(!stopped)
- Q_EMIT htmlReady();
+ Q_EMIT xmlReady();
}