[graphics/drawy/gsoc2026] src/gui/common/utils: fix: fallback to default language when language can't be guessed

Abdelhadi Wael <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit bfe43d0463c28345d2c306d245226a94ed27b41d by Abdelhadi Wael.
Committed on 16/07/2026 at 22:06.
Pushed by mlaurent into branch 'gsoc2026'.

fix: fallback to default language when language can't be guessed

M  +4    -0    src/gui/common/utils/spellcheckhighlighter.cpp

https://invent.kde.org/graphics/drawy/-/commit/bfe43d0463c28345d2c306d245226a94ed27b41d

diff --git a/src/gui/common/utils/spellcheckhighlighter.cpp b/src/gui/common/utils/spellcheckhighlighter.cpp
index 15a03ad4..bd4324fc 100644
--- a/src/gui/common/utils/spellcheckhighlighter.cpp
+++ b/src/gui/common/utils/spellcheckhighlighter.cpp
@@ -30,6 +30,8 @@ bool SpellCheckHighlighter::isMisspelled(const QString &word, const QString &blo
         const QString guessed = m_languageGuesser.identify(block, m_settings->preferredLanguages());
         if (!guessed.isEmpty()) {
             m_speller.setLanguage(guessed);
+        } else {
+            m_speller.setLanguage(m_settings->defaultLanguage());
         }
     } else {
         m_speller.setLanguage(m_settings->defaultLanguage());
@@ -86,6 +88,8 @@ void SpellCheckHighlighter::highlightBlock(const QString &text)
         const QString guessed = m_languageGuesser.identify(text, m_settings->preferredLanguages());
         if (!guessed.isEmpty()) {
             m_speller.setLanguage(guessed);
+        } else {
+            m_speller.setLanguage(m_settings->defaultLanguage());
         }
     } else {
         m_speller.setLanguage(m_settings->defaultLanguage());
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.