bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5820015f77f122e7ac538efa3414678f7fd6355e

commit 5820015f77f122e7ac538efa3414678f7fd6355e
Author: Marcel Hollerbach <[email protected]>
Date:   Tue Aug 1 22:20:00 2017 +0200

    e_startup: check for efreet errors
    
    for the case efreet does not come up with any event, give a error to the
      user
---
 src/bin/e_startup.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_startup.c b/src/bin/e_startup.c
index 7b8a5ddde..13c212373 100644
--- a/src/bin/e_startup.c
+++ b/src/bin/e_startup.c
@@ -9,17 +9,19 @@
 static void      _e_startup(void);
 static void      _e_startup_next_cb(void *data);
 static Eina_Bool _e_startup_event_cb(void *data, int ev_type, void *ev);
+static Eina_Bool _e_startup_time_exceeded(void *data);
 
 /* local subsystem globals */
 static E_Order *startup_apps = NULL;
 static int start_app_pos = -1;
 static Ecore_Event_Handler *desktop_cache_update_handler = NULL;
-
+static Ecore_Timer *timer;
 static Eina_Bool desktop_cache_update = EINA_FALSE;
 static Eina_Bool started = EINA_FALSE;
 
 /* externally accessible functions */
 
+
 E_API void
 e_startup_mode_set(E_Startup_Mode mode)
 {
@@ -41,6 +43,7 @@ e_startup_mode_set(E_Startup_Mode mode)
      ecore_event_handler_add(EFREET_EVENT_DESKTOP_CACHE_BUILD,
                              _e_startup_event_cb,
                              strdup(buf));
+   timer = ecore_timer_add(5.0, _e_startup_time_exceeded, NULL);
    e_init_undone();
 }
 
@@ -110,6 +113,9 @@ _e_startup_event_cb(void *data, int ev_type EINA_UNUSED, 
void *ev)
    char *buf;
    Efreet_Event_Cache_Update *e;
 
+   ecore_timer_del(timer);
+   timer = NULL;
+
    e = ev;
    if ((e) && (e->error))
      {
@@ -129,3 +135,11 @@ _e_startup_event_cb(void *data, int ev_type EINA_UNUSED, 
void *ev)
    return ECORE_CALLBACK_PASS_ON;
 }
 
+static Eina_Bool
+_e_startup_time_exceeded(void *data EINA_UNUSED)
+{
+   fprintf(stderr, "E: efreet didnt notify about cache update\n");
+   _e_startup_error_dialog("E: Efreet did not update cache. "
+                           "Please check your Efreet setup");
+   return ECORE_CALLBACK_CANCEL;
+}

-- 


Reply via email to