netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=973f95b94f630aa9de332ed9b3cb20741f85e456

commit 973f95b94f630aa9de332ed9b3cb20741f85e456
Author: Alastair Poole <nets...@gmail.com>
Date:   Sun Jan 24 14:15:17 2021 +0000

    trim: trim some stuff
---
 src/bin/ui/ui_cpu.c          |  5 +----
 src/bin/ui/ui_disk.c         |  6 +-----
 src/bin/ui/ui_process_list.c |  6 ++----
 src/bin/ui/ui_sensors.c      | 14 ++++++--------
 4 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/src/bin/ui/ui_cpu.c b/src/bin/ui/ui_cpu.c
index a3f395c..64345d9 100644
--- a/src/bin/ui/ui_cpu.c
+++ b/src/bin/ui/ui_cpu.c
@@ -346,14 +346,11 @@ _win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj, void *event_info
 {
    Animate *ad;
    Ui *ui;
-   Evas_Coord x = 0, y = 0;
 
    ad = data;
    ui = ad->ui;
 
-   evas_object_geometry_get(obj, &x, &y, NULL, NULL);
-   ui->cpu.x = x;
-   ui->cpu.y = y;
+   evas_object_geometry_get(obj, &ui->cpu.x, &ui->cpu.y, NULL, NULL);
 }
 
 static void
diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c
index d621d09..0c02ea8 100644
--- a/src/bin/ui/ui_disk.c
+++ b/src/bin/ui/ui_disk.c
@@ -312,14 +312,11 @@ _win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj, void *event_info
 {
    Ui_Data *pd;
    Ui *ui;
-   Evas_Coord x = 0, y = 0;
 
    pd = data;
    ui = pd->ui;
 
-   evas_object_geometry_get(obj, &x, &y, NULL, NULL);
-   ui->disk.x = x;
-   ui->disk.y = y;
+   evas_object_geometry_get(obj, &ui->disk.x, &ui->disk.y, NULL, NULL);
 }
 
 static void
@@ -453,7 +450,6 @@ _btn_icon_state_set(Evas_Object *button, Eina_Bool reverse)
      elm_icon_standard_set(icon, evisum_icon_path_get("go-up"));
 
    elm_object_part_content_set(button, "icon", icon);
-   evas_object_color_set(icon, 255, 255, 255, 255);
    evas_object_show(icon);
 }
 
diff --git a/src/bin/ui/ui_process_list.c b/src/bin/ui/ui_process_list.c
index 30cccf4..9910685 100644
--- a/src/bin/ui/ui_process_list.c
+++ b/src/bin/ui/ui_process_list.c
@@ -397,9 +397,7 @@ _content_get(void *data, Evas_Object *obj, const char 
*source)
         elm_object_text_set(lb, buf);
         evas_object_geometry_get(lb, NULL, NULL, &ow, NULL);
         if (ow > w)
-          {
-             evas_object_size_hint_min_set(pd->btn_pid, w, 1);
-          }
+          evas_object_size_hint_min_set(pd->btn_pid, w, 1);
      }
    rec = evas_object_data_get(lb, "rec");
    evas_object_size_hint_min_set(rec, w, 1);
@@ -454,7 +452,7 @@ _content_get(void *data, Evas_Object *obj, const char 
*source)
         elm_object_text_set(lb, buf);
         evas_object_geometry_get(lb, NULL, NULL, &ow, NULL);
         if (ow > w)
-           evas_object_size_hint_min_set(pd->btn_size, w, 1);
+          evas_object_size_hint_min_set(pd->btn_size, w, 1);
      }
    rec = evas_object_data_get(lb, "rec");
    evas_object_size_hint_min_set(rec, w, 1);
diff --git a/src/bin/ui/ui_sensors.c b/src/bin/ui/ui_sensors.c
index ee7238f..4abe747 100644
--- a/src/bin/ui/ui_sensors.c
+++ b/src/bin/ui/ui_sensors.c
@@ -56,15 +56,16 @@ _sort_cb(const void *p1, const void *p2)
 static void
 _sensors_refresh(Ui_Data *pd)
 {
-   sensor_t **ss;
+   sensor_t **sensors;
    int n;
 
-   ss = system_sensors_thermal_get(&n);
+   sensors = system_sensors_thermal_get(&n);
+   if (!sensors) return;
 
    for (int i = 0; i < n; i++)
-     pd->sensors = eina_list_append(pd->sensors, ss[i]);
+     pd->sensors = eina_list_append(pd->sensors, sensors[i]);
 
-   free(ss);
+   free(sensors);
 
    pd->sensors = eina_list_sort(pd->sensors, n, _sort_cb);
 
@@ -221,14 +222,11 @@ _win_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object 
*obj, void *event_info
 {
    Ui_Data *pd;
    Ui *ui;
-   Evas_Coord x = 0, y = 0;
 
    pd = data;
    ui = pd->ui;
 
-   evas_object_geometry_get(obj, &x, &y, NULL, NULL);
-   ui->sensors.x = x;
-   ui->sensors.y = y;
+   evas_object_geometry_get(obj, &ui->sensors.x, &ui->sensors.y, NULL, NULL);
 }
 
 static void

-- 


Reply via email to