And fix up all the broken HasLens, glib doesn't parse a capitalised boolean.

Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net>
---
 data/libwacom.stylus         | 14 +++++++-------
 libwacom/libwacom-database.c | 15 ++++++++++++---
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/data/libwacom.stylus b/data/libwacom.stylus
index 290fe5e..318936d 100644
--- a/data/libwacom.stylus
+++ b/data/libwacom.stylus
@@ -313,47 +313,47 @@ Type=Airbrush
 # Intuos and Intuos2
 Name=Lens Cursor
 Type=Puck
-HasLens=True
+HasLens=true
 Buttons=5
 
 [0x097]
 # Intuos3
 Name=Lens Cursor
 Type=Puck
-HasLens=True
+HasLens=true
 Buttons=5
 
 [0x006]
 # Intuos4 and Intuos5
 Name=Lens Cursor
 Type=Puck
-HasLens=True
+HasLens=true
 Buttons=5
 
 [0x094]
 # Intuos and Intuos2
 Name=4D Mouse
 Type=Puck
-HasLens=False
+HasLens=false
 Buttons=5
 
 [0x007]
 # Intuos3
 Name=2D Mouse
 Type=Puck
-HasLens=False
+HasLens=false
 Buttons=3
 
 [0x017]
 # Intuos3
 Name=Mouse
 Type=Puck
-HasLens=False
+HasLens=false
 Buttons=5
 
 [0x806]
 # Intuos4 and Intuos5
 Name=Five Button Mouse
 Type=Puck
-HasLens=False
+HasLens=false
 Buttons=5
diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
index e6762b0..33b8bdc 100644
--- a/libwacom/libwacom-database.c
+++ b/libwacom/libwacom-database.c
@@ -201,16 +201,25 @@ libwacom_parse_stylus_keyfile(WacomDeviceDatabase *db, 
const char *path)
                stylus->id = id;
                stylus->name = g_key_file_get_string(keyfile, groups[i], 
"Name", NULL);
 
-               stylus->is_eraser = g_key_file_get_boolean(keyfile, groups[i], 
"IsEraser", NULL);
+               stylus->is_eraser = g_key_file_get_boolean(keyfile, groups[i], 
"IsEraser", &error);
+               if (error && error->code == G_KEY_FILE_ERROR_INVALID_VALUE)
+                       g_warning ("Stylus %s (%s) %s\n", stylus->name, 
groups[i], error->message);
+               g_clear_error (&error);
 
                if (stylus->is_eraser == FALSE) {
-                       stylus->has_eraser = g_key_file_get_boolean(keyfile, 
groups[i], "HasEraser", NULL);
+                       stylus->has_eraser = g_key_file_get_boolean(keyfile, 
groups[i], "HasEraser", &error);
+                       if (error && error->code == 
G_KEY_FILE_ERROR_INVALID_VALUE)
+                               g_warning ("Stylus %s (%s) %s\n", stylus->name, 
groups[i], error->message);
+                       g_clear_error (&error);
                        stylus->num_buttons = g_key_file_get_integer(keyfile, 
groups[i], "Buttons", &error);
                        if (stylus->num_buttons == 0 && error != NULL) {
                                stylus->num_buttons = -1;
                                g_clear_error (&error);
                        }
-                       stylus->has_lens = g_key_file_get_boolean(keyfile, 
groups[i], "HasLens", NULL);
+                       stylus->has_lens = g_key_file_get_boolean(keyfile, 
groups[i], "HasLens", &error);
+                       if (error && error->code == 
G_KEY_FILE_ERROR_INVALID_VALUE)
+                               g_warning ("Stylus %s (%s) %s\n", stylus->name, 
groups[i], error->message);
+                       g_clear_error (&error);
                } else {
                        stylus->num_buttons = 0;
                        stylus->has_eraser = FALSE;
-- 
2.1.0


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to