[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: unifying libkdenetwork/syntaxhighlighter and
From: Scott Wheeler <wheeler () kde ! org>
Date: 2003-09-03 9:56:53
[Download RAW message or body]
Here's another leftover from the conference that it would be nice to slip
under the feature freeze thing. :-)
This one's pretty simple -- kdeui/ksyntaxhighlighter was based on the similar
class in libkdenetwork. The APIs are still the same except for one method,
which I'm including in this patch.
One of these is being used for KMail and KNode, the other for KHTML and
friends.
I'd like to apply the attached patches to KMail, KNode and the class in
kdelibs, and remove the one from kdenetwork.
Objections?
-Scott
--
The world is full of magical things patiently waiting for our wits to grow
sharper.
--Bertrand Russell
["kdepim.patch" (text/x-diff)]
? korganizer/korgac/alarmguiiface.h
? korganizer/korgac/alarmguiiface.kidl
? korganizer/korgac/alarmguiiface_skel.cpp
? korganizer/korgac/korgac
? korganizer/korgac/simplealarmdaemon
Index: kmail/kmcomposewin.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/kmcomposewin.cpp,v
retrieving revision 1.727
diff -u -3 -p -r1.727 kmcomposewin.cpp
--- kmail/kmcomposewin.cpp 31 Aug 2003 18:30:02 -0000 1.727
+++ kmail/kmcomposewin.cpp 3 Sep 2003 09:31:45 -0000
@@ -67,9 +67,7 @@ using KRecentAddress::RecentAddresses;
#include <kspell.h>
#include <kspelldlg.h>
#include <spellingfilter.h>
-#include <syntaxhighlighter.h>
-using Syntaxhighlighter::DictSpellChecker;
-using Syntaxhighlighter::SpellChecker;
+#include <ksyntaxhighlighter.h>
#include <qtabdialog.h>
#include <qregexp.h>
@@ -5781,7 +5779,7 @@ KMEdit::KMEdit(QWidget *parent, KMCompos
QColor col3 = config->readColorEntry( "QuotedText2", &defaultColor2 );
QColor col4 = config->readColorEntry( "QuotedText1", &defaultColor1 );
QColor c = QColor("red");
- mSpellChecker = new DictSpellChecker(this, /*active*/ true, /*autoEnabled*/ true,
+ mSpellChecker = new KDictSpellingHighlighter(this, /*active*/ true, /*autoEnabled*/ true,
/*spellColor*/ config->readColorEntry("NewMessage", &c),
/*colorQuoting*/ true, col1, col2, col3, col4);
connect( mSpellChecker, SIGNAL(activeChanged(const QString &)),
@@ -5999,7 +5997,7 @@ void KMEdit::spellcheck()
spellLineEdit = !spellLineEdit;
mKSpell = new KSpell(this, i18n("Spellcheck - KMail"), this,
SLOT(slotSpellcheck2(KSpell*)));
- QStringList l = SpellChecker::personalWords();
+ QStringList l = KSpellingHighlighter::personalWords();
for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
mKSpell->addPersonal( *it );
}
@@ -6109,7 +6107,7 @@ void KMEdit::slotSpellResult(const QStri
}
}
mKSpell->cleanUp();
- DictSpellChecker::dictionaryChanged();
+ KDictSpellingHighlighter::dictionaryChanged();
emit spellcheck_done( dlgResult );
}
Index: kmail/kmcomposewin.h
===================================================================
RCS file: /home/kde/kdepim/kmail/kmcomposewin.h,v
retrieving revision 1.212
diff -u -3 -p -r1.212 kmcomposewin.h
--- kmail/kmcomposewin.h 28 Aug 2003 16:33:10 -0000 1.212
+++ kmail/kmcomposewin.h 3 Sep 2003 09:31:45 -0000
@@ -44,10 +44,6 @@ class _StringPair {
QString value;
};
-namespace Syntaxhighlighter {
- class DictSpellChecker;
-}
-
class QCloseEvent;
class QComboBox;
class QFrame;
@@ -66,6 +62,7 @@ class KProcess;
class KSelectAction;
class KSpell;
class KSpellConfig;
+class KDictSpellingHighlighter;
class KStatusBar;
class KAction;
class KToggleAction;
@@ -146,7 +143,7 @@ private:
bool extEditor;
QString mExtEditor;
bool mWasModifiedBeforeSpellCheck;
- Syntaxhighlighter::DictSpellChecker *mSpellChecker;
+ KDictSpellingHighlighter *mSpellChecker;
bool spellLineEdit;
};
Index: knode/kncomposer.cpp
===================================================================
RCS file: /home/kde/kdepim/knode/kncomposer.cpp,v
retrieving revision 1.177
diff -u -3 -p -r1.177 kncomposer.cpp
--- knode/kncomposer.cpp 28 Aug 2003 19:53:05 -0000 1.177
+++ knode/kncomposer.cpp 3 Sep 2003 09:31:46 -0000
@@ -43,13 +43,11 @@ using KRecentAddress::RecentAddresses;
#include <kpgpblock.h>
#include <kprocess.h>
#include <kqcstringsplitter.h>
-#include <syntaxhighlighter.h>
+#include <ksyntaxhighlighter.h>
#include <qcursor.h>
#include <kurldrag.h>
#include <kcompletionbox.h>
-using Syntaxhighlighter::DictSpellChecker;
-using Syntaxhighlighter::SpellChecker;
#include <kapplication.h>
#include "kngroupselectdialog.h"
#include "utilities.h"
@@ -1289,7 +1287,7 @@ void KNComposer::slotSpellcheck()
a_ctSpellCheck->setEnabled(false);
s_pellChecker = new KSpell(this, i18n("Spellcheck"), this, SLOT(slotSpellStarted(KSpell *)));
- QStringList l = SpellChecker::personalWords();
+ QStringList l = KSpellingHighlighter::personalWords();
for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
s_pellChecker->addPersonal( *it );
}
@@ -1587,7 +1585,7 @@ void KNComposer::slotSpellDone(const QSt
}
}
s_pellChecker->cleanUp();
- DictSpellChecker::dictionaryChanged();
+ KDictSpellingHighlighter::dictionaryChanged();
}
@@ -1744,7 +1742,7 @@ KNComposer::ComposerView::ComposerView(K
QColor col3 = config->readColorEntry( "quote2Color", &defaultColor2 );
QColor col4 = config->readColorEntry( "quote1Color", &defaultColor1 );
QColor c = QColor("red");
- mSpellChecker = new DictSpellChecker(e_dit, /*active*/ true, /*autoEnabled*/ true,
+ mSpellChecker = new KDictSpellingHighlighter(e_dit, /*active*/ true, /*autoEnabled*/ true,
/*spellColor*/ config->readColorEntry("NewMessage", &c),
/*colorQuoting*/ true, col1, col2, col3, col4);
connect( mSpellChecker, SIGNAL(newSuggestions(const QString&, const QStringList&, unsigned int)),
@@ -2346,7 +2344,7 @@ void KNComposer::Editor::contentsContext
else
{
spell = new KSpell(this, i18n("Spellcheck"), this, SLOT(slotSpellStarted(KSpell *)));
- QStringList l = SpellChecker::personalWords();
+ QStringList l = KSpellingHighlighter::personalWords();
for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
spell->addPersonal( *it );
}
Index: knode/kncomposer.h
===================================================================
RCS file: /home/kde/kdepim/knode/kncomposer.h,v
retrieving revision 1.64
diff -u -3 -p -r1.64 kncomposer.h
--- knode/kncomposer.h 28 Aug 2003 19:53:05 -0000 1.64
+++ knode/kncomposer.h 3 Sep 2003 09:31:46 -0000
@@ -41,6 +41,7 @@ class QGroupBox;
class KProcess;
class KSpell;
+class KDictSpellingHighlighter;
class KSelectAction;
class KToggleAction;
@@ -48,14 +49,6 @@ class KNLocalArticle;
class KNAttachment;
class SpellingFilter;
-namespace Syntaxhighlighter {
- class DictSpellChecker;
-}
-
-
-
-
-
class KNComposer : public KMainWindow , virtual public KNodeComposerIface {
Q_OBJECT
@@ -253,7 +246,7 @@ class KNComposer::ComposerView : public
QPushButton *a_ttAddBtn,
*a_ttRemoveBtn,
*a_ttEditBtn;
- Syntaxhighlighter::DictSpellChecker *mSpellChecker;
+ KDictSpellingHighlighter *mSpellChecker;
bool v_iewOpen;
};
Index: libkdenetwork/Makefile.am
===================================================================
RCS file: /home/kde/kdepim/libkdenetwork/Makefile.am,v
retrieving revision 1.46
diff -u -3 -p -r1.46 Makefile.am
--- libkdenetwork/Makefile.am 11 Jul 2003 21:03:14 -0000 1.46
+++ libkdenetwork/Makefile.am 3 Sep 2003 09:31:46 -0000
@@ -44,7 +44,6 @@ libkdenetwork_la_SOURCES = kscoring.cpp
kfoldertree.cpp \
ksubscription.cpp \
kaccount.cpp \
- syntaxhighlighter.cpp \
spellingfilter.cpp \
linklocator.cpp \
recentaddresses.cpp
["ksyntaxhighlighter.patch" (text/x-diff)]
? kspellui.cpp
? kspellui.h
Index: ksyntaxhighlighter.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ksyntaxhighlighter.cpp,v
retrieving revision 1.8
diff -u -3 -p -r1.8 ksyntaxhighlighter.cpp
--- ksyntaxhighlighter.cpp 19 Jun 2003 16:04:02 -0000 1.8
+++ ksyntaxhighlighter.cpp 3 Sep 2003 09:41:34 -0000
@@ -375,6 +375,11 @@ void KDictSpellingHighlighter::dictionar
delete oldMonitor;
}
+void KDictSpellingHighlighter::restartBackgroundSpellCheck()
+{
+ slotDictionaryChanged();
+}
+
void KDictSpellingHighlighter::slotRehighlight()
{
rehighlight();
Index: ksyntaxhighlighter.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ksyntaxhighlighter.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 ksyntaxhighlighter.h
--- ksyntaxhighlighter.h 19 Jun 2003 16:04:02 -0000 1.3
+++ ksyntaxhighlighter.h 3 Sep 2003 09:41:34 -0000
@@ -100,6 +100,7 @@ public:
virtual bool isMisspelled( const QString &word );
static void dictionaryChanged();
+ void restartBackgroundSpellCheck();
signals:
void activeChanged(const QString &);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic