[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KLineEdit::keyPressEvent() reading from config
From:       Dawit Alemayehu <adawit () starpower ! net>
Date:       2001-11-26 4:50:37
[Download RAW message or body]

On Sunday 25 November 2001 02:44, Ellis Whitehead wrote:
> On Saturday 24 November 2001 10:12 pm, Carsten Pfeiffer wrote:
> > [snip]
> >
> > > What I'm thinking is that the keys could be read in once upon widget
> > > creation and stored in static variables.  Disadvantage: If the standard
> > > key
> >
> > What about doing this in KStdAccel, and not in every place it is used?
>
> Ok, I'll implement this and use KIPC as Daniel Molkentin suggested to keep
> it up to date.

Please reconsider this.  IMHO it is unnecessary optimaztion with a side effect of growing 
the class as well as creating unnecessary dependency.  As I have already stated 
KGlobal::config() is a static object and as such is only read once not everytime a key is 
pressed!  Infact I have no idea at this point how the key-bindings that have already been 
read get updated once the user make changes in control panel!

The most concerning issue is that there seems to be some rather expensive string operations 
in KStdAccel::keys as discussed on IRC with Carsten.  What is even more confusing to me as 
I read the KStdAccel header file is that someone (is that you?) put a TODO: line saying that 
something along the lines of ::keys being deprecated!  So I did not touch anything in there for
now.  IMHO what needs to happen is that we need to make sure that no expensive string 
operations take place in any of this functions so that they do not introduce much overhead if 
invoked on every keypress for example.

Regards,
Dawit A.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic