[gnome-calculator] Fix CI build and first-load of currencies
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Fix CI build and first-load of currencies
- Date: Thu, 14 Jan 2021 09:35:35 +0000 (UTC)
commit 4b93ed6dc0e66b86cae22f4448898a2f5210b7f9
Author: Robert Roth <robert roth off gmail com>
Date: Thu Jan 14 11:35:12 2021 +0200
Fix CI build and first-load of currencies
.gitlab-ci.yml | 2 +-
lib/currency.vala | 14 ++++++++++++--
src/gnome-calculator.vala | 1 +
3 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 41cbd70b..18329fb9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,7 +25,7 @@
stage: test
script:
- broadwayd &
- - GDK_BACKEND=broadway ninja -C _build install test
+ - GDK_BACKEND=broadway ninja -C _build test
build:fedora:
<<: *fedora_before_script
diff --git a/lib/currency.vala b/lib/currency.vala
index 0ee65563..79de43e3 100644
--- a/lib/currency.vala
+++ b/lib/currency.vala
@@ -17,7 +17,18 @@ public class CurrencyManager : Object
{
private List<Currency> currencies;
- public int refresh_interval { get; set; }
+ protected int _refresh_interval;
+
+ public int refresh_interval {
+ get {
+ return _refresh_interval;
+ }
+ set {
+ loaded_rates = false;
+ _refresh_interval = value;
+ download_rates ();
+ }
+ }
public signal void updated ();
@@ -27,7 +38,6 @@ public class CurrencyManager : Object
return default_currency_manager;
default_currency_manager = new CurrencyManager ();
- default_currency_manager.refresh_interval = new Settings ("org.gnome.calculator").get_int
("refresh-interval");
default_currency_manager.currencies.append (new Currency ("AED", _("UAE Dirham"), "إ.د"));
default_currency_manager.currencies.append (new Currency ("AUD", _("Australian Dollar"), "$"));
default_currency_manager.currencies.append (new Currency ("BDT", _("Bangladeshi Taka"), "৳"));
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index 8f4a3ec1..6490af2d 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -123,6 +123,7 @@ public class Calculator : Gtk.Application
last_opened_window = create_new_window (settings);
// restore the first window position from the settings
load_window_position (last_opened_window);
+ CurrencyManager.get_default ().refresh_interval = settings.get_int ("refresh-interval");
}
private MathWindow get_active_math_window ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]