[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    KDE/kdelibs
From:       Michel Ludwig <michel.ludwig () gmail ! com>
Date:       2010-08-29 9:13:39
Message-ID: 20100829091339.44418AC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1169440 by mludwig:

- Add a 'restore' method to 'Sonnet::BackgroundChecker', which allows it to read a \
given spell check configuration and then to pass it on to the filter object that is \
used internally. The implementation is similar to what is done inside \
                'Sonnet::Highlighter'.
- Use the restore method inside KatePart to finally fix bug 244907 for KatePart as \
well.

(Once this is merged with Kate's git repository, Kate devs will have to update their \
working copy of kdelibs.)

BUG: 244907
CCMAIL: kwrite-devel@kde.org



 M  +8 -0      kate/spellcheck/ontheflycheck.cpp  
 M  +1 -3      kate/spellcheck/spellcheckdialog.cpp  
 M  +8 -0      kdecore/sonnet/backgroundchecker.cpp  
 M  +3 -0      kdecore/sonnet/backgroundchecker.h  


--- trunk/KDE/kdelibs/kate/spellcheck/ontheflycheck.cpp #1169439:1169440
@@ -59,6 +59,10 @@
           this, SLOT(updateConfig()));
   connect(document, SIGNAL(respellCheckBlock(KateDocument*, int, int)),
           this, SLOT(handleRespellCheckBlock(KateDocument*, int, int)));
+
+  // load the settings for the speller
+  updateConfig();
+
   foreach(KTextEditor::View* view, document->views()) {
     addView(document, view);
   }
@@ -406,6 +410,7 @@
             this,
             SLOT(misspelling(const QString&,int)));
     connect(m_backgroundChecker, SIGNAL(done()), this, SLOT(spellCheckDone()));
+    m_backgroundChecker->restore(KGlobal::config().data());
   }
   m_backgroundChecker->setSpeller(m_speller);
   m_backgroundChecker->setText(text); // don't call 'start()' after this!
@@ -664,7 +669,10 @@
 {
   ON_THE_FLY_DEBUG;
   m_speller.restore(KGlobal::config().data());
+  if(m_backgroundChecker) {
+    m_backgroundChecker->restore(KGlobal::config().data());
 }
+}
 
 void KateOnTheFlyChecker::refreshSpellCheck(const KTextEditor::Range &range)
 {
--- trunk/KDE/kdelibs/kate/spellcheck/spellcheckdialog.cpp #1169439:1169440
@@ -110,15 +110,13 @@
   {
     m_speller = new Sonnet::Speller();
   }
-  else
-  {
     m_speller->restore(KGlobal::config().data());
-  }
 
   if ( !m_backgroundChecker )
   {
     m_backgroundChecker = new Sonnet::BackgroundChecker(*m_speller);
   }
+  m_backgroundChecker->restore(KGlobal::config().data());
 
   if ( !m_sonnetDialog )
   {
--- trunk/KDE/kdelibs/kdecore/sonnet/backgroundchecker.cpp #1169439:1169440
@@ -23,6 +23,7 @@
 #include "loader_p.h"
 #include "backgroundengine_p.h"
 #include "filter_p.h"
+#include "settings_p.h"
 
 #include <kdebug.h>
 
@@ -64,6 +65,13 @@
     delete d;
 }
 
+void BackgroundChecker::restore(KConfig *config)
+{
+    Loader *loader = Loader::openLoader();
+    loader->settings()->restore(config);
+    d->engine->filter()->setSettings(loader->settings());
+}
+
 void BackgroundChecker::setText(const QString &text)
 {
     d->currentText = text;
--- trunk/KDE/kdelibs/kdecore/sonnet/backgroundchecker.h #1169439:1169440
@@ -76,6 +76,9 @@
         bool checkWord(const QString &word);
         QStringList suggest(const QString &word) const;
         bool addWordToPersonal(const QString &word);
+
+        void restore(KConfig *config);
+
     public Q_SLOTS:
         virtual void start();
         virtual void stop();
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic