[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 13/96: Properly deal with no configuration in Applet::find_empty_monitor_dir

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:18 CET 2014


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

nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit 1627b1303853cdbbd63a1a5513990f65312ec2e6
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Sun Oct 27 13:06:23 2013 +0000

    Properly deal with no configuration in Applet::find_empty_monitor_dir
---
 src/applet.cpp |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index 0309011..523753b 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -645,6 +645,7 @@ void Applet::remove_sync_for(Monitor *monitor)
 Glib::ustring Applet::find_empty_monitor_dir()
 {
   Glib::ustring mon_dir;
+  int c = 1;
 
   // Search for read-only settings file
   gchar* file = xfce_panel_plugin_lookup_rc_file(panel_applet);
@@ -655,7 +656,6 @@ Glib::ustring Applet::find_empty_monitor_dir()
     XfceRc* settings = xfce_rc_simple_open(file, true);
     g_free(file);
 
-    int c = 1;
     do {
       mon_dir = String::ucompose("%1", c++);
     } while (xfce_rc_has_group(settings, mon_dir.c_str()));
@@ -665,9 +665,9 @@ Glib::ustring Applet::find_empty_monitor_dir()
   }
   else
   {
-    // Unable to obtain read-only config file - informing user
-    std::cerr << _("Unable to obtain read-only config file path in "
-      "find_empty_monitor_dir call!\n");
+    /* No configuration file exists yet - setting mon_dir to 1 and
+     * informing user */
+    mon_dir = String::ucompose("%1", c);
   }  
 
   // Returning next free monitor directory (number)

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


More information about the Xfce4-commits mailing list