From 092c5e65ca3b805947cba4aea32fae3eccb19aa9 Mon Sep 17 00:00:00 2001 From: Gres Date: Sun, 12 Jul 2020 15:28:40 +0300 Subject: [PATCH] Select first item of source languages if none is selected --- src/settingseditor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/settingseditor.cpp b/src/settingseditor.cpp index fcc51dd..6270b6a 100644 --- a/src/settingseditor.cpp +++ b/src/settingseditor.cpp @@ -353,7 +353,11 @@ void SettingsEditor::updateModels(const QString &tessdataPath) { const auto source = ui->tesseractLangCombo->currentText(); models_.update(tessdataPath); - ui->tesseractLangCombo->setCurrentText(source); + if (!source.isEmpty()) { + ui->tesseractLangCombo->setCurrentText(source); + } else if (ui->tesseractLangCombo->count() > 0) { + ui->tesseractLangCombo->setCurrentIndex(0); + } } void SettingsEditor::pickColor(ColorContext context)