[gnome-calculator/gnome-3-12] Fix critical warnings when entering Financial Mode
- From: Arth Patel <arthpatel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator/gnome-3-12] Fix critical warnings when entering Financial Mode
- Date: Sun, 8 Jun 2014 20:33:23 +0000 (UTC)
commit fcd1dc75418bb00cd5d2f5d8b2d415630d00957a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Thu May 29 09:48:04 2014 -0500
Fix critical warnings when entering Financial Mode
Currency.number needs to be nullable.
https://bugzilla.gnome.org/show_bug.cgi?id=728826
src/currency.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/currency.vala b/src/currency.vala
index 7d6c753..a96df22 100644
--- a/src/currency.vala
+++ b/src/currency.vala
@@ -382,7 +382,7 @@ public class CurrencyManager : Object
/* Check if we couldn't find out a currency */
foreach (var c in currencies)
- if (c.get_value ().is_zero ())
+ if (c.get_value () == null || c.get_value ().is_zero ())
warning ("Currency %s is not provided by IMF or ECB", c.name);
debug ("Rates loaded");
@@ -469,7 +469,7 @@ public class CurrencyManager : Object
public class Currency : Object
{
- private Number value;
+ private Number? value;
private string _name;
public string name { owned get { return _name; } }
@@ -492,7 +492,7 @@ public class Currency : Object
this.value = value;
}
- public Number get_value ()
+ public Number? get_value ()
{
return value;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]