[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 03/03: Update most debug code to use std:endl for actual working flushing

noreply at xfce.org noreply at xfce.org
Sat Dec 23 14:40:21 CET 2017


This is an automated email from the git hooks/post-receive script.

o   m   e   g   a   p   h   i   l       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit d52fbcd5f53baaf894f007bac7e2f56e4db0e840
Author: OmegaPhil <OmegaPhil at startmail.com>
Date:   Sat Dec 23 13:40:14 2017 +0000

    Update most debug code to use std:endl for actual working flushing
---
 src/canvas-view.cpp           | 12 ++++++++----
 src/choose-monitor-window.cpp |  4 ++--
 src/curve-view.cpp            |  8 ++++----
 src/monitor-impls.cpp         | 23 ++++++++++++-----------
 src/plugin.cpp                | 13 +++++++------
 5 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/src/canvas-view.cpp b/src/canvas-view.cpp
index 46e5e64..f4c4cd9 100644
--- a/src/canvas-view.cpp
+++ b/src/canvas-view.cpp
@@ -69,7 +69,7 @@ void CanvasView::do_display()
 void CanvasView::do_update()
 {
   // Debug code
-  //std::cout << "In CanvasView::do_update!\n";
+  //std::cout << "In CanvasView::do_update!" << std::endl;
 
   // Size is maintained in plugin
   size = plugin->get_viewer_size();
@@ -113,7 +113,9 @@ int CanvasView::width() const
    * orientation) */
 
   // Debug code
-  //std::cout << "CanvasView::width: " << ((plugin->horizontal()) ? size : plugin->get_size()) << "\n";
+  /*std::cout << "CanvasView::width: "
+              << ((plugin->horizontal()) ? size : plugin->get_size())
+              << std::endl;*/
 
   if (plugin->horizontal())
     return size;
@@ -124,7 +126,9 @@ int CanvasView::width() const
 int CanvasView::height() const
 {
   // Debug code
-  //std::cout << "CanvasView::height: " << ((plugin->horizontal()) ? plugin->get_size() : size) << "\n";
+  /*std::cout << "CanvasView::height: "
+              << ((plugin->horizontal()) ? plugin->get_size() : size)
+              << std::endl;*/
 
   if (plugin->horizontal())
     return plugin->get_size();
@@ -145,7 +149,7 @@ void CanvasView::resize_canvas()
   }
 
   // Debug code
-  //std::cout << "In CanvasView::resize_canvas!\n" << w << "|" << h << "\n";
+  //std::cout << "In CanvasView::resize_canvas!\n" << w << "|" << h << std::endl;
 }
 
 bool CanvasView::draw_loop()
diff --git a/src/choose-monitor-window.cpp b/src/choose-monitor-window.cpp
index 4d3aa90..91dc52c 100644
--- a/src/choose-monitor-window.cpp
+++ b/src/choose-monitor-window.cpp
@@ -834,7 +834,7 @@ Monitor *ChooseMonitorWindow::run(const Glib::ustring &mon_dir)
 
         // Debug code
         /*std::cerr << "XFCE4 Hardware Monitor Plugin: ChooseMonitorWindow::run, "
-                     "network load monitor max value: " << max << "\n";*/
+                     "network load monitor max value: " << max << std::endl;*/
       }
       else if (type == "temperature")
       {
@@ -1396,7 +1396,7 @@ void ChooseMonitorWindow::on_network_interface_name_edited(
 {
   // Debug code
   /*std::cout << "Network interface name edit detected: path: " << path <<
-               ", new_text: " << new_text << "\n";*/
+               ", new_text: " << new_text << std::endl;*/
 
   // Obtaining interface type from path
   int inter_type_num = 0;
diff --git a/src/curve-view.cpp b/src/curve-view.cpp
index e75d927..b449aa5 100644
--- a/src/curve-view.cpp
+++ b/src/curve-view.cpp
@@ -50,14 +50,14 @@ void Curve::draw(Gnome::Canvas::Canvas &canvas, int width, int height,
 {
   // Debug code
   /*std::cout << "Curve::draw: Called, remaining_draws: " << remaining_draws
-            << " (" << monitor->get_short_name() << ")\n";*/
+            << " (" << monitor->get_short_name() << ")" << std::endl;*/
 
   if (remaining_draws <= 0)
     return;
 
   // Debug code
   /*std::cout << "Curve::draw: remaining_draws passed (monitor "
-            << monitor->get_short_name() << ")\n";*/
+            << monitor->get_short_name() << ")" << std::endl;*/
 
   --remaining_draws;
   
@@ -111,7 +111,7 @@ void Curve::draw(Gnome::Canvas::Canvas &canvas, int width, int height,
     // Debug code
     /*std::cout << "x: " << x << ", y: " << y << ", width of canvas: " << width
               << ", time offset: " << time_offset << " (monitor "
-              << monitor->get_short_name() << "\n";*/
+              << monitor->get_short_name() << std::endl;*/
 
     x -= CurveView::pixels_per_sample;
   } while (++vi != vend);
@@ -119,7 +119,7 @@ void Curve::draw(Gnome::Canvas::Canvas &canvas, int width, int height,
   line->property_points() = points;
 
   // Debug code
-  //std::cout << "In CurveView::draw!\n" << color << "\n";
+  //std::cout << "In CurveView::draw!\n" << color << std::endl;
 }
 
 double Curve::get_max_value()
diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 820e091..dd058dc 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -1200,7 +1200,7 @@ double DiskStatsMonitor::do_measure()
   }
 
   // Debug code
-  //std::cerr << "Returning value: " << val << "\n";
+  //std::cerr << "Returning value: " << val << std::endl;
 
   return val;
 }
@@ -1305,10 +1305,11 @@ DiskStatsMonitor::parse_disk_stats()
 
     /* Debug code
     std::cout << "Parsing device '" << device_name << "' stats...\nMatch count:"
-              << match_info.get_match_count() << "\n";
-    std::cout << "1: '" << match_info.fetch(1) << "', 2: '" << match_info.fetch(2) << "'\n";
-    std::cout << "single_device_stats: '" << single_device_stats << "'\n";
-    */
+              << match_info.get_match_count() << std::endl;
+    std::cout << "1: '" << match_info.fetch(1) << "', 2: '"
+              << match_info.fetch(2) << "'" << std::endl;
+    std::cout << "single_device_stats: '" << single_device_stats << "'"
+              << std::endl;*/
 
     for (int i = 4; i<match_info.get_match_count(); ++i)
     {
@@ -1329,7 +1330,7 @@ DiskStatsMonitor::parse_disk_stats()
       device_parsed_stats.push_back(stat);
 
       // Debug code
-      //std::cout << "Stat number " << i << " value: " << stat << "\n";
+      //std::cout << "Stat number " << i << " value: " << stat << std::endl;
     }
     parsed_stats[device_name] = device_parsed_stats;
   }
@@ -1795,7 +1796,7 @@ double NetworkLoadMonitor::do_measure()
 
   // Debug code
   /*std::cout << "NetworkLoadMonitor::do_measure: val: " << val <<
-    ", max_value: " << max_value << "\n";*/
+    ", max_value: " << max_value << std::endl;*/
 
   return val;
 }
@@ -1823,9 +1824,9 @@ Glib::ustring NetworkLoadMonitor::get_interface_name(InterfaceType type,
   configure_interface_names(xfce_plugin);
 
   // Debug code
- /* std::cout << "get_interface_name called for " << interface_type_to_string(type,
-                                                                            false)
-            << ", returning " << interface_type_names[type] << "\n";*/
+  /* std::cout << "get_interface_name called for "
+               << interface_type_to_string(type, false)
+               << ", returning " << interface_type_names[type] << std::endl;*/
 
   // Returning requested interface name
   return interface_type_names[type];
@@ -1888,7 +1889,7 @@ bool NetworkLoadMonitor::interface_exists(const Glib::ustring &interface_name)
   {
     // Debug code
     /*std::cout << "Device to search for: " << interface_name << ", device "
-                 "compared with: " << devices[i] << "\n";*/
+                 "compared with: " << devices[i] <<  << std::endl;*/
 
     if (interface_name == devices[i])
     {
diff --git a/src/plugin.cpp b/src/plugin.cpp
index 982d66a..0c454cd 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -142,7 +142,7 @@ void save_monitors(Plugin *plugin)
 gboolean size_changed(XfcePanelPlugin* xfce_plugin, gint size, Plugin* plugin)
 {
   // Debug code
-  std::cout << "Size changed event detected: " << size << "\n";
+  std::cout << "Size changed event detected: " << size << std::endl;
 
   return true;
 }
@@ -298,7 +298,8 @@ Plugin::Plugin(XfcePanelPlugin *xfce_plugin)
 Plugin::~Plugin()
 {
   // Debug code
-  //std::cerr << "XFCE4 Hardware Monitor Plugin: Plugin destructor running...\n";
+  /*std::cerr << "XFCE4 Hardware Monitor Plugin: Plugin destructor running..."
+              << std::endl;*/
 
   timer.disconnect();
   
@@ -335,7 +336,7 @@ void Plugin::viewer_type_listener(const Glib::ustring viewer_type,
                                   bool force_update)
 {
   // Debug code
-  //std::cout << "Plugin::viewer_type_listener called!\n";
+  //std::cout << "Plugin::viewer_type_listener called!" << std::endl;
 
   /* Setting viewer type, force_update allows resetting the view even when the
    * type is already correct */
@@ -526,7 +527,7 @@ void Plugin::set_viewer_size(const int size)
   /*
   // Debug code
   std::cout << "Size information: " << req_size.width << "x"
-    << req_size.height << "\n";
+            << req_size.height << std::endl;
   */
 
   // Make sure on every call that the viewer size is being honoured
@@ -548,7 +549,7 @@ void Plugin::set_viewer_size(const int size)
   viewer_size = size;
 
   // Debug code
-  //std::cout << "Viewer size set to " << viewer_size << "\n";
+  //std::cout << "Viewer size set to " << viewer_size << std::endl;
 }
 
 const Glib::ustring Plugin::get_viewer_font()
@@ -888,7 +889,7 @@ void Plugin::debug_log(const Glib::ustring &msg)
 
       // Debug code
       std::cerr << "XFCE4 Hardware Monitor Plugin: Debug log file created at "
-                << file->get_path() << "\n";
+                << file->get_path() << std::endl;
   }
 
   debug_log_stream->write(String::ucompose("%1\n", msg));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list