[Xfce4-commits] <xfce4-cpufreq-plugin:master> Always update icon when changing options.

Harald Judt noreply at xfce.org
Tue Aug 20 20:26:04 CEST 2013


Updating branch refs/heads/master
         to 9073a09b3b48b1ed72b4554cc0e348577346b14d (commit)
       from 406dd2e9872a64a883aca80d8727587688926e20 (commit)

commit 9073a09b3b48b1ed72b4554cc0e348577346b14d
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue Aug 20 19:28:53 2013 +0200

    Always update icon when changing options.
    
    It happens rarely, so why not make the code a bit cleaner?

 panel-plugin/xfce4-cpufreq-configure.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/panel-plugin/xfce4-cpufreq-configure.c b/panel-plugin/xfce4-cpufreq-configure.c
index 56939f7..125bec0 100644
--- a/panel-plugin/xfce4-cpufreq-configure.c
+++ b/panel-plugin/xfce4-cpufreq-configure.c
@@ -37,11 +37,8 @@ static void
 check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 {
 	if (button == configure->display_icon)
-	{
 		cpuFreq->options->show_icon = 
 			gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-		cpufreq_update_icon (cpuFreq);
-	}
 
 	else if (button == configure->display_freq)
 		cpuFreq->options->show_label_freq =
@@ -51,11 +48,9 @@ check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 		cpuFreq->options->show_label_governor =
 			gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
 
-	else if (button == configure->keep_compact) {
+	else if (button == configure->keep_compact)
 		cpuFreq->options->keep_compact =
 			gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
-		cpufreq_update_icon (cpuFreq);
-	}
 
 	else if (button == configure->one_line)
 		cpuFreq->options->one_line =
@@ -70,6 +65,7 @@ check_button_changed (GtkWidget *button, CpuFreqPluginConfigure *configure)
 	} else
 		gtk_widget_set_sensitive (configure->display_icon, TRUE);
 
+	cpufreq_update_icon (cpuFreq);
 	cpuFreq->layout_changed = TRUE;
 	cpufreq_update_plugin ();
 }


More information about the Xfce4-commits mailing list