Commit 7cc349a1 authored by Stefano Crocco's avatar Stefano Crocco Committed by David Faure
Browse files

Perform spellchecker setup on creation

BUG: 434173
parent 281b65ac
Pipeline #116936 passed with stage
in 4 minutes and 19 seconds
......@@ -33,6 +33,9 @@ SpellCheckerManager::SpellCheckerManager(QWebEngineProfile *profile, QObject *pa
m_dictionaryDir = QString(WEBENGINEPART_DICTIONARY_DIR);
connect(KonqSpellCheckingConfigurationDispatcher::self(), &KonqSpellCheckingConfigurationDispatcher::spellCheckingConfigurationChanged,
this, &SpellCheckerManager::updateConfiguration);
KSharedConfigPtr cfg = KSharedConfig::openConfig();
KConfigGroup grp = cfg->group("General");
updateConfiguration(grp.readEntry("SpellCheckingEnabled", false));
}
SpellCheckerManager::~SpellCheckerManager()
......@@ -70,17 +73,6 @@ void SpellCheckerManager::updateConfiguration(bool spellCheckingEnabled)
m_profile->setSpellCheckLanguages(m_enabledDicts);
}
void SpellCheckerManager::setup()
{
if (m_setupDone) {
return;
}
m_setupDone = true;
KSharedConfigPtr cfg = KSharedConfig::openConfig();
KConfigGroup grp = cfg->group("General");
updateConfiguration(grp.readEntry("SpellCheckingEnabled", false));
}
QMenu * SpellCheckerManager::spellCheckingMenu(const QStringList &suggestions, KActionCollection* coll, WebEnginePage* page)
{
QMenu *menu = new QMenu();
......
......@@ -31,8 +31,6 @@ public:
QMenu *spellCheckingMenu(const QStringList &suggestions, KActionCollection *coll, WebEnginePage *page);
void setup();
public slots:
void updateConfiguration(bool spellCheckingEnabled);
......@@ -45,7 +43,6 @@ private slots:
void spellCheckingToggled(bool on);
private:
bool m_setupDone = false;
QString m_dictionaryDir;
QMap<QString, QString> m_dicts;
QStringList m_enabledDicts;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment