[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:23:40 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=57de7ad

The following commit has been merged in the master branch:
commit 57de7ad0583392f1ef533d2fffa5b0b2897b5c02
Author: Eugene Shalygin <eugene.shalygin at gmail.com>
Date:   Thu Mar 28 11:55:08 2013 +0000

    Fix set of spell cheking language during configuration loading
    
    REVIEW: 109771
    BUG: 317428
---
 lib/chat-widget.cpp | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 8df51c1..5787940 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -140,11 +140,13 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
     connect(d->ui.chatArea, SIGNAL(zoomFactorChanged(qreal)), SIGNAL(zoomFactorChanged(qreal)));
     initChatArea();
 
-    loadSpellCheckingOption();
-
     d->pausedStateTimer = new QTimer(this);
     d->pausedStateTimer->setSingleShot(true);
 
+    // Spellchecking set up will trigger textChanged() signal of d->ui.sendMessageBox
+    // and our handler checks state of the timer created above.
+    loadSpellCheckingOption();
+
     // make the sendMessageBox a focus proxy for the chatview
     d->ui.chatArea->setFocusProxy(d->ui.sendMessageBox);
 
@@ -942,13 +944,21 @@ void ChatWidget::saveSpellCheckingOption()
 
 void ChatWidget::loadSpellCheckingOption()
 {
+    // KTextEdit::setSpellCheckingLanguage() (see call below) does not do anything if there
+    // is no highlighter created yet, and KTextEdit::setCheckSpellingEnabled() does not create
+    // it if there is no focus on widget.
+    // Therefore d->ui.sendMessageBox->setSpellCheckingLanguage() call below would be is ignored.
+    // While this looks like KTextEditor bug (espesially taking into account its documentation),
+    // just a call to KTextEditor::createHighlighter() before setting language fixes this
+    d->ui.sendMessageBox->createHighlighter();
+
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktp-text-uirc"));
     KConfigGroup configGroup = config->group(d->channel->targetId());
     QString spellCheckingLanguage;
     if (configGroup.exists()) {
         spellCheckingLanguage = configGroup.readEntry("language");
     } else {
-	spellCheckingLanguage = Sonnet::Speller().defaultLanguage();
+        spellCheckingLanguage = Sonnet::Speller().defaultLanguage();
     }
     d->ui.sendMessageBox->setSpellCheckingLanguage(spellCheckingLanguage);
 }

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list