netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=83f726b67c48910ea5007f5a309b14fb2308cbfd

commit 83f726b67c48910ea5007f5a309b14fb2308cbfd
Author: Alastair Poole <[email protected]>
Date:   Mon Apr 20 10:58:18 2020 +0100

    cache: group caching functions/data.
---
 .gitignore   |  1 +
 src/bin/ui.c | 19 +++++++++----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1181d07..7b0eb71 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 build/*
 build
+*.swp
diff --git a/src/bin/ui.c b/src/bin/ui.c
index 1f29b59..581db80 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -17,13 +17,6 @@ static Ui *_ui = NULL;
 static Eina_Lock _lock;
 static Evisum_Config *_evisum_config = NULL;
 
-#define ITEM_CACHE_INIT_SIZE 50
-
-typedef struct _Item_Cache {
-   Evas_Object *obj;
-   Eina_Bool   used;
-} Item_Cache;
-
 static void
 _config_save(Ui *ui)
 {
@@ -831,6 +824,13 @@ _proc_pid_cpu_usage_get(Ui *ui, Proc_Info *proc)
    _proc_pid_cpu_time_save(ui, proc);
 }
 
+#define ITEM_CACHE_INIT_SIZE 50
+
+typedef struct _Item_Cache {
+   Evas_Object *obj;
+   Eina_Bool   used;
+} Item_Cache;
+
 static void
 _item_unrealized_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info 
EINA_UNUSED)
 {
@@ -1007,8 +1007,8 @@ _content_get(void *data, Evas_Object *obj, const char 
*source)
    Item_Cache *it = _item_cache_get(ui);
    if (!it)
      {
-        puts("BOOM");
-        exit(1);
+        fprintf(stderr, "Error: Object cache creation failed.\n");
+        exit(-1);
      }
 
    evas_object_geometry_get(ui->btn_pid, NULL, NULL, &w, NULL);
@@ -1028,7 +1028,6 @@ _content_get(void *data, Evas_Object *obj, const char 
*source)
      elm_object_text_set(l, eina_slstr_printf("%d", proc->uid));
    evas_object_geometry_get(l, NULL, NULL, &ow, NULL);
    if (ow > w) evas_object_size_hint_min_set(ui->btn_uid, w, 1);
-
    r = evas_object_data_get(l, "rect");
    evas_object_size_hint_min_set(r, w, 1);
 

-- 


Reply via email to