[Kmymoney-devel] Patch-Review

Colin cdwright at gwi.net
Tue Feb 16 15:14:23 CET 2010


On Tuesday February 16 2010 03:10 am Thomas Baumgart wrote:
> Hi,
> 
> I want to apply the following change, which in my eyes is necessary.
> Reason: In the the line
> 
>   t_it = schedule.erase(t_it);
> 
> is executed, but t_it != schedule.end(), t_it get incremented which is
> false.
> 
> The continue statement immediately goes to the loop-termination expression
> in that case, which should quit the loop in case of t_it == schedule.end()
> anyway.
> 
> Comments welcome.
> 
> 
> Index: khomeview.cpp
>: 
===================================================================
> --- khomeview.cpp       (revision 1090614)
> +++ khomeview.cpp       (working copy)
> @@ -449,10 +449,7 @@
>          //if nextDueDate is still currentDate then remove it from
> scheduled payments
>          if ((*t_it).nextDueDate() == QDate::currentDate()) {
>            t_it = schedule.erase(t_it);
> -
> -          //break it that was the last schedule
> -          if (t_it == schedule.end())
> -            break;
> +          continue;
>          }
>        }
>        ++t_it;

Thomas,

It's definitely a bug.  The change is also consistent with other code in the 
function.

I notice that there is the same code is in the KDE3 version so you could fix 
both versions.

Thanks,

Colin


More information about the KMyMoney-devel mailing list