netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=7ac98b13252142cc6f6d7ed70d3b9af9d85d7799

commit 7ac98b13252142cc6f6d7ed70d3b9af9d85d7799
Author: Alastair Poole <nets...@gmail.com>
Date:   Wed Apr 15 13:57:50 2020 +0100

    config: use a function.
---
 src/bin/ui.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/bin/ui.c b/src/bin/ui.c
index dfcbd59..164e4a9 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -29,6 +29,15 @@ _config_save(Ui *ui)
    config_save(_configuration);
 }
 
+static void
+_config_load(Ui *ui)
+{
+   _configuration = config_load();
+   ui->sort_type = _configuration->sort_type;
+   ui->sort_reverse = _configuration->sort_reverse;
+   ui->data_unit = _configuration->data_unit == 0 ? DATA_UNIT_MB : 
_configuration->data_unit;
+}
+
 static void
 _system_stats(void *data, Ecore_Thread *thread)
 {
@@ -999,6 +1008,7 @@ _process_list_feedback_cb(void *data, Ecore_Thread *thread 
EINA_UNUSED, void *ms
      }
 
    elm_genlist_realized_items_update(ui->genlist_procs);
+
    if (list)
      eina_list_free(list);
 
@@ -2592,10 +2602,7 @@ _ui_init(Evas_Object *parent)
 
    ui->cpu_times = NULL;
 
-   _configuration = config_load();
-   ui->sort_type = _configuration->sort_type;
-   ui->sort_reverse = _configuration->sort_reverse;
-   ui->data_unit = _configuration->data_unit == 0 ? DATA_UNIT_MB : 
_configuration->data_unit;
+   _config_load(ui);
 
    /* UI content creation */
    _ui_tabs_add(parent, ui);

-- 


Reply via email to