diff options
Diffstat (limited to 'hardinfo2')
| -rw-r--r-- | hardinfo2/arch/linux/common/os.h | 10 | ||||
| -rw-r--r-- | hardinfo2/arch/linux/common/pci.h | 7 | ||||
| -rw-r--r-- | hardinfo2/arch/linux/common/usb.h | 39 | 
3 files changed, 33 insertions, 23 deletions
| diff --git a/hardinfo2/arch/linux/common/os.h b/hardinfo2/arch/linux/common/os.h index e4f35e95..6606123a 100644 --- a/hardinfo2/arch/linux/common/os.h +++ b/hardinfo2/arch/linux/common/os.h @@ -66,7 +66,7 @@ detect_desktop_environment(OperatingSystem * os)  {      const gchar *tmp = g_getenv("GNOME_DESKTOP_SESSION_ID");      FILE *version; -    int maj, min; +    char vers[16];      if (tmp) {  	/* FIXME: this might not be true, as the gnome-panel in path @@ -77,7 +77,7 @@ detect_desktop_environment(OperatingSystem * os)  	if (version) {  	    char gnome[10]; -	    fscanf(version, "%s gnome-panel %d.%d", gnome, &maj, &min); +	    fscanf(version, "%s gnome-panel %s", gnome, vers);  	    if (pclose(version))  	        goto unknown;  	} else { @@ -85,7 +85,7 @@ detect_desktop_environment(OperatingSystem * os)  	}  	os->desktop = -	    g_strdup_printf("GNOME %d.%d (session name: %s)", maj, min, +	    g_strdup_printf("GNOME %s (session name: %s)", vers,  			    tmp);      } else if (g_getenv("KDE_FULL_SESSION")) {  	version = popen("kcontrol --version", "r"); @@ -94,14 +94,14 @@ detect_desktop_environment(OperatingSystem * os)  	    fgets(buf, 32, version); -	    fscanf(version, "KDE: %d.%d", &maj, &min); +	    fscanf(version, "KDE: %s", vers);  	    if (pclose(version))  	        goto unknown;  	} else {  	    goto unknown;  	} -	os->desktop = g_strdup_printf("KDE %d.%d", maj, min); +	os->desktop = g_strdup_printf("KDE %s", vers);      } else {        unknown:  	if (!g_getenv("DISPLAY")) { diff --git a/hardinfo2/arch/linux/common/pci.h b/hardinfo2/arch/linux/common/pci.h index 388ce9aa..210306a2 100644 --- a/hardinfo2/arch/linux/common/pci.h +++ b/hardinfo2/arch/linux/common/pci.h @@ -86,7 +86,12 @@ __scan_pci(void)  	} else if (!strncmp(buf, "Subsystem", 9)) {  	    WALK_UNTIL(' ');  	    buf++; -	    strdevice = h_strdup_cprintf("OEM Vendor=%s\n", strdevice, buf); +	    const gchar *oem_vendor_url = vendor_get_url(buf); +            if (oem_vendor_url)  +                strdevice = h_strdup_cprintf("OEM Vendor=%s (%s)\n", +                                            strdevice, +                                            vendor_get_name(buf), +                                            oem_vendor_url);  	} else if (!strncmp(buf, "Capabilities", 12)  		   && !strstr(buf, "only to root") &&   		      !strstr(buf, "access denied")) { diff --git a/hardinfo2/arch/linux/common/usb.h b/hardinfo2/arch/linux/common/usb.h index f2592648..5cb31729 100644 --- a/hardinfo2/arch/linux/common/usb.h +++ b/hardinfo2/arch/linux/common/usb.h @@ -94,28 +94,33 @@ __scan_usb(void)                  const gchar *url = vendor_get_url(manuf);                  if (url) { -                    gchar *tmp = g_strdup_printf("%s (%s)", manuf, url); +                    gchar *tmp = g_strdup_printf("%s (%s)", vendor_get_name(manuf), url);                      g_free(manuf);                      manuf = tmp;                  }                  gchar *strhash = g_strdup_printf("[Device Information]\n" -                                                 "Product=%s\n" -                                                 "Manufacturer=%s\n" -                                                 "[Port #%d]\n" -                                                 "Speed=%.2fMbit/s\n" -                                                 "Max Current=%s\n" -                                                 "[Misc]\n" -                                                 "USB Version=%.2f\n" -                                                 "Revision=%.2f\n" -                                                 "Class=0x%x\n" -                                                 "Vendor=0x%x\n" -                                                 "Product ID=0x%x\n" -                                                 "Bus=%d\n" "Level=%d\n", -                                                 product, manuf, -                                                 port, speed, mxpwr, -                                                 ver, rev, classid, -                                                 vendor, prodid, bus, level); +                                                 "Product=%s\n", +						  product); +		if (manuf && strlen(manuf)) +                      strhash = h_strdup_cprintf("Manufacturer=%s\n", +						  strhash, +						  manuf); + +                strhash = h_strdup_cprintf("[Port #%d]\n" +                                           "Speed=%.2fMbit/s\n" +                                           "Max Current=%s\n" +                                           "[Misc]\n" +                                           "USB Version=%.2f\n" +                                           "Revision=%.2f\n" +                                           "Class=0x%x\n" +                                           "Vendor=0x%x\n" +                                           "Product ID=0x%x\n" +                                           "Bus=%d\n" "Level=%d\n", +                                           strhash, +                                           port, speed, mxpwr, +                                           ver, rev, classid, +                                           vendor, prodid, bus, level);                  g_hash_table_insert(moreinfo, tmp, strhash);              } | 
