[Xfce4-commits] <xfce4-cpugraph-plugin:master> Remove cruft
Florian
noreply at xfce.org
Sat Apr 17 16:16:03 CEST 2010
Updating branch refs/heads/master
to 1acc75ecdfa9e00139943d2f629fcef665fd035f (commit)
from b45e11e6009ac7f556e7c09f860b39fbb48ffa1e (commit)
commit 1acc75ecdfa9e00139943d2f629fcef665fd035f
Author: Florian Rivoal <frivoal at gmail.com>
Date: Sun Feb 7 22:22:07 2010 +0900
Remove cruft
Removed some commented out code and some debug printfs that didn't
really belong in production code.
panel-plugin/cpu.c | 6 ------
panel-plugin/cpu.h | 1 -
panel-plugin/mode.c | 5 +----
panel-plugin/os.c | 2 --
4 files changed, 1 insertions(+), 13 deletions(-)
diff --git a/panel-plugin/cpu.c b/panel-plugin/cpu.c
index ecf3fc1..4f0012f 100644
--- a/panel-plugin/cpu.c
+++ b/panel-plugin/cpu.c
@@ -246,7 +246,6 @@ CreateControl (XfcePanelPlugin * plugin)
/* Multicore stuff */
- //fprintf(stderr,"Multicore stuff\n");
if((base->nrCores = cpuData_init() - 1) < 0)
fprintf(stderr,"Cannot init cpu data !\n");
@@ -285,7 +284,6 @@ CreateControl (XfcePanelPlugin * plugin)
base->m_DrawArea = gtk_drawing_area_new ();
gtk_widget_set_app_paintable (base->m_DrawArea, TRUE);
- //gtk_container_add (GTK_CONTAINER (ebox), frame);
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (base->m_DrawArea));
gtk_widget_show (base->m_DrawArea);
@@ -363,7 +361,6 @@ void
UpdateTooltip (CPUGraph * base)
{
char tooltip[32];
- fprintf(stderr, "update tooltip\n");
int pos = snprintf (tooltip, 32, "Usage: %d%%", base->m_CpuData[0].load*100/CPU_SCALE);
if( base->m_CpuData[0].scalCurFreq )
snprintf (tooltip+pos, 32-pos, " (%d MHz)", base->m_CpuData[0].scalCurFreq/1000);
@@ -793,11 +790,9 @@ CreateOptions (XfcePanelPlugin *plugin, CPUGraph *base)
gboolean
UpdateCPU (CPUGraph * base)
{
- //fprintf(stderr,"update cpu\n");
gint i;
base->m_CpuData = cpuData_read();
for(i=0; i<base->nrCores; i++){
- //fprintf(stderr,"bar load = %f\n",(gdouble)base->m_CpuData[i+1].load);
gtk_progress_bar_set_fraction(
GTK_PROGRESS_BAR(base->m_pBar[i]),
(gdouble)base->m_CpuData[i+1].load/CPU_SCALE);
@@ -825,7 +820,6 @@ UpdateCPU (CPUGraph * base)
, base->m_History
, (base->m_Values*2-1)*sizeof(int));
}
- fprintf(stderr,"cpu data load %f\n",base->m_CpuData[0].load);
base->m_History[0] = (long)base->m_CpuData[0].load;
base->m_History[base->m_Values] = base->m_CpuData[0].scalCurFreq;
diff --git a/panel-plugin/cpu.h b/panel-plugin/cpu.h
index f6b4074..b8866c1 100644
--- a/panel-plugin/cpu.h
+++ b/panel-plugin/cpu.h
@@ -90,7 +90,6 @@ typedef struct
GtkTooltips *m_Tooltip; // Eventual tooltip.
guint m_TimeoutID; // Timeout ID for the tooltip;
- //long m_CPUUsage;
long *m_History;
int m_Values;
int m_Orientation;
diff --git a/panel-plugin/mode.c b/panel-plugin/mode.c
index 3ead859..3a594c6 100644
--- a/panel-plugin/mode.c
+++ b/panel-plugin/mode.c
@@ -102,15 +102,12 @@ void drawGraphModeLED (CPUGraph *base, GdkGC *fg1, GdkGC *fg2, GtkWidget *da, in
gdk_gc_set_rgb_fg_color (fg1, &base->m_ForeGround1);
gdk_gc_set_rgb_fg_color (fg2, &base->m_ForeGround2);
-
- //fprintf(stderr,"nry %i %d\n", nry, CPU_SCALE);
-
for (x = nrx ; x >= 0; x--)
{
int tmp = 0;
int idx = nrx-x;
int limit = (int)(nry - nry * base->m_History[idx]/CPU_SCALE);
- //fprintf(stderr,"lim=%d %d %d %d\n",limit, idx, nry, base->m_History[idx]);
+
for (y = nry; y >= 0; y--)
{
if (base->m_ColorMode > 0)
diff --git a/panel-plugin/os.c b/panel-plugin/os.c
index 6d7b26d..5a82859 100644
--- a/panel-plugin/os.c
+++ b/panel-plugin/os.c
@@ -24,7 +24,6 @@ void cpuData_free(){
#if defined (__linux__)
int cpuData_init(){
- //fprintf(stderr,"cpuData_init\n");
FILE *fstat = NULL;
char cpuStr[PROCMAXLNLEN];
int i, cpuNr = -1;
@@ -56,7 +55,6 @@ int cpuData_init(){
}
CpuData *cpuData_read(){
- //fprintf(stderr,"cpuData_read\n");
FILE *fStat = NULL;
char cpuStr[PROCMAXLNLEN];
unsigned long user, nice, system, idle, used, total;
More information about the Xfce4-commits
mailing list