Mark item as translated even on error (to show at least recognized text).

This commit is contained in:
Gres 2015-10-08 20:07:45 +03:00
parent e38449b928
commit 56a7469260
2 changed files with 7 additions and 3 deletions

View File

@ -71,7 +71,7 @@ void WebTranslator::proxyTranslated (const QString &text) {
item.translated = text;
emit translated (item);
}
finishTranslation ();
finishTranslation (false);
}
void WebTranslator::abortTranslation () {
@ -87,9 +87,13 @@ void WebTranslator::loadFinished (bool ok) {
}
}
void WebTranslator::finishTranslation () {
void WebTranslator::finishTranslation (bool markAsTranslated) {
translationTimeout_.stop ();
view_->stop ();
if (!queue_.isEmpty ()) {
if (markAsTranslated) {
emit translated (queue_.first ());
}
queue_.pop_front ();
}
isReady_ = true;

View File

@ -39,7 +39,7 @@ class WebTranslator : public QObject {
private:
void translateQueued ();
void runScriptForItem (const ProcessingItem &item);
void finishTranslation ();
void finishTranslation (bool markAsTranslated = true);
private:
WebTranslatorProxy *proxy_;