This patch disables the display of the 'Swap' label if your machine does not have any swap.

--

Richard Kolkovich
[EMAIL PROTECTED]


Index: e_mod_main.c
===================================================================
RCS file: /var/cvs/e/e_modules/mem/e_mod_main.c,v
retrieving revision 1.43
diff -r1.43 e_mod_main.c
440,441c440,443
<       snprintf (swap_str, sizeof (swap_str), "Swap: %d/%d MB", (swap / 1024),
<               (total_swap / 1024));
---
>       if ( total_swap ) { 
>           snprintf (swap_str, sizeof (swap_str), "Swap: %d/%d MB", (swap / 
> 1024),
>             (total_swap / 1024));
>       }
449,450c451,454
<       tr = (((double) swap / (double) total_swap) * 100);
<       snprintf (swap_str, sizeof (swap_str), "Swap: %1.2f%%", tr);
---
>       if ( total_swap ) { 
>           tr = (((double) swap / (double) total_swap) * 100);
>           snprintf (swap_str, sizeof (swap_str), "Swap: %1.2f%%", tr);
>       }
453c457,461
<   edje_object_part_text_set (inst->mem_obj, "swap_label", swap_str);
---
>   if ( total_swap ) { 
>       edje_object_part_text_set (inst->mem_obj, "swap_label", swap_str);
>   } else {
>       edje_object_part_text_set (inst->mem_obj, "swap_label", "");
>   }
459,461c467,471
<   double ts = ((double) swap / (double) total_swap);
<   msg.val = ts;
<   edje_object_message_send (inst->mem_obj, EDJE_MESSAGE_FLOAT, 2, &msg);
---
>   if ( total_swap ) { 
>       double ts = ((double) swap / (double) total_swap);
>       msg.val = ts;
>       edje_object_message_send (inst->mem_obj, EDJE_MESSAGE_FLOAT, 2, &msg);
>   }
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to