[gnome-clocks/gnome-3-22] timer: Fix incorrect minutes reset



commit 090a6d29103bafc58e7033a97330500b356a049f
Author: Josh Brobst <josh brob st>
Date:   Tue Dec 6 22:14:37 2016 -0500

    timer: Fix incorrect minutes reset
    
    When resetting the timer, the values for the spinbuttons are determined
    from the timer starting amount in seconds. In order to get the correct
    number of minutes from this value, we must first account for the number
    of hours present (mod 3600) before converting from seconds to minutes
    (truncated division by 60).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=774479

 src/timer.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/timer.vala b/src/timer.vala
index 783e452..8d7e23d 100644
--- a/src/timer.vala
+++ b/src/timer.vala
@@ -230,7 +230,7 @@ public class Face : Gtk.Stack, Clocks.Clock {
         remove_tick ();
         span = settings.get_uint ("timer");
         h_spinbutton.value = (int) span / 3600;
-        m_spinbutton.value = (int) span / 60;
+        m_spinbutton.value = (int) span % 3600 / 60;
         s_spinbutton.value = span % 60;
         left_button.get_style_context ().remove_class("clocks-go");
         countdown_frame.get_style_context ().remove_class ("clocks-paused");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]