Sonnet
kspell_hunspellclient.cpp
Go to the documentation of this file.
00001 00021 #include "kspell_hunspellclient.h" 00022 #include <QDir> 00023 00024 #include "kspell_hunspelldict.h" 00025 00026 #include <kpluginfactory.h> 00027 #include <kpluginloader.h> 00028 #include <kdebug.h> 00029 00030 K_PLUGIN_FACTORY( HunspellClientFactory, registerPlugin<HunspellClient>(); ) 00031 K_EXPORT_PLUGIN( HunspellClientFactory( "kspell_hunspell" ) ) 00032 00033 using namespace Sonnet; 00034 00035 HunspellClient::HunspellClient( QObject *parent, const QVariantList& /* args */ ) 00036 : Client( parent ) 00037 { 00038 kDebug()<<" HunspellClient::HunspellClient"; 00039 } 00040 00041 HunspellClient::~HunspellClient() 00042 { 00043 } 00044 00045 SpellerPlugin *HunspellClient::createSpeller(const QString &language) 00046 { 00047 kDebug()<<" SpellerPlugin *HunspellClient::createSpeller(const QString &language) ;"<<language; 00048 HunspellDict *ad = new HunspellDict( language ); 00049 return ad; 00050 } 00051 00052 QStringList HunspellClient::languages() const 00053 { 00054 QStringList lst; 00055 QDir dir("/usr/share/myspell/dicts/"); 00056 if(dir.exists()) 00057 { 00058 QStringList lstDic = dir.entryList(QStringList("*.dic"), QDir::Files ); 00059 foreach(const QString &tmp, lstDic) 00060 { 00061 lst<< tmp.remove(".dic"); 00062 } 00063 } 00064 kDebug()<<" lst !!!!!!!!!!!!!!!!!!!!!!!! :"<<lst; 00065 return lst; 00066 } 00067 00068 #include "kspell_hunspellclient.moc"
KDE 4.6 API Reference