summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2018-06-21 17:27:06 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2018-09-08 02:28:02 -0700
commitef6fa8fb1d29a67095d4800e54113cbb53411c29 (patch)
tree3b4fce7ed19fd712f1e785ce9a70a41429c97751
parent8c5ac6c21d013220816c9a7285a981a8810f13e1 (diff)
pci, gpu: fix for duplicate sections when not using English
Signed-off-by: Burt P <pburt0@gmail.com>
-rw-r--r--modules/devices.c8
-rw-r--r--modules/devices/gpu.c7
-rw-r--r--modules/devices/pci.c9
3 files changed, 15 insertions, 9 deletions
diff --git a/modules/devices.c b/modules/devices.c
index c30563f6..1bcf2f1f 100644
--- a/modules/devices.c
+++ b/modules/devices.c
@@ -585,16 +585,12 @@ gchar *callback_battery()
gchar *callback_pci()
{
- return g_strdup_printf("[PCI Devices]\n"
- "%s"
- "[$ShellParam$]\n" "ViewType=1\n", pci_list);
+ return g_strdup(pci_list);
}
gchar *callback_gpu()
{
- return g_strdup_printf("[GPUs]\n"
- "%s"
- "[$ShellParam$]\n" "ViewType=1\n", gpu_list);
+ return g_strdup(gpu_list);
}
gchar *callback_sensors()
diff --git a/modules/devices/gpu.c b/modules/devices/gpu.c
index b999e1fc..05fbac7e 100644
--- a/modules/devices/gpu.c
+++ b/modules/devices/gpu.c
@@ -217,4 +217,11 @@ void scan_gpu_do(void) {
}
}
gpud_list_free(gpus);
+
+ if (c)
+ gpu_list = g_strconcat(gpu_list, "[$ShellParam$]\n", "ViewType=1\n", NULL);
+ else {
+ /* NO GPU? */
+ gpu_list = g_strconcat(gpu_list, _("No GPU devices found"), "=\n", NULL);
+ }
}
diff --git a/modules/devices/pci.c b/modules/devices/pci.c
index 332ea448..e068ef05 100644
--- a/modules/devices/pci.c
+++ b/modules/devices/pci.c
@@ -154,9 +154,12 @@ void scan_pci_do(void) {
}
pcid_list_free(list);
- return;
}
- /* NO PCI? */
- pci_list = g_strconcat(pci_list, _("No PCI devices found"), "=\n", NULL);
+ if (c)
+ pci_list = g_strconcat(pci_list, "[$ShellParam$]\n", "ViewType=1\n", NULL);
+ else {
+ /* NO PCI? */
+ pci_list = g_strconcat(pci_list, _("No PCI devices found"), "=\n", NULL);
+ }
}