mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 699742 - (3/4) battery.level should be a double (upower backend). r=cjones
This commit is contained in:
parent
5a0711c887
commit
a586195b8a
@ -80,8 +80,8 @@ public:
|
||||
void BeginListening();
|
||||
void StopListening();
|
||||
|
||||
float GetLevel();
|
||||
bool IsCharging();
|
||||
double GetLevel();
|
||||
bool IsCharging();
|
||||
|
||||
~UPowerClient();
|
||||
|
||||
@ -138,7 +138,7 @@ private:
|
||||
// The path of the tracked device.
|
||||
gchar* mTrackedDevice;
|
||||
|
||||
float mLevel;
|
||||
double mLevel;
|
||||
bool mCharging;
|
||||
|
||||
static UPowerClient* sInstance;
|
||||
@ -374,7 +374,7 @@ UPowerClient::GetDeviceProperties(const gchar* aDevice)
|
||||
void
|
||||
UPowerClient::UpdateSavedInfo(GHashTable* aHashTable)
|
||||
{
|
||||
mLevel = g_value_get_double(static_cast<const GValue*>(g_hash_table_lookup(aHashTable, "Percentage")))/100.f;
|
||||
mLevel = g_value_get_double(static_cast<const GValue*>(g_hash_table_lookup(aHashTable, "Percentage")))*0.01;
|
||||
|
||||
switch (g_value_get_uint(static_cast<const GValue*>(g_hash_table_lookup(aHashTable, "State")))) {
|
||||
case eState_Unknown:
|
||||
@ -393,7 +393,7 @@ UPowerClient::UpdateSavedInfo(GHashTable* aHashTable)
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
double
|
||||
UPowerClient::GetLevel()
|
||||
{
|
||||
return mLevel;
|
||||
|
Loading…
Reference in New Issue
Block a user