~nick-dedekind/indicator-power/lp1240756

« back to all changes in this revision

Viewing changes to src/device.c

  • Committer: Tarmac
  • Author(s): Charles Kerr
  • Date: 2013-08-23 17:56:56 UTC
  • mfrom: (188.1.2 lp-1216030)
  • Revision ID: tarmac-20130823175656-qguco5xbt2wvlctw
Don't show the time remaining for a discharging battery if it exceeds 24 hours because it's probably an erroneous time estimate. Fixes: https://bugs.launchpad.net/bugs/1216030.

Approved by Ted Gould, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
631
631
          g_string_printf (verbose_time, _("%s to charge"), readable_timestr);
632
632
          g_string_printf (accessible_time, _("%s to charge"), accessible_timestr);
633
633
        }
634
 
      else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*12)))
 
634
      else if ((state == UP_DEVICE_STATE_DISCHARGING) && (time <= (60*60*24)))
635
635
        {
636
636
          g_string_assign (terse_time, readable_timestr);
637
637
          g_string_printf (verbose_time, _("%s left"), readable_timestr);
639
639
        }
640
640
      else
641
641
        {
642
 
          /* if there's more than 12 hours remaining, we don't show it */
 
642
          /* if there's more than 24 hours remaining, we don't show it */
643
643
        }
644
644
 
645
645
      g_free (readable_timestr);