[caribou] Don't throw an error when no supported layout is found.



commit 5476dc658b54cd6c013fa15ac88c046156f92cf9
Author: Eitan Isaacson <eitan monotonous org>
Date:   Wed Jul 20 12:35:58 2011 -0700

    Don't throw an error when no supported layout is found.
    
    Thanks Nohemi!

 libcaribou/xml-deserializer.vala |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/libcaribou/xml-deserializer.vala b/libcaribou/xml-deserializer.vala
index d56e22b..853e255 100644
--- a/libcaribou/xml-deserializer.vala
+++ b/libcaribou/xml-deserializer.vala
@@ -43,8 +43,13 @@ namespace Caribou {
                     return fn;
             }
 
-            throw new IOError.NOT_FOUND (
-                "Could not find layout file for %s %s", group, variant);                       }
+            // If no layout file is found, default to US
+            foreach (string data_dir in dirs) {
+                string fn = get_layout_file_inner (data_dir, "us", "");
+                if (fn != null)
+                    return fn;
+            }
+        }
 
         public static GroupModel? load_group (string keyboard_type,
                                               string group, string variant) {
@@ -154,4 +159,4 @@ namespace Caribou {
             return key;
         }
     }
-}
\ No newline at end of file
+}



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