ProcessingItem finishes its way to Manager even if there are errors on the way.

This commit is contained in:
Gres 2015-10-10 19:05:38 +03:00
parent b6461fa3a9
commit 811b232c81
2 changed files with 3 additions and 2 deletions

View File

@ -63,6 +63,7 @@ void Recognizer::recognize (ProcessingItem item) {
QString language = (isCustomLanguage) ? item.ocrLanguage : ocrLanguage_;
if (engine == NULL) {
if (!initEngine (engine, language)) {
emit recognized (item);
return;
}
}
@ -82,9 +83,9 @@ void Recognizer::recognize (ProcessingItem item) {
if (!result.isEmpty ()) {
item.recognized = recognizerHelper_->substitute (result, language);
emit recognized (item);
}
else {
emit error (tr ("Текст не распознан."));
}
emit recognized (item);
}

View File

@ -46,7 +46,7 @@ void WebTranslator::addProxyToView () {
}
void WebTranslator::translate (ProcessingItem item) {
if (item.translateLanguage.isEmpty ()) {
if (!item.isValid () || item.translateLanguage.isEmpty ()) {
emit translated (item);
return;
}