[gnome-calculator] Revert "Fixed broken currency conversion (fixes #199)"
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Revert "Fixed broken currency conversion (fixes #199)"
- Date: Mon, 4 Jan 2021 14:02:33 +0000 (UTC)
commit aad1953d082258d189f31a2ad5529ce2445b3443
Author: Robert Roth <robert roth off gmail com>
Date: Mon Jan 4 16:02:06 2021 +0200
Revert "Fixed broken currency conversion (fixes #199)"
This reverts commit 5399029fd8a82ee331ebed0bb632d27d21800889.
lib/currency.vala | 23 ++++++++++++-----------
src/gnome-calculator.vala | 1 +
2 files changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/lib/currency.vala b/lib/currency.vala
index a0b3e7d9..e366522c 100644
--- a/lib/currency.vala
+++ b/lib/currency.vala
@@ -27,7 +27,7 @@ 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"), "৳"));
@@ -122,7 +122,7 @@ public class CurrencyManager : Object
private string get_imf_rate_filepath ()
{
- return Path.build_filename (Environment.get_user_cache_dir (), "gnome-calculator", "rms_rep.xls");
+ return Path.build_filename (Environment.get_user_cache_dir (), "gnome-calculator", "rms_five.xls");
}
private string get_ecb_rate_filepath ()
@@ -245,15 +245,16 @@ public class CurrencyManager : Object
{
line = line.chug ();
- /* Start after Last Updated, end on Notes:*/
- if (line.has_prefix ("Last Updated:"))
- {
- in_data = true;
- continue;
- } else if (line.has_prefix ("Notes:"))
+ /* Start after first blank line, stop on next */
+ if (line == "")
{
- in_data = false;
- continue;
+ if (!in_data)
+ {
+ in_data = true;
+ continue;
+ }
+ else
+ break;
}
if (!in_data)
continue;
@@ -391,7 +392,7 @@ public class CurrencyManager : Object
{
downloading_imf_rates = true;
debug ("Downloading rates from the IMF...");
- download_file.begin ("https://www.imf.org/external/np/fin/data/rms_rep.aspx?tsvflag=Y", path,
"IMF");
+ download_file.begin ("https://www.imf.org/external/np/fin/data/rms_five.aspx?tsvflag=Y", path,
"IMF");
}
path = get_ecb_rate_filepath ();
if (!downloading_ecb_rates && file_needs_update (path, refresh_interval))
diff --git a/src/gnome-calculator.vala b/src/gnome-calculator.vala
index b2b52d58..6edf4c8b 100644
--- a/src/gnome-calculator.vala
+++ b/src/gnome-calculator.vala
@@ -121,6 +121,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]