Check if translated before copy to clipboard
This commit is contained in:
parent
258073c785
commit
9e72e67ee7
@ -29,8 +29,10 @@ void Representer::clipboardLast()
|
||||
SOFT_ASSERT(widget_->task(), return );
|
||||
const auto task = widget_->task();
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
clipboard->setText(task->recognized + QLatin1String(" - ") +
|
||||
task->translated);
|
||||
auto text = task->recognized;
|
||||
if (!task->translated.isEmpty())
|
||||
text += QLatin1String(" - ") + task->translated;
|
||||
clipboard->setText(text);
|
||||
tray_.showInformation(
|
||||
QObject::tr("The last result was copied to the clipboard."));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user