[gnome-boxes] unattended-installer: Drop unjustified use of HashTable



commit 849f03fd3932abc45edacb9b14d8334c1224cb78
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Jul 1 14:15:01 2014 +0100

    unattended-installer: Drop unjustified use of HashTable
    
    HashTables are for keeping mapping from one entity to another, not for
    keeping a list of items. Lets use arrays and at the same time avoid
    warning from valac about use of deprecated GLib.Hashtable.add().

 src/unattended-installer.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/unattended-installer.vala b/src/unattended-installer.vala
index b1848da..0e894ce 100644
--- a/src/unattended-installer.vala
+++ b/src/unattended-installer.vala
@@ -640,11 +640,11 @@ private class Boxes.UnattendedInstaller: InstallerMedia {
 
     private string get_preferred_language () {
         var system_langs = Intl.get_language_names ();
-        var media_langs = new HashTable<string, unowned string> (str_hash, str_equal);
+        string[] media_langs = {};
         var media_langs_list = os_media.languages;
 
         foreach (var lang in media_langs_list)
-            media_langs.add (lang);
+            media_langs += lang;
 
         foreach (var lang in system_langs) {
             if (lang in media_langs) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]