[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 02/03: Fix configuration file default group focussing

noreply at xfce.org noreply at xfce.org
Sun Jun 21 18:33:42 CEST 2015


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

omegaphil pushed a commit to branch omegaphil/configurable-interface-names
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit be35568db1b98b71e0e8a3a5a95aedcd74d635c7
Author: OmegaPhil <OmegaPhil at startmail.com>
Date:   Sun Jun 21 16:59:45 2015 +0100

    Fix configuration file default group focussing
---
 src/applet.cpp             |    4 ++--
 src/monitor-impls.cpp      |    7 ++++---
 src/preferences-window.cpp |   25 ++++++++++++++-----------
 3 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/applet.cpp b/src/applet.cpp
index 255db7e..9c3a7ad 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -177,7 +177,7 @@ Applet::Applet(XfcePanelPlugin *plugin)
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_ro, "[NULL]");
+    xfce_rc_set_group(settings_ro, NULL);
 
     icon_path = xfce_rc_read_entry(settings_ro, "icon-path", icon_path.c_str());
     viewer_type = xfce_rc_read_entry(settings_ro, "viewer_type",
@@ -431,7 +431,7 @@ unsigned int Applet::get_fg_color()
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_w, "[NULL]");
+    xfce_rc_set_group(settings_w, NULL);
 
     // Saving next_color
     xfce_rc_write_int_entry(settings_w, "next_color", next_color);
diff --git a/src/monitor-impls.cpp b/src/monitor-impls.cpp
index 69ecf83..1523b47 100644
--- a/src/monitor-impls.cpp
+++ b/src/monitor-impls.cpp
@@ -67,7 +67,8 @@ load_monitors(XfceRc *settings_ro, XfcePanelPlugin *panel_plugin)
     // They do - looping for all monitors
     for (int i = 0; settings_monitors[i] != NULL; ++i)
     {
-      // Skipping default group
+      /* Skipping default group - this is the name of the NULL group here and
+       * must not be confused with the normal way of addressing it, NULL */
       if (g_strcmp0(settings_monitors[i], "[NULL]") == 0)
         continue;
 
@@ -908,7 +909,7 @@ void NetworkLoadMonitor::configure_interface_names(XfcePanelPlugin *panel_applet
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_ro, "[NULL]");
+    xfce_rc_set_group(settings_ro, NULL);
 
     Glib::ustring setting_name = String::ucompose(
           "network_type_%1_interface_name",
@@ -1258,7 +1259,7 @@ bool NetworkLoadMonitor::interface_exists(const Glib::ustring &interface_name)
 void NetworkLoadMonitor::save_interfaces(XfceRc *settings_w)
 {
   // Ensuring default group is in focus
-  xfce_rc_set_group(settings_w, "[NULL]");
+  xfce_rc_set_group(settings_w, NULL);
 
   // Saving interface names
   Glib::ustring setting_name = String::ucompose("network_type_%1_interface_name",
diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index ba14dc7..3b50175 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -396,9 +396,12 @@ void PreferencesWindow::sync_conf_with_colorbutton(Glib::ustring settings_dir,
     XfceRc* settings_w = xfce_rc_simple_open(file, false);
     g_free(file);
 
-    // Focussing settings group if requested
+    /* Focussing settings group (since NULL is a valid value, this is always
+     * requested) */
     if (!settings_dir.empty())
       xfce_rc_set_group(settings_w, settings_dir.c_str());
+    else
+      xfce_rc_set_group(settings_w, NULL);
     
     // Updating configuration
     xfce_rc_write_int_entry(settings_w, setting_name.c_str(),
@@ -420,7 +423,7 @@ void PreferencesWindow::sync_conf_with_colorbutton(Glib::ustring settings_dir,
 void PreferencesWindow::on_background_colorbutton_set()
 {
   // Settings dir here is the default XFCE4 settings group
-  sync_conf_with_colorbutton("[NULL]", "background_color",
+  sync_conf_with_colorbutton(NULL, "background_color",
            background_colorbutton);
 
   // Actually apply the color change
@@ -445,7 +448,7 @@ void PreferencesWindow::on_background_color_radiobutton_toggled()
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_w, "[NULL]");
+    xfce_rc_set_group(settings_w, NULL);
 
     // Updating configuration
     xfce_rc_write_bool_entry(settings_w, "use_background_color", on);
@@ -478,7 +481,7 @@ void PreferencesWindow::on_curve_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "curve");
@@ -518,7 +521,7 @@ void PreferencesWindow::on_bar_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "bar");
@@ -558,7 +561,7 @@ void PreferencesWindow::on_vbar_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "vbar");
@@ -598,7 +601,7 @@ void PreferencesWindow::on_column_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "column");
@@ -638,7 +641,7 @@ void PreferencesWindow::on_text_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "text");
@@ -677,7 +680,7 @@ void PreferencesWindow::on_flame_radiobutton_toggled()
       g_free(file);
 
       // Ensuring default group is in focus
-      xfce_rc_set_group(settings_w, "[NULL]");
+      xfce_rc_set_group(settings_w, NULL);
 
       // Updating configuration
       xfce_rc_write_entry(settings_w, "viewer_type", "flame");
@@ -721,7 +724,7 @@ void PreferencesWindow::on_size_scale_changed()
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_w, "[NULL]");
+    xfce_rc_set_group(settings_w, NULL);
 
     // Updating configuration
     xfce_rc_write_int_entry(settings_w, "viewer_size",
@@ -946,7 +949,7 @@ void PreferencesWindow::save_font_details(Glib::ustring font_details)
     g_free(file);
 
     // Ensuring default group is in focus
-    xfce_rc_set_group(settings_w, "[NULL]");
+    xfce_rc_set_group(settings_w, NULL);
 
     // Updating configuration
     xfce_rc_write_entry(settings_w, "viewer_font", font_details.c_str());

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


More information about the Xfce4-commits mailing list