[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 20/96: Loop properly over groups in settings file

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:25 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 8b1bca3343bf7a743268bbc2e0cea3ca78a71ed1
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Thu Oct 31 22:03:37 2013 +0000

    Loop properly over groups in settings file
---
 src/monitor-impls.cpp |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 99a70e3..e7e2a31 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -63,11 +63,14 @@ load_monitors(XfceRc* settings)
     gchar** settings_monitors = xfce_rc_get_groups(settings);
 
     // They do - looping for all monitors
-    for (gchar* settings_monitor = *settings_monitors; *settings_monitor;
-      ++settings_monitors)
+    for (int i = 0; settings_monitors[i] != NULL; ++i)
     {
+      // Skipping default group
+      if (g_strcmp0(settings_monitors[i], "[NULL]") == 0)
+        continue;
+      
       // Setting the correct group prior to loading settings
-      xfce_rc_set_group(settings, settings_monitor);
+      xfce_rc_set_group(settings, settings_monitors[i]);
       
       // Obtaining monitor type
       Glib::ustring type = xfce_rc_read_entry(settings, "type", "");
@@ -148,7 +151,7 @@ load_monitors(XfceRc* settings)
       }
 
       // Saving the monitor's settings root
-      monitors.back()->set_settings_dir(settings_monitor);
+      monitors.back()->set_settings_dir(settings_monitors[i]);
     }
 
     // Clearing up

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


More information about the Xfce4-commits mailing list