Package: hardware-monitor
Version: 1.4-1
Severity: normal
Tags: patch

The program consider that 1MB = 1000*1000 bytes, but 1MB = 1024*1024
bytes. The same mistake is take for GB. This leaves to an discrepancy in varios 
measures compared to other programs. I fixed this in the swap, memory, disk 
usage and network load monitors. ( Sorry for my poor english )

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24.2 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages hardware-monitor depends on:
ii  libart-2.0-2               2.3.20-2      Library of functions for 2D graphi
ii  libatk1.0-0                1.22.0-1      The ATK accessibility toolkit
ii  libbonobo2-0               2.22.0-1      Bonobo CORBA interfaces library
ii  libbonoboui2-0             2.22.0-1      The Bonobo UI library
ii  libc6                      2.7-10        GNU C Library: Shared libraries
ii  libcairo2                  1.6.4-1+b1    The Cairo 2D vector graphics libra
ii  libcairomm-1.0-1           1.6.0-1       C++ wrappers for Cairo (shared lib
ii  libfontconfig1             2.5.0-2       generic font configuration library
ii  libgcc1                    1:4.3.0-5     GCC support library
ii  libgconf2-4                2.22.0-1      GNOME configuration database syste
ii  libgconfmm-2.6-1c2         2.22.0-1      C++ wrappers for GConf (shared lib
ii  libglade2-0                1:2.6.2-1     library to load .glade files at ru
ii  libglademm-2.4-1c2a        2.6.6-1       C++ wrappers for libglade2 (shared
ii  libglib2.0-0               2.16.3-2      The GLib library of C routines
ii  libglibmm-2.4-1c2a         2.16.2-1      C++ wrapper for the GLib toolkit (
ii  libgnome-keyring0          2.22.1-1      GNOME keyring services library
ii  libgnome2-0                2.20.1.1-1    The GNOME 2 library - runtime file
ii  libgnomecanvas2-0          2.20.1.1-1    A powerful object-oriented display
ii  libgnomecanvasmm-2.6-1c2a  2.22.0-1      C++ wrappers for libgnomecanvas2 (
ii  libgnomeui-0               2.20.1.1-1    The GNOME 2 libraries (User Interf
ii  libgnomevfs2-0             1:2.22.0-3    GNOME Virtual File System (runtime
ii  libgtk2.0-0                2.12.9-3      The GTK+ graphical user interface 
ii  libgtkmm-2.4-1c2a          1:2.12.7-1    C++ wrappers for GTK+ 2.4 (shared 
ii  libgtop2-7                 2.22.2-1      gtop system monitoring library
ii  libice6                    2:1.0.4-1     X11 Inter-Client Exchange library
ii  liborbit2                  1:2.14.12-0.1 libraries for ORBit2 - a CORBA ORB
ii  libpanel-applet2-0         2.20.3-3      library for GNOME Panel applets
ii  libpango1.0-0              1.20.2-2      Layout and rendering of internatio
ii  libpopt0                   1.10-3        lib for parsing cmdline parameters
ii  libsensors3                1:2.10.6-2    library to read temperature/voltag
ii  libsigc++-2.0-0c2a         2.0.18-2      type-safe Signal Framework for C++
ii  libsm6                     2:1.0.3-1+b1  X11 Session Management library
ii  libstdc++6                 4.3.0-5       The GNU Standard C++ Library v3
ii  libx11-6                   2:1.0.3-7     X11 client-side library
ii  libxcursor1                1:1.1.9-1     X cursor management library
ii  libxext6                   2:1.0.4-1     X11 miscellaneous extension librar
ii  libxfixes3                 1:4.0.3-2     X11 miscellaneous 'fixes' extensio
ii  libxi6                     2:1.1.3-1     X11 Input extension library
ii  libxinerama1               2:1.0.3-2     X11 Xinerama extension library
ii  libxml2                    2.6.32.dfsg-2 GNOME XML library
ii  libxrandr2                 2:1.2.2-2     X11 RandR extension library
ii  libxrender1                1:0.9.4-1     X Rendering Extension client libra

hardware-monitor recommends no packages.

-- no debconf information
diff -cr hardware-monitor-1.4.orig/src/monitor-impls.cpp hardware-monitor-1.4.my/src/monitor-impls.cpp
*** hardware-monitor-1.4.orig/src/monitor-impls.cpp	2007-01-13 13:15:19.000000000 -0200
--- hardware-monitor-1.4.my/src/monitor-impls.cpp	2008-06-15 15:14:20.000000000 -0300
***************
*** 357,363 ****
  
  Glib::ustring SwapUsageMonitor::format_value(double val)
  {
!   val /= 1000000;
    
    return String::ucompose(_("%1 Mb"), decimal_digits(val, 3), val);
  }
--- 357,363 ----
  
  Glib::ustring SwapUsageMonitor::format_value(double val)
  {
!   val /= 1024*1024;
    
    return String::ucompose(_("%1 Mb"), decimal_digits(val, 3), val);
  }
***************
*** 491,497 ****
  	
  Glib::ustring MemoryUsageMonitor::format_value(double val)
  {
!   val /= 1000000;
    
    return String::ucompose(_("%1 Mb"), decimal_digits(val, 3), val);
  }
--- 491,497 ----
  	
  Glib::ustring MemoryUsageMonitor::format_value(double val)
  {
!   val /= 1024*1024;
    
    return String::ucompose(_("%1 Mb"), decimal_digits(val, 3), val);
  }
***************
*** 557,572 ****
  
  Glib::ustring DiskUsageMonitor::format_value(double val)
  {
!   if (val >= 1000 * 1000 * 1000) {
!     val /= 1000 * 1000 * 1000;
      return String::ucompose(_("%1 GB"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1000 * 1000) {
!     val /= 1000 * 1000;
      return String::ucompose(_("%1 MB"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1000) {
!     val /= 1000;
      return String::ucompose(_("%1 kB"), decimal_digits(val, 3), val);
    }
    else
--- 557,572 ----
  
  Glib::ustring DiskUsageMonitor::format_value(double val)
  {
!   if (val >= 1024 * 1024 * 1024) {
!     val /= 1024 * 1024 * 1024;
      return String::ucompose(_("%1 GB"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1024 * 1024) {
!     val /= 1024 * 1024;
      return String::ucompose(_("%1 MB"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1024) {
!     val /= 1024;
      return String::ucompose(_("%1 kB"), decimal_digits(val, 3), val);
    }
    else
***************
*** 674,689 ****
    if (val <= 0)			// fix weird problem with negative values
      val = 0;
    
!   if (val >= 1000 * 1000 * 1000) {
!     val /= 1000 * 1000 * 1000;
      return String::ucompose(_("%1 GB/s"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1000 * 1000) {
!     val /= 1000 * 1000;
      return String::ucompose(_("%1 MB/s"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1000) {
!     val /= 1000;
      return String::ucompose(_("%1 kB/s"), decimal_digits(val, 3), val);
    }
    else 
--- 674,689 ----
    if (val <= 0)			// fix weird problem with negative values
      val = 0;
    
!   if (val >= 1024 * 1024 * 1024) {
!     val /= 1024 * 1024 * 1024;
      return String::ucompose(_("%1 GB/s"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1024 * 1024) {
!     val /= 1024 * 1024;
      return String::ucompose(_("%1 MB/s"), decimal_digits(val, 3), val);
    }
!   else if (val >= 1024) {
!     val /= 1024;
      return String::ucompose(_("%1 kB/s"), decimal_digits(val, 3), val);
    }
    else 

Reply via email to