• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • sources
  • kde-4.14
  • kdelibs
  • kde3support
  • kdeui
k3sconfig.cpp
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 1997 David Sweet <dsweet@kde.org>
3  Copyright (C) 2000-2001 Wolfram Diestel <wolfram@steloj.de>
4  Copyright (C) 2007-2008 Kevin Kofler <Kevin@tigcc.ticalc.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #include "k3sconfig.h"
22 
23 #include <QtGui/QCheckBox>
24 #include <QtGui/QComboBox>
25 #include <QtGui/QLabel>
26 #include <QtGui/QLayout>
27 #include <QtCore/QFileInfo>
28 #include <QtCore/QDir>
29 
30 #include <ktoolinvocation.h>
31 #include <kconfig.h>
32 #include <kdebug.h>
33 #include <kdialog.h>
34 #include <kglobal.h>
35 #include <kguiitem.h>
36 #include <klineedit.h>
37 #include <klocale.h>
38 #include <kpushbutton.h>
39 #include <kstandardguiitem.h>
40 
41 #include <config.h>
42 #include <kconfiggroup.h>
43 
44 class K3SpellConfigPrivate
45 {
46 public:
47  QStringList replacelist;
48 };
49 
50 
51 K3SpellConfig::K3SpellConfig (const K3SpellConfig &_ksc)
52  : QWidget(0), nodialog(true)
53  , cb0(0)
54  , cb1(0)
55  , cb2(0)
56  , dictlist(0)
57  , dictcombo(0)
58  , encodingcombo(0)
59  , clientcombo(0)
60  , d(new K3SpellConfigPrivate)
61 {
62  kDebug(750) << "Entering K3SpellConfig::K3SpellConfig(K3SpellConfig&)";
63  setDoSpellChecking( _ksc.doSpellChecking() );
64  setReplaceAllList( _ksc.replaceAllList() );
65  setNoRootAffix( _ksc.noRootAffix() );
66  setRunTogether( _ksc.runTogether() );
67  setDictionary( _ksc.dictionary() );
68  setDictFromList( _ksc.dictFromList() );
69  // setPersonalDict (_ksc.personalDict());
70  setIgnoreList( _ksc.ignoreList() );
71  setEncoding( _ksc.encoding() );
72  setClient( _ksc.client() );
73 }
74 
75 
76 K3SpellConfig::K3SpellConfig( QWidget *parent,
77  K3SpellConfig *_ksc, bool addHelpButton )
78  : QWidget (parent), nodialog(false)
79  , kc(0)
80  , cb0(0)
81  , cb1(0)
82  , cb2(0)
83  , dictlist(0)
84  , dictcombo(0)
85  , encodingcombo(0)
86  , clientcombo(0)
87  , d(new K3SpellConfigPrivate)
88 {
89  kc = KGlobal::config();
90 
91  if( !_ksc )
92  {
93  readGlobalSettings();
94  }
95  else
96  {
97  setDoSpellChecking( _ksc->doSpellChecking() );
98  setNoRootAffix( _ksc->noRootAffix() );
99  setRunTogether( _ksc->runTogether() );
100  setDictionary( _ksc->dictionary() );
101  setDictFromList( _ksc->dictFromList() );
102  //setPersonalDict (_ksc->personalDict());
103  setIgnoreList( _ksc->ignoreList() );
104  setEncoding( _ksc->encoding() );
105  setClient( _ksc->client() );
106  }
107 
108  QGridLayout *glay = new QGridLayout( this );
109  glay->setMargin( 0 );
110  cb0 = new QCheckBox( i18nc("@option:check", "Do Spellchecking"), this );
111  cb0->setObjectName( "DoSpellChecking" );
112  connect( cb0, SIGNAL(toggled(bool)), SLOT(sDoSpell()) );
113  cb1 = new QCheckBox( i18nc("@option:check",
114  "Create &root/affix combinations not in dictionary"), this );
115  cb1->setObjectName( "NoRootAffix" );
116  connect( cb1, SIGNAL(toggled(bool)), SLOT(sNoAff(bool)) );
117  glay->addWidget( cb0, 0, 0, 1, 3 );
118  glay->addWidget( cb1, 1, 0, 1, 3 );
119 
120  cb2 = new QCheckBox( i18nc("@option:check",
121  "Consider run-together &words as spelling errors"), this );
122  cb2->setObjectName( "RunTogether" );
123  connect( cb2, SIGNAL(toggled(bool)), SLOT(sRunTogether(bool)) );
124  glay->addWidget( cb2, 2, 0, 1, 3 );
125 
126  dictcombo = new QComboBox( this );
127  dictcombo->setObjectName( "DictFromList" );
128  dictcombo->setInsertPolicy( QComboBox::NoInsert );
129  connect( dictcombo, SIGNAL (activated(int)),
130  this, SLOT (sSetDictionary(int)) );
131  glay->addWidget( dictcombo, 3, 1, 1, 2 );
132 
133  dictlist = new QLabel( i18nc("@label:listbox", "&Dictionary:"), this );
134  dictlist->setBuddy( dictcombo );
135  glay->addWidget( dictlist, 3 ,0 );
136 
137  encodingcombo = new QComboBox( this );
138  encodingcombo->setObjectName( "Encoding" );
139  encodingcombo->addItem( "US-ASCII" );
140  encodingcombo->addItem( "ISO 8859-1" );
141  encodingcombo->addItem( "ISO 8859-2" );
142  encodingcombo->addItem( "ISO 8859-3" );
143  encodingcombo->addItem( "ISO 8859-4" );
144  encodingcombo->addItem( "ISO 8859-5" );
145  encodingcombo->addItem( "ISO 8859-7" );
146  encodingcombo->addItem( "ISO 8859-8" );
147  encodingcombo->addItem( "ISO 8859-9" );
148  encodingcombo->addItem( "ISO 8859-13" );
149  encodingcombo->addItem( "ISO 8859-15" );
150  encodingcombo->addItem( "UTF-8" );
151  encodingcombo->addItem( "KOI8-R" );
152  encodingcombo->addItem( "KOI8-U" );
153  encodingcombo->addItem( "CP1251" );
154  encodingcombo->addItem( "CP1255" );
155 
156  connect( encodingcombo, SIGNAL(activated(int)), this,
157  SLOT(sChangeEncoding(int)) );
158  glay->addWidget( encodingcombo, 4, 1, 1, 2 );
159 
160  QLabel *tmpQLabel = new QLabel( i18nc("@label:listbox", "&Encoding:"), this);
161  tmpQLabel->setBuddy( encodingcombo );
162  glay->addWidget( tmpQLabel, 4, 0 );
163 
164 
165  clientcombo = new QComboBox( this );
166  clientcombo->setObjectName( "Client" );
167  clientcombo->addItem( i18nc("@item:inlistbox Spell checker", "International <application>Ispell</application>") );
168  clientcombo->addItem( i18nc("@item:inlistbox Spell checker", "<application>Aspell</application>") );
169  clientcombo->addItem( i18nc("@item:inlistbox Spell checker", "<application>Hspell</application>") );
170  clientcombo->addItem( i18nc("@item:inlistbox Spell checker", "<application>Zemberek</application>") );
171  clientcombo->addItem( i18nc("@item:inlistbox Spell checker", "<application>Hunspell</application>") );
172  connect( clientcombo, SIGNAL (activated(int)), this,
173  SLOT (sChangeClient(int)) );
174  glay->addWidget( clientcombo, 5, 1, 1, 2 );
175 
176  tmpQLabel = new QLabel( i18nc("@label:listbox", "&Client:"), this );
177  tmpQLabel->setBuddy( clientcombo );
178  glay->addWidget( tmpQLabel, 5, 0 );
179 
180  if( addHelpButton )
181  {
182  QPushButton *pushButton = new KPushButton( KStandardGuiItem::help(), this );
183  connect( pushButton, SIGNAL(clicked()), this, SLOT(sHelp()) );
184  glay->addWidget(pushButton, 6, 2);
185  }
186 
187  fillInDialog();
188 }
189 
190 K3SpellConfig::~K3SpellConfig()
191 {
192  delete d;
193 }
194 
195 
196 bool
197 K3SpellConfig::dictFromList() const
198 {
199  return dictfromlist;
200 }
201 
202 bool
203 K3SpellConfig::readGlobalSettings()
204 {
205  kDebug(750) << "Entering K3SpellConfig::readGlobalSettings (see k3sconfig.cpp)";
206  KConfigGroup cg( kc,"K3Spell" );
207 
208  setDoSpellChecking ( cg.readEntry("K3Spell_DoSpellChecking", false ) );
209  setNoRootAffix ( cg.readEntry("K3Spell_NoRootAffix", 0) );
210  setRunTogether ( cg.readEntry("K3Spell_RunTogether", 0) );
211  setDictionary ( cg.readEntry("K3Spell_Dictionary") );
212  setDictFromList ( cg.readEntry("K3Spell_DictFromList", 0) );
213  setEncoding ( cg.readEntry ("K3Spell_Encoding", int(KS_E_ASCII)) );
214  setClient ( cg.readEntry ("K3Spell_Client", int(KS_CLIENT_ISPELL)) );
215 
216  return true;
217 }
218 
219 bool
220 K3SpellConfig::writeGlobalSettings ()
221 {
222  KConfigGroup cg( kc,"K3Spell" );
223 
224  KConfigBase::WriteConfigFlags flags(KConfigBase::Global|KConfigBase::Persistent);
225  cg.writeEntry ("K3Spell_DoSpellChecking", doSpellChecking(), flags);
226  cg.writeEntry ("K3Spell_NoRootAffix",(int) noRootAffix(), flags);
227  cg.writeEntry ("K3Spell_RunTogether", (int) runTogether(), flags);
228  cg.writeEntry ("K3Spell_Dictionary", dictionary(), flags);
229  cg.writeEntry ("K3Spell_DictFromList",(int) dictFromList(), flags);
230  cg.writeEntry ("K3Spell_Encoding", (int) encoding(), flags);
231  cg.writeEntry ("K3Spell_Client", client(), flags);
232  kc->sync();
233 
234  return true;
235 }
236 
237 void
238 K3SpellConfig::sChangeEncoding( int i )
239 {
240  kDebug(750) << "K3SpellConfig::sChangeEncoding(" << i << ")";
241  setEncoding( i );
242  emit configChanged();
243 }
244 
245 void
246 K3SpellConfig::sChangeClient( int i )
247 {
248  setClient( i );
249 
250  // read in new dict list
251  if ( dictcombo ) {
252  if ( iclient == KS_CLIENT_ISPELL )
253  getAvailDictsIspell();
254  else if ( iclient == KS_CLIENT_HSPELL )
255  {
256  langfnames.clear();
257  dictcombo->clear();
258  dictcombo->addItem( i18nc("@item Spelling dictionary", "Hebrew") );
259  sChangeEncoding( KS_E_CP1255 );
260  } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
261  langfnames.clear();
262  dictcombo->clear();
263  dictcombo->addItem( i18nc("@item Spelling dictionary", "Turkish") );
264  sChangeEncoding( KS_E_UTF8 );
265  }
266  else if ( iclient == KS_CLIENT_ASPELL )
267  getAvailDictsAspell();
268  else
269  getAvailDictsHunspell();
270  }
271  emit configChanged();
272 }
273 
274 bool
275 K3SpellConfig::interpret( const QString &fname, QString &lname,
276  QString &hname )
277 
278 {
279 
280  kDebug(750) << "K3SpellConfig::interpret [" << fname << "]";
281 
282  QString dname( fname );
283 
284  if( dname.endsWith( '+' ) )
285  dname.remove( dname.length()-1, 1 );
286 
287  if( dname.endsWith("sml") || dname.endsWith("med") || dname.endsWith("lrg") ||
288  dname.endsWith("xlg"))
289  dname.remove(dname.length()-3,3);
290 
291  QString extension;
292 
293  int i = dname.indexOf('-');
294  if ( i != -1 )
295  {
296  extension = dname.mid(i+1);
297  dname.truncate(i);
298  }
299 
300  // Aspell uses 2 alpha language codes or 2 alpha language + 2 alpha country,
301  // but since aspell 0.6 also 3-character ISO-codes can be used
302  if ( (dname.length() == 2) || (dname.length() == 3) ) {
303  lname = dname;
304  hname = KGlobal::locale()->languageCodeToName( lname );
305  }
306  else if ( (dname.length() == 5) && (dname[2] == '_') ) {
307  lname = dname.left(2);
308  hname = KGlobal::locale()->languageCodeToName( lname );
309  QString country = KGlobal::locale()->countryCodeToName( dname.right(2) );
310  if ( extension.isEmpty() )
311  extension = country;
312  else
313  extension = country + " - " + extension;
314  }
315  //These are mostly the ispell-langpack defaults
316  else if ( dname=="english" || dname=="american" ||
317  dname=="british" || dname=="canadian" ) {
318  lname="en"; hname=i18nc("@item Spelling dictionary", "English");
319  }
320  else if ( dname == "espa~nol" || dname == "espanol" ) {
321  lname="es"; hname=i18nc("@item Spelling dictionary", "Spanish");
322  }
323  else if (dname=="dansk") {
324  lname="da"; hname=i18nc("@item Spelling dictionary", "Danish");
325  }
326  else if (dname=="deutsch") {
327  lname="de"; hname=i18nc("@item Spelling dictionary", "German");
328  }
329  else if (dname=="german") {
330  lname="de"; hname=i18nc("@item Spelling dictionary", "German (new spelling)");
331  }
332  else if (dname=="portuguesb" || dname=="br") {
333  lname="br"; hname=i18nc("@item Spelling dictionary", "Brazilian Portuguese");
334  }
335  else if (dname=="portugues") {
336  lname="pt"; hname=i18nc("@item Spelling dictionary", "Portuguese");
337  }
338  else if (dname=="esperanto") {
339  lname="eo"; hname=i18nc("@item Spelling dictionary", "Esperanto");
340  }
341  else if (dname=="norsk") {
342  lname="no"; hname=i18nc("@item Spelling dictionary", "Norwegian");
343  }
344  else if (dname=="polish") {
345  lname="pl"; hname=i18nc("@item Spelling dictionary", "Polish"); sChangeEncoding(KS_E_LATIN2);
346  }
347  else if (dname=="russian") {
348  lname="ru"; hname=i18nc("@item Spelling dictionary", "Russian");
349  }
350  else if (dname=="slovensko") {
351  lname="si"; hname=i18nc("@item Spelling dictionary", "Slovenian"); sChangeEncoding(KS_E_LATIN2);
352  }
353  else if (dname=="slovak"){
354  lname="sk"; hname=i18nc("@item Spelling dictionary", "Slovak"); sChangeEncoding(KS_E_LATIN2);
355  }
356  else if (dname=="czech") {
357  lname="cs"; hname=i18nc("@item Spelling dictionary", "Czech"); sChangeEncoding(KS_E_LATIN2);
358  }
359  else if (dname=="svenska") {
360  lname="sv"; hname=i18nc("@item Spelling dictionary", "Swedish");
361  }
362  else if (dname=="swiss") {
363  lname="de"; hname=i18nc("@item Spelling dictionary", "Swiss German");
364  }
365  else if (dname=="ukrainian") {
366  lname="uk"; hname=i18nc("@item Spelling dictionary", "Ukrainian");
367  }
368  else if (dname=="lietuviu" || dname=="lithuanian") {
369  lname="lt"; hname=i18nc("@item Spelling dictionary", "Lithuanian");
370  }
371  else if (dname=="francais" || dname=="french") {
372  lname="fr"; hname=i18nc("@item Spelling dictionary", "French");
373  }
374  else if (dname=="belarusian") { // waiting for post 2.2 to not dissapoint translators
375  lname="be"; hname=i18nc("@item Spelling dictionary", "Belarusian");
376  }
377  else if( dname == "magyar" ) {
378  lname="hu"; hname=i18nc("@item Spelling dictionary", "Hungarian");
379  sChangeEncoding(KS_E_LATIN2);
380  }
381  else {
382  lname=""; hname=i18nc("@item Spelling dictionary", "Unknown");
383  }
384  if (!extension.isEmpty())
385  {
386  hname = hname + " (" + extension + ')';
387  }
388 
389  //We have explicitly chosen English as the default here.
390  if ( ( KGlobal::locale()->language() == QLatin1String("C") &&
391  lname==QLatin1String("en") ) ||
392  KGlobal::locale()->language() == lname )
393  return true;
394 
395  return false;
396 }
397 
398 void
399 K3SpellConfig::fillInDialog ()
400 {
401  if ( nodialog )
402  return;
403 
404  kDebug(750) << "K3SpellConfig::fillinDialog";
405 
406  cb0->setChecked( doSpellChecking() );
407  cb1->setChecked( noRootAffix() );
408  cb2->setChecked( runTogether() );
409  encodingcombo->setCurrentIndex( encoding() );
410  clientcombo->setCurrentIndex( client() );
411 
412  // get list of available dictionaries
413  if ( iclient == KS_CLIENT_ISPELL )
414  getAvailDictsIspell();
415  else if ( iclient == KS_CLIENT_HSPELL )
416  {
417  langfnames.clear();
418  dictcombo->clear();
419  langfnames.append(""); // Default
420  dictcombo->addItem( i18nc("@item Spelling dictionary", "Hebrew") );
421  } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
422  langfnames.clear();
423  dictcombo->clear();
424  langfnames.append("");
425  dictcombo->addItem( i18nc("@item Spelling dictionary", "Turkish") );
426  }
427  else if ( iclient == KS_CLIENT_ASPELL )
428  getAvailDictsAspell();
429  else
430  getAvailDictsHunspell();
431 
432  // select the used dictionary in the list
433  int whichelement=-1;
434 
435  if ( dictFromList() )
436  whichelement = langfnames.indexOf(dictionary());
437 
438  dictcombo->setMinimumWidth (dictcombo->sizeHint().width());
439 
440  if (dictionary().isEmpty() || whichelement!=-1)
441  {
442  setDictFromList (true);
443  if (whichelement!=-1)
444  dictcombo->setCurrentIndex(whichelement);
445  }
446  else
447  // Current dictionary vanished, present the user with a default if possible.
448  if ( !langfnames.empty() )
449  {
450  setDictFromList( true );
451  dictcombo->setCurrentIndex(0);
452  }
453  else
454  setDictFromList( false );
455 
456  sDictionary( dictFromList() );
457  sPathDictionary( !dictFromList() );
458 
459 }
460 
461 
462 void K3SpellConfig::getAvailDictsIspell () {
463 
464  langfnames.clear();
465  dictcombo->clear();
466  langfnames.append(""); // Default
467  dictcombo->addItem( i18nc("@item Spelling dictionary",
468  "<application>ISpell</application> Default") );
469 
470  // dictionary path
471  QFileInfo dir ("/usr/lib/ispell");
472  if (!dir.exists() || !dir.isDir())
473  dir.setFile ("/usr/local/lib/ispell");
474  if (!dir.exists() || !dir.isDir())
475  dir.setFile ("/usr/local/share/ispell");
476  if (!dir.exists() || !dir.isDir())
477  dir.setFile ("/usr/share/ispell");
478  if (!dir.exists() || !dir.isDir())
479  dir.setFile ("/usr/pkg/lib");
480  /* TODO get them all instead of just one of them.
481  * If /usr/local/lib exists, it skips the rest
482  if (!dir.exists() || !dir.isDir())
483  dir.setFile ("/usr/local/lib");
484  */
485  if (!dir.exists() || !dir.isDir()) return;
486 
487  kDebug(750) << "K3SpellConfig::getAvailDictsIspell "
488  << dir.filePath() << " " << dir.path() << endl;
489 
490  const QDir thedir (dir.filePath(),"*.hash");
491  const QStringList entryList = thedir.entryList();
492 
493  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
494  kDebug(750) << "entryList().count()="
495  << entryList.count() << endl;
496 
497  QStringList::const_iterator entryListItr = entryList.constBegin();
498  const QStringList::const_iterator entryListEnd = entryList.constEnd();
499 
500  for ( ; entryListItr != entryListEnd; ++entryListItr)
501  {
502  QString fname, lname, hname;
503  fname = *entryListItr;
504 
505  // remove .hash
506  if (fname.endsWith(".hash")) fname.remove (fname.length()-5,5);
507 
508  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
509  { // This one is the KDE default language
510  // so place it first in the lists (overwrite "Default")
511 
512  langfnames.removeFirst();
513  langfnames.prepend ( fname );
514 
515  hname=i18nc("@item Spelling dictionary: %1 dictionary name, %2 file name",
516  "Default - %1 [%2]", hname, fname);
517 
518  dictcombo->setItemText (0,hname);
519  }
520  else
521  {
522  langfnames.append (fname);
523  hname=hname+" ["+fname+']';
524 
525  dictcombo->addItem (hname);
526  }
527  }
528 }
529 
530 void K3SpellConfig::getAvailDictsAspell () {
531 
532  langfnames.clear();
533  dictcombo->clear();
534 
535  langfnames.append(""); // Default
536  dictcombo->addItem (i18nc("@item Spelling dictionary",
537  "<application>ASpell</application> Default"));
538 
539  // dictionary path
540  // FIXME: use "aspell dump config" to find out the dict-dir
541  QFileInfo dir ("/usr/lib" KDELIBSUFF "/aspell");
542  if (!dir.exists() || !dir.isDir())
543  dir.setFile ("/usr/lib" KDELIBSUFF "/aspell-0.60");
544  if (!dir.exists() || !dir.isDir())
545  dir.setFile ("/usr/local/lib" KDELIBSUFF "/aspell");
546  if (!dir.exists() || !dir.isDir())
547  dir.setFile ("/usr/share/aspell");
548  if (!dir.exists() || !dir.isDir())
549  dir.setFile ("/usr/local/share/aspell");
550  if (!dir.exists() || !dir.isDir())
551  dir.setFile ("/usr/pkg/lib/aspell");
552  if (!dir.exists() || !dir.isDir()) return;
553 
554  kDebug(750) << "K3SpellConfig::getAvailDictsAspell "
555  << dir.filePath() << " " << dir.path() << endl;
556 
557  const QDir thedir (dir.filePath(),"*");
558  const QStringList entryList = thedir.entryList();
559 
560  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
561  kDebug(750) << "entryList().count()="
562  << entryList.count() << endl;
563 
564  QStringList::const_iterator entryListItr = entryList.constBegin();
565  const QStringList::const_iterator entryListEnd = entryList.constEnd();
566 
567  for ( ; entryListItr != entryListEnd; ++entryListItr)
568  {
569  QString fname, lname, hname;
570  fname = *entryListItr;
571 
572  // consider only simple dicts without '-' in the name
573  // FIXME: may be this is wrong an the list should contain
574  // all *.multi files too, to allow using special dictionaries
575 
576  // Well, K3Spell2 has a better way to do this, but this code has to be
577  // cleaned up somehow: since aspell 0.6 we have quite a lot of files in the
578  // aspell dictionary that are not dictionaries. These must not be presented as "languages"
579  // We only keep
580  // *.rws: dictionary
581  // *.multi: definition file to load several subdictionaries
582  if ( !( fname.endsWith(".rws") || fname.endsWith(".multi") ) ) {
583  // remove noise from the language list
584  continue;
585  }
586  if (fname[0] != '.')
587  {
588 
589  // remove .multi
590  if (fname.endsWith(".multi")) fname.remove (fname.length()-6,6);
591  // remove .rws
592  if (fname.endsWith(".rws")) fname.remove (fname.length()-4,4);
593 
594  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
595  { // This one is the KDE default language
596  // so place it first in the lists (overwrite "Default")
597 
598  langfnames.erase ( langfnames.begin() );
599  langfnames.prepend ( fname );
600 
601  hname=i18nc("@item Spelling dictionary: %1 dictionary name",
602  "Default - %1", hname);
603 
604  dictcombo->setItemText (0,hname);
605  }
606  else
607  {
608  langfnames.append (fname);
609  dictcombo->addItem (hname);
610  }
611  }
612  }
613 }
614 
615 void K3SpellConfig::getAvailDictsHunspell () {
616 
617  langfnames.clear();
618  dictcombo->clear();
619  langfnames.append(""); // Default
620  dictcombo->addItem( i18nc("@item Spelling dictionary",
621  "<application>Hunspell</application> Default") );
622 
623  // dictionary path
624  QFileInfo dir ("/usr/share/myspell");
625  if (!dir.exists() || !dir.isDir())
626  dir.setFile ("/usr/share/hunspell");
627  if (!dir.exists() || !dir.isDir()) return;
628 
629  kDebug(750) << "K3SpellConfig::getAvailDictsHunspell "
630  << dir.filePath() << " " << dir.path() << endl;
631 
632  const QDir thedir (dir.filePath(),"*.dic");
633  const QStringList entryList = thedir.entryList();
634 
635  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
636  kDebug(750) << "entryList().count()="
637  << entryList.count() << endl;
638 
639  QStringList::const_iterator entryListItr = entryList.constBegin();
640  const QStringList::const_iterator entryListEnd = entryList.constEnd();
641 
642  for ( ; entryListItr != entryListEnd; ++entryListItr)
643  {
644  QString fname, lname, hname;
645  fname = *entryListItr;
646 
647  // remove .dic
648  if (fname.endsWith(".dic")) fname.remove (fname.length()-4,4);
649 
650  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
651  { // This one is the KDE default language
652  // so place it first in the lists (overwrite "Default")
653 
654  langfnames.removeFirst();
655  langfnames.prepend ( fname );
656 
657  hname=i18nc("@item Spelling dictionary: %1 dictionary name, %2 file name",
658  "Default - %1 [%2]", hname, fname);
659 
660  dictcombo->setItemText (0,hname);
661  }
662  else
663  {
664  langfnames.append (fname);
665  hname=hname+" ["+fname+']';
666 
667  dictcombo->addItem (hname);
668  }
669  }
670 }
671 
672 void
673 K3SpellConfig::fillDicts( QComboBox* box, QStringList* dictionaries )
674 {
675  langfnames.clear();
676  if ( box ) {
677  if ( iclient == KS_CLIENT_ISPELL ) {
678  box->clear();
679  langfnames.append(""); // Default
680  box->addItem( i18nc("@item Spelling dictionary",
681  "<application>ISpell</application> Default") );
682 
683  // dictionary path
684  QFileInfo dir ("/usr/lib/ispell");
685  if (!dir.exists() || !dir.isDir())
686  dir.setFile ("/usr/local/lib/ispell");
687  if (!dir.exists() || !dir.isDir())
688  dir.setFile ("/usr/local/share/ispell");
689  if (!dir.exists() || !dir.isDir())
690  dir.setFile ("/usr/share/ispell");
691  if (!dir.exists() || !dir.isDir())
692  dir.setFile ("/usr/pkg/lib");
693  /* TODO get them all instead of just one of them.
694  * If /usr/local/lib exists, it skips the rest
695  if (!dir.exists() || !dir.isDir())
696  dir.setFile ("/usr/local/lib");
697  */
698  if (!dir.exists() || !dir.isDir()) return;
699 
700  kDebug(750) << "K3SpellConfig::getAvailDictsIspell "
701  << dir.filePath() << " " << dir.path() << endl;
702 
703  const QDir thedir (dir.filePath(),"*.hash");
704  const QStringList entryList = thedir.entryList();
705 
706  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
707  kDebug(750) << "entryList().count()="
708  << entryList.count() << endl;
709 
710  QStringList::const_iterator entryListItr = entryList.constBegin();
711  const QStringList::const_iterator entryListEnd = entryList.constEnd();
712 
713  for ( ; entryListItr != entryListEnd; ++entryListItr)
714  {
715  QString fname, lname, hname;
716  fname = *entryListItr;
717 
718  // remove .hash
719  if (fname.endsWith(".hash")) fname.remove (fname.length()-5,5);
720 
721  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
722  { // This one is the KDE default language
723  // so place it first in the lists (overwrite "Default")
724 
725  langfnames.erase ( langfnames.begin() );
726  langfnames.prepend ( fname );
727 
728  hname=i18nc("@item Spelling dictionary: %1 dictionary name, %2 file name",
729  "Default - %1 [%2]", hname, fname);
730 
731  box->setItemText (0,hname);
732  }
733  else
734  {
735  langfnames.append (fname);
736  hname=hname+" ["+fname+']';
737 
738  box->addItem (hname);
739  }
740  }
741  } else if ( iclient == KS_CLIENT_HSPELL ) {
742  box->clear();
743  box->addItem( i18nc("@item Spelling dictionary", "Hebrew") );
744  langfnames.append(""); // Default
745  sChangeEncoding( KS_E_CP1255 );
746  } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
747  box->clear();
748  box->addItem( i18nc("@item Spelling dictionary", "Turkish") );
749  langfnames.append("");
750  sChangeEncoding( KS_E_UTF8 );
751  } else if ( iclient == KS_CLIENT_ASPELL ) {
752  box->clear();
753  langfnames.append(""); // Default
754  box->addItem (i18nc("@item Spelling dictionary",
755  "<application>ASpell</application> Default"));
756 
757  // dictionary path
758  // FIXME: use "aspell dump config" to find out the dict-dir
759  QFileInfo dir ("/usr/lib" KDELIBSUFF "/aspell");
760  if (!dir.exists() || !dir.isDir())
761  dir.setFile ("/usr/lib" KDELIBSUFF "/aspell-0.60");
762  if (!dir.exists() || !dir.isDir())
763  dir.setFile ("/usr/local/lib" KDELIBSUFF "/aspell");
764  if (!dir.exists() || !dir.isDir())
765  dir.setFile ("/usr/share/aspell");
766  if (!dir.exists() || !dir.isDir())
767  dir.setFile ("/usr/local/share/aspell");
768  if (!dir.exists() || !dir.isDir())
769  dir.setFile ("/usr/pkg/lib/aspell");
770  if (!dir.exists() || !dir.isDir()) return;
771 
772  kDebug(750) << "K3SpellConfig::getAvailDictsAspell "
773  << dir.filePath() << " " << dir.path() << endl;
774 
775  const QDir thedir (dir.filePath(),"*");
776  const QStringList entryList = thedir.entryList();
777 
778  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
779  kDebug(750) << "entryList().count()="
780  << entryList.count() << endl;
781 
782  QStringList::const_iterator entryListItr = entryList.constBegin();
783  const QStringList::const_iterator entryListEnd = entryList.constEnd();
784 
785  for ( ; entryListItr != entryListEnd; ++entryListItr)
786  {
787  QString fname, lname, hname;
788  fname = *entryListItr;
789 
790  // consider only simple dicts without '-' in the name
791  // FIXME: may be this is wrong an the list should contain
792  // all *.multi files too, to allow using special dictionaries
793 
794  // Well, K3Spell2 has a better way to do this, but this code has to be
795  // cleaned up somehow: since aspell 0.6 we have quite a lot of files in the
796  // aspell dictionary that are not dictionaries. These must not be presented as "languages"
797  // We only keep
798  // *.rws: dictionary
799  // *.multi: definition file to load several subdictionaries
800  if ( !( fname.endsWith(".rws") || fname.endsWith(".multi") ) ) {
801  // remove noise from the language list
802  continue;
803  }
804  if (fname[0] != '.')
805  {
806 
807  // remove .multi
808  if (fname.endsWith(".multi")) fname.remove (fname.length()-6,6);
809  // remove .rws
810  if (fname.endsWith(".rws")) fname.remove (fname.length()-4,4);
811 
812  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
813  { // This one is the KDE default language
814  // so place it first in the lists (overwrite "Default")
815 
816  langfnames.erase ( langfnames.begin() );
817  langfnames.prepend ( fname );
818 
819  hname=i18nc("@item Spelling dictionary: %1 dictionary name",
820  "Default - %1", hname);
821 
822  box->setItemText (0,hname);
823  }
824  else
825  {
826  langfnames.append (fname);
827  box->addItem (hname);
828  }
829  }
830  }
831  } else {
832  box->clear();
833  langfnames.append(""); // Default
834  box->addItem( i18nc("@item Spelling dictionary",
835  "<application>Hunspell</application> Default") );
836 
837  // dictionary path
838  QFileInfo dir ("/usr/share/myspell");
839  if (!dir.exists() || !dir.isDir())
840  dir.setFile ("/usr/share/hunspell");
841  if (!dir.exists() || !dir.isDir()) return;
842 
843  kDebug(750) << "K3SpellConfig::getAvailDictsHunspell "
844  << dir.filePath() << " " << dir.path() << endl;
845 
846  const QDir thedir (dir.filePath(),"*.dic");
847  const QStringList entryList = thedir.entryList();
848 
849  kDebug(750) << "K3SpellConfig" << thedir.path() << "\n";
850  kDebug(750) << "entryList().count()="
851  << entryList.count() << endl;
852 
853  QStringList::const_iterator entryListItr = entryList.constBegin();
854  const QStringList::const_iterator entryListEnd = entryList.constEnd();
855 
856  for ( ; entryListItr != entryListEnd; ++entryListItr)
857  {
858  QString fname, lname, hname;
859  fname = *entryListItr;
860 
861  // remove .dic
862  if (fname.endsWith(".dic")) fname.remove (fname.length()-4,4);
863 
864  if (interpret (fname, lname, hname) && langfnames.first().isEmpty())
865  { // This one is the KDE default language
866  // so place it first in the lists (overwrite "Default")
867 
868  langfnames.erase ( langfnames.begin() );
869  langfnames.prepend ( fname );
870 
871  hname=i18nc("@item Spelling dictionary: %1 dictionary name, %2 file name",
872  "Default - %1 [%2]", hname, fname);
873 
874  box->setItemText (0,hname);
875  }
876  else
877  {
878  langfnames.append (fname);
879  hname=hname+" ["+fname+']';
880 
881  box->addItem (hname);
882  }
883  }
884  }
885  int whichelement = langfnames.indexOf(qsdict);
886  if ( whichelement >= 0 ) {
887  box->setCurrentIndex( whichelement );
888  }
889  if ( dictionaries )
890  *dictionaries = langfnames;
891  }
892 }
893 
894 /*
895  * Options setting routines.
896  */
897 
898 void
899 K3SpellConfig::setClient (int c)
900 {
901  iclient = c;
902 
903  if (clientcombo)
904  clientcombo->setCurrentIndex(c);
905 }
906 
907 void
908 K3SpellConfig::setDoSpellChecking (bool b)
909 {
910  bdospellchecking=b;
911 
912  if(cb0)
913  cb0->setChecked(b);
914 }
915 
916 void
917 K3SpellConfig::setNoRootAffix (bool b)
918 {
919  bnorootaffix=b;
920 
921  if(cb1)
922  cb1->setChecked(b);
923 }
924 
925 void
926 K3SpellConfig::setRunTogether(bool b)
927 {
928  bruntogether=b;
929 
930  if(cb2)
931  cb2->setChecked(b);
932 }
933 
934 void
935 K3SpellConfig::setDictionary (const QString s)
936 {
937  qsdict=s; //.copy();
938 
939  if (qsdict.length()>5)
940  if ((signed)qsdict.indexOf(".hash")==(signed)qsdict.length()-5)
941  qsdict.remove (qsdict.length()-5,5);
942 
943 
944  if(dictcombo)
945  {
946  int whichelement=-1;
947  if (dictFromList())
948  {
949  whichelement = langfnames.indexOf(s);
950 
951  if(whichelement >= 0)
952  {
953  dictcombo->setCurrentIndex(whichelement);
954  }
955  }
956  }
957 
958 
959 }
960 
961 void
962 K3SpellConfig::setDictFromList (bool dfl)
963 {
964  // kdebug (KDEBUG_INFO, 750, "sdfl = %d", dfl);
965  dictfromlist=dfl;
966 }
967 
968 /*
969 void K3SpellConfig::setPersonalDict (const char *s)
970 {
971  qspdict=s;
972 }
973 */
974 
975 void
976 K3SpellConfig::setEncoding (int enctype)
977 {
978  enc=enctype;
979 
980  if(encodingcombo)
981  encodingcombo->setCurrentIndex(enctype);
982 }
983 
984 /*
985  Options reading routines.
986  */
987 int
988 K3SpellConfig::client () const
989 {
990  return iclient;
991 }
992 
993 
994 bool
995 K3SpellConfig::doSpellChecking () const
996 {
997  return bdospellchecking;
998 }
999 
1000 bool
1001 K3SpellConfig::noRootAffix () const
1002 {
1003  return bnorootaffix;
1004 }
1005 
1006 bool
1007 K3SpellConfig::runTogether() const
1008 {
1009  return bruntogether;
1010 }
1011 
1012 const
1013 QString K3SpellConfig::dictionary () const
1014 {
1015  return qsdict;
1016 }
1017 
1018 /*
1019 const QString K3SpellConfig::personalDict () const
1020 {
1021  return qspdict;
1022 }
1023 */
1024 
1025 int
1026 K3SpellConfig::encoding () const
1027 {
1028  return enc;
1029 }
1030 
1031 void
1032 K3SpellConfig::sRunTogether(bool)
1033 {
1034  setRunTogether (cb2->isChecked());
1035  emit configChanged();
1036 }
1037 
1038 void
1039 K3SpellConfig::sNoAff(bool)
1040 {
1041  setNoRootAffix (cb1->isChecked());
1042  emit configChanged();
1043 }
1044 
1045 void
1046 K3SpellConfig::sDoSpell()
1047 {
1048  setDoSpellChecking (cb0->isChecked());
1049  emit configChanged();
1050 }
1051 
1052 /*
1053 void
1054 K3SpellConfig::sBrowseDict()
1055 {
1056  return;
1057 
1058  QString qs( KFileDialog::getOpenFileName ("/usr/local/lib","*.hash") );
1059  if ( !qs.isNull() )
1060  kle1->setText (qs);
1061 
1062 }
1063 */
1064 
1065 /*
1066 void K3SpellConfig::sBrowsePDict()
1067 {
1068  //how do I find home directory path??
1069  QString qs( KFileDialog::getOpenFileName ("",".ispell_*") );
1070  if ( !qs.isNull() )
1071  kle2->setText (qs);
1072 
1073 
1074 }
1075 */
1076 
1077 void
1078 K3SpellConfig::sSetDictionary (int i)
1079 {
1080  setDictionary (langfnames[i]);
1081  setDictFromList (true);
1082  emit configChanged();
1083 }
1084 
1085 void
1086 K3SpellConfig::sDictionary(bool on)
1087 {
1088  if (on)
1089  {
1090  dictcombo->setEnabled (true);
1091  setDictionary (langfnames[dictcombo->currentIndex()] );
1092  setDictFromList (true);
1093  }
1094  else
1095  {
1096  dictcombo->setEnabled (false);
1097  }
1098  emit configChanged();
1099 }
1100 
1101 void
1102 K3SpellConfig::sPathDictionary(bool on)
1103 {
1104  return; //enough for now
1105 
1106 
1107  if (on)
1108  {
1109  //kle1->setEnabled (true);
1110  // browsebutton1->setEnabled (true);
1111  //setDictionary (kle1->text());
1112  setDictFromList (false);
1113  }
1114  else
1115  {
1116  //kle1->setEnabled (false);
1117  //browsebutton1->setEnabled (false);
1118  }
1119  emit configChanged();
1120 }
1121 
1122 
1123 void K3SpellConfig::activateHelp( void )
1124 {
1125  sHelp();
1126 }
1127 
1128 void K3SpellConfig::sHelp( void )
1129 {
1130  KToolInvocation::invokeHelp("configuration", "k3spell");
1131 }
1132 
1133 /*
1134 void K3SpellConfig::textChanged1 (const char *s)
1135 {
1136  setDictionary (s);
1137 }
1138 
1139 void K3SpellConfig::textChanged2 (const char *)
1140 {
1141  // setPersonalDict (s);
1142 }
1143 */
1144 
1145 void
1146 K3SpellConfig::operator= (const K3SpellConfig &ksc)
1147 {
1148  //We want to copy the data members, but not the
1149  //pointers to the child widgets
1150  setDoSpellChecking (ksc.doSpellChecking());
1151  setNoRootAffix (ksc.noRootAffix());
1152  setRunTogether (ksc.runTogether());
1153  setDictionary (ksc.dictionary());
1154  setDictFromList (ksc.dictFromList());
1155  // setPersonalDict (ksc.personalDict());
1156  setEncoding (ksc.encoding());
1157  setClient (ksc.client());
1158 
1159  fillInDialog();
1160 }
1161 
1162 void
1163 K3SpellConfig::setIgnoreList (const QStringList &_ignorelist)
1164 {
1165  ignorelist=_ignorelist;
1166 }
1167 
1168 QStringList
1169 K3SpellConfig::ignoreList () const
1170 {
1171  return ignorelist;
1172 }
1173 
1174 void
1175 K3SpellConfig::setReplaceAllList (const QStringList &_replacelist)
1176 {
1177  d->replacelist=_replacelist;
1178 }
1179 
1180 QStringList
1181 K3SpellConfig::replaceAllList() const
1182 {
1183  return d->replacelist;
1184 }
1185 
1186 #include "k3sconfig.moc"
1187 
1188 
1189 
kdialog.h
QList::clear
void clear()
K3SpellConfig::sHelp
void sHelp()
Invokes the help documentation for k3spell.
Definition: k3sconfig.cpp:1128
KPushButton
QString::indexOf
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
KConfig::sync
void sync()
QWidget
K3SpellConfig::K3SpellConfig
K3SpellConfig(QWidget *parent=0, K3SpellConfig *spellConfig=0, bool addHelpButton=true)
Constructs a K3SpellConfig with default or custom settings.
Definition: k3sconfig.cpp:76
K3SpellConfig::interpret
bool interpret(const QString &fname, QString &lname, QString &hname)
This takes a dictionary file name and provides both a language abbreviation appropriate for the $LANG...
Definition: k3sconfig.cpp:275
QString::truncate
void truncate(int position)
QFileInfo::path
QString path() const
QSize::width
int width() const
kdebug.h
K3SpellConfig::runTogether
bool runTogether() const
Definition: k3sconfig.cpp:1007
K3SpellConfig::configChanged
void configChanged()
QGridLayout::addWidget
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
K3SpellConfig::encoding
int encoding() const
Definition: k3sconfig.cpp:1026
K3SpellConfig::clientcombo
QComboBox * clientcombo
Definition: k3sconfig.h:281
K3SpellConfig::sChangeEncoding
void sChangeEncoding(int)
Definition: k3sconfig.cpp:238
QFileInfo::setFile
void setFile(const QString &file)
K3SpellConfig::writeGlobalSettings
bool writeGlobalSettings()
Call this method before this class is deleted if you want the settings you have (or the user has) cho...
Definition: k3sconfig.cpp:220
QList::removeFirst
void removeFirst()
kconfig.h
QWidget::setMinimumWidth
void setMinimumWidth(int minw)
kstandardguiitem.h
QComboBox::clear
void clear()
K3SpellConfig::readGlobalSettings
bool readGlobalSettings()
Definition: k3sconfig.cpp:203
k3sconfig.h
KConfigGroup::writeEntry
void writeEntry(const QString &key, const QVariant &value, WriteConfigFlags pFlags=Normal)
QList::erase
iterator erase(iterator pos)
K3SpellConfig::fillDicts
void fillDicts(QComboBox *box, QStringList *dictionaries=0)
Get the translated dictionary names and, optionally, the corresponding internal dictionary names...
Definition: k3sconfig.cpp:673
K3SpellConfig::setNoRootAffix
void setNoRootAffix(bool)
Set an ISpell option.
Definition: k3sconfig.cpp:917
QGridLayout
K3SpellConfig
A configuration class/dialog for K3Spell.
Definition: k3sconfig.h:88
K3SpellConfig::langfnames
QStringList langfnames
Definition: k3sconfig.h:283
KLocale::countryCodeToName
QString countryCodeToName(const QString &country) const
QString::remove
QString & remove(int position, int n)
K3SpellConfig::qsdict
QString qsdict
Definition: k3sconfig.h:269
K3SpellConfig::dictFromList
bool dictFromList() const
Definition: k3sconfig.cpp:197
ktoolinvocation.h
kDebug
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
klocale.h
KLocale::languageCodeToName
QString languageCodeToName(const QString &language) const
QList::const_iterator
QComboBox::setItemText
void setItemText(int index, const QString &text)
KS_CLIENT_ASPELL
Definition: k3sconfig.h:62
KToolInvocation::invokeHelp
static void invokeHelp(const QString &anchor=QString(), const QString &appname=QString(), const QByteArray &startup_id=QByteArray())
i18nc
QString i18nc(const char *ctxt, const char *text)
K3SpellConfig::dictionary
const QString dictionary() const
Definition: k3sconfig.cpp:1013
KGlobal::config
KSharedConfigPtr config()
K3SpellConfig::dictcombo
QComboBox * dictcombo
Definition: k3sconfig.h:281
QFileInfo::filePath
QString filePath() const
QComboBox::addItem
void addItem(const QString &text, const QVariant &userData)
QLabel::setBuddy
void setBuddy(QWidget *buddy)
K3SpellConfig::setDoSpellChecking
void setDoSpellChecking(bool b)
Activate SpellChecking.
Definition: k3sconfig.cpp:908
KS_E_LATIN2
Definition: k3sconfig.h:44
kglobal.h
QWidget::setEnabled
void setEnabled(bool)
K3SpellConfig::iclient
int iclient
Definition: k3sconfig.h:274
KS_CLIENT_ISPELL
Definition: k3sconfig.h:61
QList::append
void append(const T &value)
KS_CLIENT_HSPELL
Definition: k3sconfig.h:63
KS_E_CP1255
Definition: k3sconfig.h:57
QList::empty
bool empty() const
QFileInfo::isDir
bool isDir() const
K3SpellConfig::replaceAllList
QStringList replaceAllList() const
Definition: k3sconfig.cpp:1181
QCheckBox
K3SpellConfig::sDictionary
void sDictionary(bool)
Definition: k3sconfig.cpp:1086
QObject::setObjectName
void setObjectName(const QString &name)
QString::isEmpty
bool isEmpty() const
K3SpellConfig::sPathDictionary
void sPathDictionary(bool)
Definition: k3sconfig.cpp:1102
K3SpellConfig::ignorelist
QStringList ignorelist
Definition: k3sconfig.h:271
QString::endsWith
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
K3SpellConfig::sDoSpell
void sDoSpell()
Definition: k3sconfig.cpp:1046
QList::first
T & first()
K3SpellConfig::~K3SpellConfig
virtual ~K3SpellConfig()
Deconstructor.
Definition: k3sconfig.cpp:190
KLocale::language
QString language() const
QString
KS_E_UTF8
Definition: k3sconfig.h:53
K3SpellConfig::doSpellChecking
bool doSpellChecking() const
Options reading routines.
Definition: k3sconfig.cpp:995
QLayout::setMargin
void setMargin(int margin)
QStringList
K3SpellConfig::bdospellchecking
bool bdospellchecking
Definition: k3sconfig.h:264
QString::right
QString right(int n) const
K3SpellConfig::dictlist
QLabel * dictlist
Definition: k3sconfig.h:280
QFileInfo
QFileInfo::exists
bool exists() const
K3SpellConfig::nodialog
bool nodialog
Definition: k3sconfig.h:268
K3SpellConfig::setDictionary
void setDictionary(const QString qs)
Set the name of the dictionary to use.
Definition: k3sconfig.cpp:935
K3SpellConfig::setRunTogether
void setRunTogether(bool)
Set an ISpell option.
Definition: k3sconfig.cpp:926
kpushbutton.h
K3SpellConfig::noRootAffix
bool noRootAffix() const
Definition: k3sconfig.cpp:1001
K3SpellConfig::setEncoding
void setEncoding(int enctype)
Definition: k3sconfig.cpp:976
KGlobal::locale
KLocale * locale()
QDir
QAbstractButton::setChecked
void setChecked(bool)
KConfigGroup
K3SpellConfig::setIgnoreList
void setIgnoreList(const QStringList &_ignorelist)
Options setting routines.
Definition: k3sconfig.cpp:1163
KStandardGuiItem::help
KGuiItem help()
K3SpellConfig::setClient
void setClient(int client)
Definition: k3sconfig.cpp:899
K3SpellConfig::sRunTogether
void sRunTogether(bool)
Definition: k3sconfig.cpp:1032
KS_E_ASCII
Definition: k3sconfig.h:42
QString::mid
QString mid(int position, int n) const
K3SpellConfig::setReplaceAllList
void setReplaceAllList(const QStringList &_replaceAllList)
The _replaceAllList contains word you like that replace word.
Definition: k3sconfig.cpp:1175
dir
QString dir(const QString &fileClass)
K3SpellConfig::enc
int enc
Definition: k3sconfig.h:263
QLatin1String
QComboBox::setInsertPolicy
void setInsertPolicy(InsertPolicy policy)
K3SpellConfig::sSetDictionary
void sSetDictionary(int)
Definition: k3sconfig.cpp:1078
QComboBox::setCurrentIndex
void setCurrentIndex(int index)
K3SpellConfig::activateHelp
void activateHelp(void)
Use this function to activate the help information for this widget.
Definition: k3sconfig.cpp:1123
QString::length
int length() const
K3SpellConfig::cb1
QCheckBox * cb1
Definition: k3sconfig.h:276
K3SpellConfig::sNoAff
void sNoAff(bool)
Definition: k3sconfig.cpp:1039
QString::left
QString left(int n) const
K3SpellConfig::setDictFromList
void setDictFromList(bool dfl)
Definition: k3sconfig.cpp:962
QPushButton
K3SpellConfig::dictfromlist
bool dictfromlist
Definition: k3sconfig.h:267
QStringList::indexOf
int indexOf(const QRegExp &rx, int from) const
QList::prepend
void prepend(const T &value)
klineedit.h
K3SpellConfig::cb0
QCheckBox * cb0
Definition: k3sconfig.h:276
K3SpellConfig::encodingcombo
QComboBox * encodingcombo
Definition: k3sconfig.h:281
K3SpellConfig::operator=
void operator=(const K3SpellConfig &ksc)
Definition: k3sconfig.cpp:1146
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QLabel
kguiitem.h
KConfigGroup::readEntry
T readEntry(const QString &key, const T &aDefault) const
K3SpellConfig::kc
KSharedConfig::Ptr kc
Definition: k3sconfig.h:273
K3SpellConfig::sChangeClient
void sChangeClient(int)
Definition: k3sconfig.cpp:246
QList::begin
iterator begin()
QComboBox::sizeHint
virtual QSize sizeHint() const
K3SpellConfig::client
int client() const
Spell checker client,.
Definition: k3sconfig.cpp:988
K3SpellConfig::fillInDialog
void fillInDialog()
Definition: k3sconfig.cpp:399
kconfiggroup.h
K3SpellConfig::cb2
QCheckBox * cb2
Definition: k3sconfig.h:276
K3SpellConfig::bnorootaffix
bool bnorootaffix
Definition: k3sconfig.h:265
K3SpellConfig::bruntogether
bool bruntogether
Definition: k3sconfig.h:266
K3SpellConfig::ignoreList
QStringList ignoreList() const
Definition: k3sconfig.cpp:1169
QComboBox
KS_CLIENT_ZEMBEREK
Definition: k3sconfig.h:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal