[PATCH] KSpell2 improvement

Mashrab Kuvatov kmashrab at sat.physik.uni-bremen.de
Mon Mar 27 19:16:32 BST 2006


On Monday 27 March 2006 18:34, Thiago Macieira wrote:

> First, you declare variantList as:
>     const variantListType variantList[] = {
>
> please make that static as well, to avoid being initialised at every call
> to languagesName.

OK.

> Second, you construct allLocalizedDictionaries at every call to
> languagesName.

+    if (languagesNameCache.count() == languages().count() )
+           return languagesNameCache;

It is not constructed at every call, it is cached (if my definition of cache 
is the same as yours).

The above if is false when the method is called once and then new dictionary 
is installed (or removed) on the system. Taking into account one doesn't 
install/remove spellchecking dictionaries every second the method does its 
job only once. The other time it returns the cached list.

There is no offense. I think there is a misunderstanding. So, I'm just trying 
to explain.

> 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:

I think it makes the code complicated. If you insist on it, I'll try to 
implement it.

Cheers,
Mashrab.
-- 
PGP key: www.uni-bremen.de/~kmashrab/kmashrab.asc
-------------- 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/462a6fdd/attachment.sig>


More information about the kde-core-devel mailing list