Unia/gtimeutils — pull request #2 by hede5562 (2013-11-24 19:34:43+00:00)
Title: Bug in Lap times

Two patches. First:

There's a bug in my last pull request. Pressing the "lap" button won't reset hours and minutes but only seconds for lap times.

Start the counter, wait 1:30 minutes and then press "lap". then wait an additional 10 seconds and then press "lap" a second time. the new lap time will be 1:20 instead of 0:20.

That's because "lapdiff = seconds" in on_funcs_button_clicked() assumes the global seconds to be all seconds from the start but counter() subtracts full hours and minutes from global seconds. So there are 2 ways to resolve this: add hours and minutes to seconds in on_funcs_button_clicked() or do not change the global seconds var in counter(). I choosed the second one.

Second:
I added a leading zero for the seconds counter. Looks nicer to me.