~seb128/indicator-power/use-universe-translations

« back to all changes in this revision

Viewing changes to src/device.c

Fix bug that chose the wrong header icon if a connected device has a charge but its charging/discharging state is unknown. (LP: #1470080)

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
          }
435
435
        g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging-symbolic", kind_str, suffix_str));
436
436
        g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, suffix_str));
437
 
        break;
 
437
        // NB: fallthrough to use foo-bar as a fallback for foo-bar-charging
438
438
 
439
439
      case UP_DEVICE_STATE_PENDING_CHARGE:
440
440
      case UP_DEVICE_STATE_DISCHARGING:
441
441
      case UP_DEVICE_STATE_PENDING_DISCHARGE:
 
442
      case UP_DEVICE_STATE_UNKNOWN: /* http://pad.lv/1470080 */
442
443
        suffix_str = get_device_icon_suffix (percentage);
443
444
        index_str = get_closest_10_percent_percentage (percentage);
444
445
        g_ptr_array_add (names, g_strdup_printf ("%s-%s", kind_str, index_str));