Check if translated before copy to clipboard

This commit is contained in:
Gres 2020-03-28 14:31:11 +03:00
parent 258073c785
commit 9e72e67ee7

View File

@ -29,8 +29,10 @@ void Representer::clipboardLast()
SOFT_ASSERT(widget_->task(), return ); SOFT_ASSERT(widget_->task(), return );
const auto task = widget_->task(); const auto task = widget_->task();
QClipboard *clipboard = QApplication::clipboard(); QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(task->recognized + QLatin1String(" - ") + auto text = task->recognized;
task->translated); if (!task->translated.isEmpty())
text += QLatin1String(" - ") + task->translated;
clipboard->setText(text);
tray_.showInformation( tray_.showInformation(
QObject::tr("The last result was copied to the clipboard.")); QObject::tr("The last result was copied to the clipboard."));
} }