Skip to content

Commit

Permalink
set default languages to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
David Baum committed Jul 4, 2018
1 parent 2d7c13f commit 555d445
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions config/translator_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <KSharedConfig>
#include <KPluginFactory>
#include <krunner/abstractrunner.h>
#include <QtDebug>

K_PLUGIN_FACTORY(TranslatorConfigFactory, registerPlugin<TranslatorConfig>("kcm_krunner_translator");)

Expand Down Expand Up @@ -62,8 +63,8 @@ void TranslatorConfig::load()
KConfigGroup grp = cfg->group("Runners");
grp = KConfigGroup(&grp, "Translator");

int indexPrimary = m_abbr.indexOf(grp.readEntry(CONFIG_PRIMARY));
int indexSecondary = m_abbr.indexOf(grp.readEntry(CONFIG_SECONDARY));
int indexPrimary = m_abbr.indexOf(grp.readEntry(CONFIG_PRIMARY, "en"));
int indexSecondary = m_abbr.indexOf(grp.readEntry(CONFIG_SECONDARY, "es"));
m_ui->primaryLanguage->setCurrentIndex(indexPrimary);
m_ui->secondaryLanguage->setCurrentIndex(indexSecondary);
m_ui->yandexKey->setText(grp.readEntry(CONFIG_YANDEX_KEY));
Expand Down
2 changes: 1 addition & 1 deletion plasma-runner-translator.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ X-KDE-Library=krunner_translator
X-KDE-PluginInfo-Author=David Baum
X-KDE-PluginInfo-Email=david.baum@naraesk.eu
X-KDE-PluginInfo-Name=Translator
X-KDE-PluginInfo-Version= 1.1.0
X-KDE-PluginInfo-Version= 1.1.1
X-KDE-PluginInfo-License=GPL
X-KDE-PluginInfo-EnabledByDefault=true
X-Plasma-AdvertiseSingleRunnerQueryMode=true

0 comments on commit 555d445

Please sign in to comment.