[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 16/18: Ensure DiskStatsMonitor intialises max_value
noreply at xfce.org
noreply at xfce.org
Tue Jun 28 21:33:38 CEST 2016
This is an automated email from the git hooks/post-receive script.
omegaphil pushed a commit to branch omegaphil/graph-disk-io
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit c51712fdabd85a5fd72dd6bec7d96aa47b567fe8
Author: OmegaPhil <OmegaPhil at startmail.com>
Date: Fri Jun 24 20:55:12 2016 +0100
Ensure DiskStatsMonitor intialises max_value
---
src/bar-view.cpp | 4 ++++
src/monitor-impls.cpp | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/bar-view.cpp b/src/bar-view.cpp
index d877b7d..6114222 100644
--- a/src/bar-view.cpp
+++ b/src/bar-view.cpp
@@ -131,6 +131,10 @@ void Bar::draw(Gnome::Canvas::Canvas &canvas,
if (max <= 0)
max = 0.0000001;
+ // Debug code
+ /*std::cerr << Glib::ustring::compose("Old value: %1, new value: %2, max value: "
+ "%3\n", old_value, new_value, max);*/
+
double box_frac = total_no_boxes * value / max;
if (box_frac > total_no_boxes)
box_frac = total_no_boxes;
diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 1df9467..5c4e286 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -770,7 +770,7 @@ DiskStatsMonitor::DiskStatsMonitor(const Glib::ustring &device_name,
const Stat &stat_to_monitor,
const Glib::ustring &tag_string)
: Monitor(tag_string), device_name(device_name),
- stat_to_monitor(stat_to_monitor), previous_value(-1)
+ stat_to_monitor(stat_to_monitor), previous_value(-1), max_value(1)
{
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list