[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 25/96: XFCE4 rc file handling: Ensure that the default settings group is in focus for general settings
noreply at xfce.org
noreply at xfce.org
Thu Nov 27 22:20:30 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 5672dcf4b77abd60bef66160e3ae155dbc14cefc
Author: Omega Weapon <OmegaPhil at gmail.com>
Date: Sun Nov 3 11:51:42 2013 +0000
XFCE4 rc file handling: Ensure that the default settings group is in focus for general settings
---
src/applet.cpp | 9 +++++++++
src/preferences-window.cpp | 24 ++++++++++++++++++++++++
src/text-view.cpp | 6 ++++++
3 files changed, 39 insertions(+)
diff --git a/src/applet.cpp b/src/applet.cpp
index 0fa5988..bd61deb 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -159,6 +159,9 @@ Applet::Applet(XfcePanelPlugin *plugin)
settings = xfce_rc_simple_open(file, true);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
icon_path = xfce_rc_read_entry(settings, "icon-path", icon_path.c_str());
viewer_type = xfce_rc_read_entry(settings, "viewer_type",
viewer_type.c_str());
@@ -385,6 +388,9 @@ unsigned int Applet::get_fg_color()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Saving next_color
xfce_rc_write_int_entry(settings, "next_color", next_color);
@@ -472,6 +478,9 @@ void Applet::set_viewer_size(const int size)
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_int_entry(settings, "viewer_size", viewer_size);
diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index d0706a7..bab7777 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -433,6 +433,9 @@ void PreferencesWindow::on_background_color_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_bool_entry(settings, "use_background_color", on);
@@ -500,6 +503,9 @@ void PreferencesWindow::on_bar_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_type", "bar");
@@ -537,6 +543,9 @@ void PreferencesWindow::on_vbar_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_type", "vbar");
@@ -574,6 +583,9 @@ void PreferencesWindow::on_column_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_type", "column");
@@ -611,6 +623,9 @@ void PreferencesWindow::on_text_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_type", "text");
@@ -647,6 +662,9 @@ void PreferencesWindow::on_flame_radiobutton_toggled()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_type", "flame");
@@ -688,6 +706,9 @@ void PreferencesWindow::on_size_scale_changed()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_int_entry(settings, "viewer_size",
size_scale_to_pixels(i));
@@ -910,6 +931,9 @@ void PreferencesWindow::save_font_name(Glib::ustring font_name)
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Updating configuration
xfce_rc_write_entry(settings, "viewer_font", font_name.c_str());
diff --git a/src/text-view.cpp b/src/text-view.cpp
index 6be377f..921c64e 100644
--- a/src/text-view.cpp
+++ b/src/text-view.cpp
@@ -112,6 +112,9 @@ void TextView::do_update()
XfceRc* settings = xfce_rc_simple_open(file, true);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Loading font_name
if (xfce_rc_has_entry(settings, "viewer_font"))
{
@@ -136,6 +139,9 @@ void TextView::do_update()
XfceRc* settings = xfce_rc_simple_open(file, false);
g_free(file);
+ // Ensuring default group is in focus
+ xfce_rc_set_group(settings, "[NULL]");
+
// Saving viewer size
xfce_rc_write_entry(settings, "viewer_font", font.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