aboutsummaryrefslogtreecommitdiff
path: root/modules/devices
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2019-12-27 17:42:34 -0600
committerLeandro A. F. Pereira <leandro@hardinfo.org>2019-12-27 22:16:36 -0800
commit7fde7cbf531e5bd57db7a5910a321e7f8249b6fd (patch)
treefc24b3626f9a1ac47ec604f95b002103e663f6ce /modules/devices
parent0cfc5366775331bcb7dad226551276ab31826d03 (diff)
storage: use vendor flag for vendor fields
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices')
-rw-r--r--modules/devices/storage.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/devices/storage.c b/modules/devices/storage.c
index 8b76f6fc..72d924ce 100644
--- a/modules/devices/storage.c
+++ b/modules/devices/storage.c
@@ -151,7 +151,9 @@ gboolean __scan_udisks2_devices(void) {
}
else{
label = g_strdup(disk->model);
- vendor_str = disk->model;
+ /* try and pull one out of the model */
+ const Vendor *v = vendor_match(disk->model, NULL);
+ vendor_str = v ? v->name : _("(Unknown)");
}
icon = NULL;
@@ -218,9 +220,9 @@ gboolean __scan_udisks2_devices(void) {
"Model=%s\n"),
label);
- moreinfo = h_strdup_cprintf(_("Vendor=%s\n"),
+ moreinfo = h_strdup_cprintf("$^$%s=%s\n",
moreinfo,
- idle_free(vendor_get_link(vendor_str)));
+ _("Vendor"), vendor_str);
size = size_human_readable((gfloat) disk->size);
moreinfo = h_strdup_cprintf(_("Revision=%s\n"
@@ -446,9 +448,9 @@ void __scan_scsi_devices(void)
gchar *strhash = g_strdup_printf(_("[Device Information]\n"
"Model=%s\n"), model);
- strhash = h_strdup_cprintf(_("Vendor=%s\n"),
+ strhash = h_strdup_cprintf("$^$%s=%s\n",
strhash,
- idle_free(vendor_get_link(model)));
+ _("Vendor"), model);
strhash = h_strdup_cprintf(_("Type=%s\n"
"Revision=%s\n"
@@ -645,7 +647,8 @@ void __scan_ide_devices(void)
gchar *strhash = g_strdup_printf(_("[Device Information]\n" "Model=%s\n"),
model);
- strhash = h_strdup_cprintf(_("Vendor=%s\n"), strhash, idle_free(vendor_get_link(model)));
+ strhash = h_strdup_cprintf("$^$%s=%s\n",
+ strhash, _("Vendor"), model);
strhash = h_strdup_cprintf(_("Device Name=hd%c\n"
"Media=%s\n" "Cache=%dkb\n"), strhash, iface, media, cache);