[PATCH] KSpell2 improvement
Thiago Macieira
thiago at kde.org
Mon Mar 27 17:34:51 BST 2006
Mashrab Kuvatov wrote:
>Hi all,
>
>could anyone from TWG give a clear message if the patch is OK or not. If
> OK, where should it go? If not OK, why?
It's almost ok for KDE4, but not KDE 3.5.x. We've not lifted the message
freeze, so you cannot commit it to 3.5.x
If the message freeze is lifted again, you may commit to 3.5.x.
I also said "almost" because I see a couple of things that can be
improved.
First, you declare variantList as:
const variantListType variantList[] = {
please make that static as well, to avoid being initialised at every call
to languagesName.
Second, you construct allLocalizedDictionaries at every call to
languagesName. That sounds like a waste. I had recommended to implement
it with a static list instead, built on first use.
For the KDE4 code, I recommend using Q_GLOBAL_STATIC_WITH_ARGS:
Q_GLOBAL_STATIC_WITH_ARGS(QStringList, allLocalizedDictionaries,
(initAllLocalizedDictionaries()))
static QStringList initAllLocalizedDictionaries()
{
// put the real code here
}
QStringList Broker::languagesName() const
{
return allLocalizedDictionaries();
}
In this case, don't use "static" in variantList.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
thiago.macieira (AT) trolltech.com Trolltech AS
GPG: 0x6EF45358 | Sandakerveien 116,
E067 918B B660 DBD1 105C | NO-0402
966C 33F5 F005 6EF4 5358 | Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060327/983f298d/attachment.sig>
More information about the kde-core-devel
mailing list