| Summary: | Incorrect options at ASPELL spell checker | ||
|---|---|---|---|
| Product: | [Unmaintained] kdelibs | Reporter: | Peter Tselios <ptselios> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Peter Tselios
2006-02-21 21:46:19 UTC
Kate has no hidden options. I'll look into fixing it for Kate 2.5.2. Dear Anders,
This is a **quick** answer! That's why I said "hidden" and not hidden!
SVN commit 512373 by alund:
* Use HTML type for docbook and PHP
* Attempt to use the document encoding if supported by KSpell, though KSpell seems to be so full of errors that this is redundant :-( (but maybe some can be fixed)
CCBUG: 122448
M +16 -2 katespell.cpp
--- branches/KDE/3.5/kdelibs/kate/part/katespell.cpp #512372:512373
@@ -29,6 +29,7 @@
#include <kaction.h>
#include <kstdaction.h>
#include <kspell.h>
+#include <ksconfig.h>
#include <kdebug.h>
#include <kmessagebox.h>
@@ -102,11 +103,24 @@
KSpell::SpellerType type = KSpell::Text;
if ( mt == "text/x-tex" || mt == "text/x-latex" )
type = KSpell::TeX;
- else if ( mt == "text/html" || mt == "text/xml" )
+ else if ( mt == "text/html" || mt == "text/xml" || mt == "text/docbook" || mt == "application/x-php")
type = KSpell::HTML;
+ KSpellConfig *ksc = new KSpellConfig;
+ QStringList ksEncodings;
+ ksEncodings << "US-ASCII" << "ISO 8859-1" << "ISO 8859-2" << "ISO 8859-3"
+ << "ISO 8859-4" << "ISO 8859-5" << "ISO 8859-7" << "ISO 8859-8"
+ << "ISO 8859-9" << "ISO 8859-13" << "ISO 8859-15" << "UTF-8"
+ << "KOI8-R" << "KOI8-U" << "CP1251" << "CP1255";
+
+ int enc = ksEncodings.findIndex( m_view->doc()->encoding() );
+ if ( enc > -1 )
+ ksc->setEncoding( enc );
+
+ kdDebug(13020)<<"KateSpell::spellCheck(): using encoding: "<<enc<<" ("<<ksEncodings[enc]<<") and KSpell::Type "<<type<<" (for '"<<mt<<"')"<<endl;
+
m_kspell = new KSpell( m_view, i18n("Spellcheck"),
- this, SLOT(ready(KSpell *)), 0, true, true, type );
+ this, SLOT(ready(KSpell *)), ksc, true, true, type );
connect( m_kspell, SIGNAL(death()),
this, SLOT(spellCleanDone()) );
Seems to work, not sure, please reopen, if not... |