[Xfce4-commits] [panel-plugins/xfce4-sensors-plugin] 02/02: gtktypes used, more null-pointer checks in stand-alone app

noreply at xfce.org noreply at xfce.org
Thu Mar 9 00:00:05 CET 2017


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

timystery pushed a commit to branch master
in repository panel-plugins/xfce4-sensors-plugin.

commit 7505a1fd702e95bd2e127254d38e6aae24cffc63
Author: Fabian <timystery at arcor.de>
Date:   Wed Mar 8 23:59:32 2017 +0100

    gtktypes used, more null-pointer checks in stand-alone app
---
 src/actions.c   | 10 ++++++----
 src/callbacks.c | 14 ++++++++------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/actions.c b/src/actions.c
index 1d49225..f7c5fc1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -110,15 +110,15 @@ refresh_sensor_data (t_sensors_dialog *ptr_sensors_dialog_structure)
 void
 refresh_tacho_view (t_sensors_dialog *ptr_sensors_dialog_structure)
 {
-    int idx_chip, idx_feature, row_tacho_table=0, col_tacho_table=0;
+    gint idx_chip, idx_feature, row_tacho_table=0, col_tacho_table=0;
     t_sensors *ptr_sensors_structure;
     t_chipfeature *ptr_chipfeature_structure;
     t_chip *ptr_chip_structure;
     GtkWidget *ptr_wdgt_table;
     GtkAllocation allocation;
     gdouble val_fill_degree;
-    char str_widget_tooltip_text[128];
-    int num_max_cols, num_max_rows;
+    gchar str_widget_tooltip_text[128];
+    gint num_max_cols, num_max_rows;
 
     TRACE ("enters refresh_tacho_view");
 
@@ -215,9 +215,11 @@ refresh_tacho_view (t_sensors_dialog *ptr_sensors_dialog_structure)
                 ptr_sensors_structure->tachos[idx_chip][idx_feature] = NULL;
             }
 
-            /* TODO: Rearrange all widgets in order to distribute evenly */
         }
     }
+
+    /* TODO: Rearrange all widgets in order to distribute evenly */
+
     TRACE ("leaves refresh_tacho_view");
 }
 
diff --git a/src/callbacks.c b/src/callbacks.c
index b321560..829fe20 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -135,7 +135,9 @@ list_cell_text_edited_ (GtkCellRendererText *cellrenderertext,
                                   needed for the update in ACPI and hddtemp. */
         chipfeature = (t_chipfeature *) g_ptr_array_index (chip->chip_features,
                                                             atoi(path_str));
-        g_free(chipfeature->name);
+        /* TODO: user gtk_sensorstacho_set_text */
+        if (chipfeature->name != NULL)
+            g_free(chipfeature->name);
         chipfeature->name = g_strdup (new_text);
     /* } */
 
@@ -265,23 +267,23 @@ list_cell_color_edited_ (GtkCellRendererText *cellrenderertext, gchar *path_str,
         chip = (t_chip *) g_ptr_array_index(sd->sensors->chips, gtk_combo_box_active);
 
         chipfeature = (t_chipfeature *) g_ptr_array_index(chip->chip_features, atoi(path_str));
-        g_free (chipfeature->color);
+        if (chipfeature->color!=NULL)
+            g_free (chipfeature->color);
+
         chipfeature->color = g_strdup(new_color);
 
         /* clean up */
         gtk_tree_path_free (path);
 
-        /* update panel */
-        //sensors_show_panel ((gpointer) sd->sensors);
-        //res = refresh_view ((gpointer) sd);
+        /* update color value */
         if (sd->sensors->tachos [gtk_combo_box_active][atoi(path_str)]!=NULL)
             gtk_sensorstacho_set_color(GTK_SENSORSTACHO(sd->sensors->tachos[gtk_combo_box_active][atoi(path_str)]), new_color);
-
     }
 
     TRACE ("leaves list_cell_color_edited");
 }
 
+
 void
 minimum_changed_ (GtkCellRendererText *cellrenderertext, gchar *path_str,
                  gchar *new_value, t_sensors_dialog *sd)

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


More information about the Xfce4-commits mailing list