[Xfce4-commits] <xfce4-cpufreq-plugin:master> Fix showing frequency of wrong CPU core (bug #7179).

Harald Judt noreply at xfce.org
Sun Aug 18 11:32:05 CEST 2013


Updating branch refs/heads/master
         to 4e56722b749e6b5c54bd7d8d7814e6339d7f3485 (commit)
       from d687db9cd1fbbe47a1f4d756aa9ac429c83e97ba (commit)

commit 4e56722b749e6b5c54bd7d8d7814e6339d7f3485
Author: Lionel Le Folgoc <lionel at lefolgoc.net>
Date:   Wed Aug 7 10:58:09 2013 +0200

    Fix showing frequency of wrong CPU core (bug #7179).
    
    This patch makes the plugin refresh only the core selected in the config
    file rather than refreshing all of them and always displaying the last one.

 panel-plugin/xfce4-cpufreq-plugin.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-plugin.c b/panel-plugin/xfce4-cpufreq-plugin.c
index 063fc16..fffd30b 100644
--- a/panel-plugin/xfce4-cpufreq-plugin.c
+++ b/panel-plugin/xfce4-cpufreq-plugin.c
@@ -122,15 +122,16 @@ cpufreq_update_tooltip (CpuInfo *cpu)
 gboolean
 cpufreq_update_plugin (void)
 {
-	gint i;
-	for (i = 0; i < cpuFreq->cpus->len; i++)
-	{
-		CpuInfo *cpu = g_ptr_array_index (cpuFreq->cpus, i);
-		if (cpufreq_update_label (cpu)   == FALSE)
-			return FALSE;
-		if (cpufreq_update_tooltip (cpu) == FALSE)
-			return FALSE;
-	}
+	CpuInfo *cpu;
+
+	g_return_val_if_fail (cpuFreq->options->show_cpu < cpuFreq->cpus->len, FALSE);
+
+	cpu = g_ptr_array_index (cpuFreq->cpus, cpuFreq->options->show_cpu);
+	if (cpufreq_update_label (cpu)   == FALSE)
+		return FALSE;
+	if (cpufreq_update_tooltip (cpu) == FALSE)
+		return FALSE;
+
 	return TRUE;
 }
 


More information about the Xfce4-commits mailing list