~khurshid-alam/unity-settings-daemon/port-to-upower-99

« back to all changes in this revision

Viewing changes to plugins/power/gsd-power-manager.c

  • Committer: Khurshid Alam
  • Date: 2019-03-17 07:22:26 UTC
  • Revision ID: khurshid.alam@linuxmail.org-20190317072226-q3zuzf9vgj48rjej
power: Remove on AC check from warning-levels

Show diffs side-by-side

added added

removed removed

Lines of Context:
1171
1171
                      "time-to-empty", &time_to_empty,
1172
1172
                      NULL);
1173
1173
 
1174
 
        /* check to see if the batteries have not noticed we are on AC */
1175
 
        if (kind == UP_DEVICE_KIND_BATTERY) {
1176
 
                if (!up_client_get_on_battery (manager->priv->up_client)) {
1177
 
                        g_warning ("ignoring low message as we are not on battery power");
1178
 
                        goto out;
1179
 
                }
1180
 
        }
1181
1174
 
1182
1175
        if (kind == UP_DEVICE_KIND_BATTERY) {
1183
1176
 
1287
1280
                         /* TRANSLATORS: this is the sound description */
1288
1281
                         CA_PROP_EVENT_DESCRIPTION, _("Battery is low"), NULL);
1289
1282
 
1290
 
out:
1291
1283
        if (icon != NULL)
1292
1284
                g_object_unref (icon);
1293
1285
        g_free (message);
1312
1304
                      "time-to-empty", &time_to_empty,
1313
1305
                      NULL);
1314
1306
 
1315
 
        /* check to see if the batteries have not noticed we are on AC */
1316
 
        if (kind == UP_DEVICE_KIND_BATTERY) {
1317
 
                if (!up_client_get_on_battery (manager->priv->up_client)) {
1318
 
                        g_warning ("ignoring critically low message as we are not on battery power");
1319
 
                        goto out;
1320
 
                }
1321
 
        }
1322
1307
 
1323
1308
        if (kind == UP_DEVICE_KIND_BATTERY) {
1324
1309
 
1468
1453
                                 CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
1469
1454
                break;
1470
1455
        }
1471
 
out:
 
1456
 
1472
1457
        if (icon != NULL)
1473
1458
                g_object_unref (icon);
1474
1459
        g_free (message);
1489
1474
                      "kind", &kind,
1490
1475
                      NULL);
1491
1476
 
1492
 
        /* check to see if the batteries have not noticed we are on AC */
1493
 
        if (kind == UP_DEVICE_KIND_BATTERY) {
1494
 
                if (!up_client_get_on_battery (manager->priv->up_client)) {
1495
 
                        g_warning ("ignoring critically low message as we are not on battery power");
1496
 
                        goto out;
1497
 
                }
1498
 
        }
1499
1477
 
1500
1478
        if (kind == UP_DEVICE_KIND_BATTERY) {
1501
1479
 
1596
1574
                         CA_PROP_EVENT_ID, "battery-caution",
1597
1575
                         /* TRANSLATORS: this is the sound description */
1598
1576
                         CA_PROP_EVENT_DESCRIPTION, _("Battery is critically low"), NULL);
1599
 
out:
 
1577
 
1600
1578
        if (icon != NULL)
1601
1579
                g_object_unref (icon);
1602
1580
        g_free (message);