khtml/kjs: cacheGlobalObject

Peter Kümmel syntheticpp at gmx.net
Fri Feb 10 06:41:49 CET 2006


David Faure wrote:
> On Sunday 05 February 2006 21:15, Peter Kümmel wrote:
>> I've successfully compiled khtml with msvc.
>>
>> But to make it to compile I must change the template function
>> cacheGlobalObject.
>>
>> The old usage is:
>>
>> cacheGlobalObject<NodeConstructor>(...)
>>
>>
>> the new one reads nearly like as plain English:
>>
>> cacheGlobal<NodeConstructor>::Object( ... );
>>
>>
>> Are there objections against changing cacheGlobalObject.
> 
> No, but please send the patch to khtml-devel at kde.org too. 
> 

Do you mean I should check in and do a CCMAIL or only
post to khtml-devel?

I've subscribed to khtml-devel but there is no reaction of the
moderator, so my porposal could not pass.


I've tested the changes under Linux with Gcc 4.0, and there are
no problems.

I think I should also change the name (as Alex suggested), because
is "cacheGlobal" a good name for a struct.

What about

struct Cache {
... getGlobalObject(...)

then calling looks like

... = Cache<T>::getGlobalObject

this describes better the job of the function, even better
than the original naming.



I've also tested a wrapper class for the old calling style,
because I don't know how much this function is used outside
of kdelibs:

template <class ClassCtor>
inline KJS::JSObject *cacheGlobalObject(KJS::ExecState *exec, const KJS::Identifier &propertyName)
{
   return Cache<ClassCtor>::getGlobalObject(exec, propertyName);
}


Are there any reasons not to submit today?


Cheers,
Peter















More information about the Kde-buildsystem mailing list