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

List:       kde-core-devel
Subject:    Re: huh???
From:       Frerich Raabe <raabe () kde ! org>
Date:       2004-04-28 15:25:13
Message-ID: 200404281725.14016.raabe () kde ! org
[Download RAW message or body]

On Wednesday 28 April 2004 17:23, George Staikos wrote:
> void KMdiMainFrm::removeFromActiveDockList(KMdiDockContainer* td) {
>   for (int i=0;i<4;i++) {
>     if (d->activeDockPriority[i]==td) {

It's iterating through the first four entries in the activeDockPriority, 
looking for whether the given dock container pointer 'td' is listed.

>       // FIXME: HUH??  i2 is never used here, and this for() loop modifies 
the
>       //        variable from the outer loop!! 
>       for (int i2=i;i<3;i++)
>         d->activeDockPriority[i]=d->activeDockPriority[i+1];
>       d->activeDockPriority[3]=0;
>       break;

If the dock container is found, it gets removed by shifting the subsequent 
dock containers one position forward. The comment is silly, IMHO it's quite 
obvious that for the inner loop references to "i" (except in the "int i2=i" 
part) should be changed to "i2".

For instance, if the current activeDockPriority list looks like "Foo Bar Blah 
Blubb" and "Bar" gets passed to this function, the list will AFAICS look like 
"Foo Blah Blubb 0".

- Frerich
[prev in list] [next in list] [prev in thread] [next in thread] 

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