From 8df96bed806e315fe2f72397507bf19561c9cd4a Mon Sep 17 00:00:00 2001 From: scachemaille Date: Wed, 24 Aug 2016 15:28:38 +0200 Subject: [PATCH 1/5] fix #155 --- src/mirrors_config.vala | 4 ++-- src/preferences_dialog.vala | 12 ++++++++++-- src/transaction.vala | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mirrors_config.vala b/src/mirrors_config.vala index 5c31303..3f95741 100644 --- a/src/mirrors_config.vala +++ b/src/mirrors_config.vala @@ -53,7 +53,7 @@ namespace Pamac { public void reload () { // set default options choosen_generation_method = "rank"; - choosen_country = dgettext (null, "Worldwide"); + choosen_country = "ALL"; mirrorlists_dir = "/etc/pacman.d/mirrors"; parse_file (conf_path); } @@ -123,7 +123,7 @@ namespace Pamac { } } else if (line.contains ("OnlyCountry")) { if (new_conf.lookup_extended ("OnlyCountry", null, out variant)) { - if (variant.get_string () == dgettext (null, "Worldwide")) { + if (variant.get_string () == "ALL") { data.append ("#%s\n".printf (line)); } else { data.append ("OnlyCountry=%s\n".printf (variant.get_string ())); diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index 04f8cb6..1fa16fe 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -321,7 +321,10 @@ namespace Pamac { void on_mirrors_country_comboboxtext_changed () { var new_mirrors_conf = new HashTable (str_hash, str_equal); - new_mirrors_conf.insert ("OnlyCountry", new Variant.string (mirrors_country_comboboxtext.get_active_text ())); + var mirror_country = mirrors_country_comboboxtext.get_active_text (); + if(mirror_country == dgettext (null, "Worldwide")) + mirror_country = "ALL"; + new_mirrors_conf.insert ("OnlyCountry", new Variant.string (mirror_country) ); transaction.start_write_mirrors_config (new_mirrors_conf); } @@ -337,10 +340,15 @@ namespace Pamac { void on_write_mirrors_config_finished (string choosen_country, string choosen_generation_method) { int index = 0; + + string choosen_country_ = dgettext (null, "Worldwide"); + if( choosen_country != "ALL") + choosen_country_ = choosen_country; + mirrors_country_comboboxtext.model.foreach ((model, path, iter) => { GLib.Value country; model.get_value (iter, 0, out country); - if ((string) country == choosen_country) { + if ((string) country == choosen_country_) { return true; } index += 1; diff --git a/src/transaction.vala b/src/transaction.vala index d0371f3..d44890a 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -const string VERSION = "4.1.1"; +const string VERSION = "4.1.1-1"; namespace Pamac { [DBus (name = "org.manjaro.pamac")] From 2d97b15c59523714d1c12bdec6880dedee0c2065 Mon Sep 17 00:00:00 2001 From: scachemaille Date: Wed, 24 Aug 2016 15:31:30 +0200 Subject: [PATCH 2/5] Revert VERSION --- src/transaction.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transaction.vala b/src/transaction.vala index d44890a..d0371f3 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -const string VERSION = "4.1.1-1"; +const string VERSION = "4.1.1"; namespace Pamac { [DBus (name = "org.manjaro.pamac")] From bc239fc88ad65dba14a631c5578b278508b8da63 Mon Sep 17 00:00:00 2001 From: scachemaille Date: Wed, 24 Aug 2016 15:39:55 +0200 Subject: [PATCH 3/5] Fix indentation --- src/preferences_dialog.vala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index 1fa16fe..f7d82f4 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -321,7 +321,7 @@ namespace Pamac { void on_mirrors_country_comboboxtext_changed () { var new_mirrors_conf = new HashTable (str_hash, str_equal); - var mirror_country = mirrors_country_comboboxtext.get_active_text (); + var mirror_country = mirrors_country_comboboxtext.get_active_text (); if(mirror_country == dgettext (null, "Worldwide")) mirror_country = "ALL"; new_mirrors_conf.insert ("OnlyCountry", new Variant.string (mirror_country) ); @@ -341,9 +341,9 @@ namespace Pamac { void on_write_mirrors_config_finished (string choosen_country, string choosen_generation_method) { int index = 0; - string choosen_country_ = dgettext (null, "Worldwide"); - if( choosen_country != "ALL") - choosen_country_ = choosen_country; + string choosen_country_ = dgettext (null, "Worldwide"); + if( choosen_country != "ALL") + choosen_country_ = choosen_country; mirrors_country_comboboxtext.model.foreach ((model, path, iter) => { GLib.Value country; From 649ed1970e07fea84fe46a4edb7b2ad3c7563777 Mon Sep 17 00:00:00 2001 From: scachemaille Date: Wed, 24 Aug 2016 16:40:26 +0200 Subject: [PATCH 4/5] fix style and indentation --- src/preferences_dialog.vala | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index f7d82f4..cdfba85 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -321,9 +321,10 @@ namespace Pamac { void on_mirrors_country_comboboxtext_changed () { var new_mirrors_conf = new HashTable (str_hash, str_equal); - var mirror_country = mirrors_country_comboboxtext.get_active_text (); - if(mirror_country == dgettext (null, "Worldwide")) + var mirror_country = mirrors_country_comboboxtext.get_active_text (); + if (mirror_country == dgettext (null, "Worldwide")) { mirror_country = "ALL"; + } new_mirrors_conf.insert ("OnlyCountry", new Variant.string (mirror_country) ); transaction.start_write_mirrors_config (new_mirrors_conf); } @@ -340,11 +341,10 @@ namespace Pamac { void on_write_mirrors_config_finished (string choosen_country, string choosen_generation_method) { int index = 0; - - string choosen_country_ = dgettext (null, "Worldwide"); - if( choosen_country != "ALL") - choosen_country_ = choosen_country; - + string choosen_country_ = dgettext (null, "Worldwide"); + if ( choosen_country != "ALL") { + choosen_country_ = choosen_country; + } mirrors_country_comboboxtext.model.foreach ((model, path, iter) => { GLib.Value country; model.get_value (iter, 0, out country); From 2352ecd926877b0690beeac7ce45caceef69ea09 Mon Sep 17 00:00:00 2001 From: scachemaille Date: Wed, 24 Aug 2016 16:46:24 +0200 Subject: [PATCH 5/5] fix style and indentation --- src/preferences_dialog.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/preferences_dialog.vala b/src/preferences_dialog.vala index cdfba85..1696a9d 100644 --- a/src/preferences_dialog.vala +++ b/src/preferences_dialog.vala @@ -342,7 +342,7 @@ namespace Pamac { void on_write_mirrors_config_finished (string choosen_country, string choosen_generation_method) { int index = 0; string choosen_country_ = dgettext (null, "Worldwide"); - if ( choosen_country != "ALL") { + if (choosen_country != "ALL") { choosen_country_ = choosen_country; } mirrors_country_comboboxtext.model.foreach ((model, path, iter) => {