From 39db0d3af0ff9f7c55cdee988733fb0b3c0023c4 Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 9 Aug 2019 12:54:10 -0500 Subject: name cleanup for x86 model strings and intel pci device strings x86 CPU: * Remove (R), (TM), etc * AMD: remove redundant "X2 Dual Core", "X4 Quad Core", etc * Move vendor to front if not already * Remove speed, as the actual speed is usually right next to it * Remove "CPU", "APU", "Processor" to shorten * Compress space Intel GPU: * Remove (R) * Abbreviate "Generation": "Gen" * Remove "Processor", "Controller", and "Device" to shorten * Compress space Some examples: x86 CPU: 'AMD Turion(tm) 64 Mobile Technology ML-32' ---> 'AMD Turion 64 Mobile ML-32' 'Cyrix MediaGXtm MMXtm Enhanced' ---> 'Cyrix MediaGX MMX Enhanced' 'Transmeta(tm) Crusoe(tm) Processor TM5800' ---> 'Transmeta Crusoe TM5800' 'VIA Nano X2 L4350 @ 1.6+ GHz' ---> 'VIA Nano X2 L4350' 'AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53' ---> 'AMD Athlon 64 X2 TK-53' 'Embedded AMD Opteron(tm) Processor 23KS EE' ---> 'AMD Embedded Opteron 23KS EE' 'Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz' ---> 'Intel Atom x5-Z8300' 'Intel(R) Pentium(R) III CPU - S 1400MHz' ---> 'Intel Pentium III - S' 'Dual Core AMD Opteron(tm) Processor 165' ---> 'AMD Dual Core Opteron 165' 'Genuine Intel(R) CPU T1350 @ 1.86GHz' ---> 'Intel T1350' 'AMD Phenom(tm) 9350e Quad-Core Processor' ---> 'AMD Phenom 9350e Quad-Core' Intel GPU: 'Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller' ---> 'Atom/Celeron/Pentium x5-E8000/J3xxx/N3xxx Integrated Graphics' '4th Generation Core Processor Family Integrated Graphics Controller' ---> '4th Gen Core Family Integrated Graphics' 'Mobile GM965/GL960 Integrated Graphics Controller (secondary)' ---> 'Mobile GM965/GL960 Integrated Graphics (secondary)' 'Mobile 915GM/GMS/910GML Express Graphics Controller' ---> 'Mobile 915GM/GMS/910GML Express Graphics' Also: Fix/replace the appf() and SEQ() that were peppered about. Signed-off-by: Burt P --- hardinfo/vendor.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'hardinfo/vendor.c') diff --git a/hardinfo/vendor.c b/hardinfo/vendor.c index bd2642d8..5df57c52 100644 --- a/hardinfo/vendor.c +++ b/hardinfo/vendor.c @@ -26,9 +26,7 @@ #include "config.h" #include "hardinfo.h" #include "strstr_word.h" - -#include "dt_util.h" /* for appf() */ -#define SEQ(a,b) (g_strcmp0(a,b) == 0) +#include "util_sysobj.h" /* for appfsp() and SEQ() */ /* { match_string, match_rule, name, url } */ static Vendor vendors_builtin[] = { @@ -347,14 +345,14 @@ const Vendor *vendor_match(const gchar *id_str, ...) { if (id_str) { c++; tl += strlen(id_str); - tmp = appf(tmp, "%s", id_str); + tmp = appfsp(tmp, "%s", id_str); va_start(ap, id_str); p = va_arg(ap, gchar*); while(p) { c++; tl += strlen(p); - tmp = appf(tmp, "%s", p); + tmp = appfsp(tmp, "%s", p); p = va_arg(ap, gchar*); } va_end(ap); @@ -506,14 +504,14 @@ vendor_list vendors_match(const gchar *id_str, ...) { if (id_str) { c++; tl += strlen(id_str); - tmp = appf(tmp, "%s", id_str); + tmp = appfsp(tmp, "%s", id_str); va_start(ap, id_str); p = va_arg(ap, gchar*); while(p) { c++; tl += strlen(p); - tmp = appf(tmp, "%s", p); + tmp = appfsp(tmp, "%s", p); p = va_arg(ap, gchar*); } va_end(ap); -- cgit v1.2.3 From 4827b88fa34807425640d2a9f07bbf4ac4119ab3 Mon Sep 17 00:00:00 2001 From: Burt P Date: Sat, 10 Aug 2019 08:54:32 -0500 Subject: Add GTK_CHECK_VERSION(2, 18, 0) for links in label Alternative to https://github.com/lpereira/hardinfo/pull/418 Signed-off-by: Burt P --- hardinfo/vendor.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'hardinfo/vendor.c') diff --git a/hardinfo/vendor.c b/hardinfo/vendor.c index 5df57c52..83c99fcf 100644 --- a/hardinfo/vendor.c +++ b/hardinfo/vendor.c @@ -423,6 +423,11 @@ gchar *vendor_get_link(const gchar *id_str) gchar *vendor_get_link_from_vendor(const Vendor *v) { + gboolean label_link_ok = FALSE; +#if GTK_CHECK_VERSION(2, 18, 0) + label_link_ok = TRUE; +#endif + if (!v) { return g_strdup(_("Unknown")); } @@ -431,7 +436,7 @@ gchar *vendor_get_link_from_vendor(const Vendor *v) return g_strdup(v->name); } - if (params.markup_ok) { + if (params.markup_ok && label_link_ok) { const gchar *prefix; if (!strncmp(v->url, "http://", sizeof("http://") - 1) || -- cgit v1.2.3