diff options
author | Agney Lopes Roth Ferraz <agney@debian.org> | 2007-04-09 11:45:31 -0300 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:41 -0500 |
commit | adb3993ba087ede46f62d5f018e17b07e99b5260 (patch) | |
tree | 67b4fa7e224f09d21eb76060422ca23e50e6dfe0 /arch/linux/common/inputdevices.h | |
parent | b3e31ae3787c8806f48c85a52bba9aa3554e2c07 (diff) | |
parent | 11b8179a57e675c6672cbe649c655230ae3e9744 (diff) |
Import Debian changes 0.4.2.1-1
hardinfo (0.4.2.1-1) unstable; urgency=low
* New upstream release.
* Fixed segfault on device entry (Closes: #387955)
Diffstat (limited to 'arch/linux/common/inputdevices.h')
-rw-r--r-- | arch/linux/common/inputdevices.h | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/arch/linux/common/inputdevices.h b/arch/linux/common/inputdevices.h index 44a109ca..1a5baff8 100644 --- a/arch/linux/common/inputdevices.h +++ b/arch/linux/common/inputdevices.h @@ -22,8 +22,6 @@ static gboolean remove_input_devices(gpointer key, gpointer value, gpointer data) { if (!strncmp((gchar *) key, "INP", 3)) { - g_free((gchar *) key); - g_free((GtkTreeIter *) value); return TRUE; } @@ -42,7 +40,7 @@ static struct { }; void -scan_inputdevices(void) +__scan_input_devices(void) { FILE *dev; gchar buffer[128]; @@ -55,7 +53,7 @@ scan_inputdevices(void) return; if (input_list) { - g_hash_table_foreach_remove(devices, remove_input_devices, NULL); + g_hash_table_foreach_remove(moreinfo, remove_input_devices, NULL); g_free(input_list); g_free(input_icons); } @@ -103,15 +101,31 @@ scan_inputdevices(void) gchar *strhash = g_strdup_printf("[Device Information]\n" "Name=%s\n" "Type=%s\n" - "Bus=0x%x\n" - "Vendor=0x%x\n" - "Product=0x%x\n" - "Version=0x%x\n" - "Connected to=%s\n", - name, input_devices[d].name, - bus, vendor, product, - version, phys); - g_hash_table_insert(devices, tmp, strhash); + "Bus=0x%x\n", + name, + input_devices[d].name, + bus); + + const gchar *url = vendor_get_url(name); + if (url) { + strhash = g_strdup_printf("%s" + "Vendor=%s (%s)\n", + strhash, + vendor_get_name(name), + url); + } else { + strhash = g_strdup_printf("%s" + "Vendor=%x\n", + strhash, + vendor); + } + + strhash = g_strdup_printf("%s" + "Product=0x%x\n" + "Version=0x%x\n" + "Connected to=%s\n", + strhash, product, version, phys); + g_hash_table_insert(moreinfo, tmp, strhash); g_free(phys); g_free(name); |