remove edje file changed monitoring as it's nothing but a bug vector

so this has to go. reloading edje files is nothing but trouble.
example - if you update your os your theme files get updated and then
all sorts of stuff goes wrong. jeff is right. this makes it an
intractible problem. we have an open file handle on the edj file. we
share that anre reuse it via eina_file - keep it. this keeps tyhe edje
file stable and consistant.

<Jef91> Elementary applications freak the fuck out
<Jef91> if you change the theme file
<Jef91> that they are using
<Jef91> SeoZ,
http://forums.bodhilinux.com/index.php?/topic/10629-eepdater-display-issue/
<Jef91> that happens when my theme file that is in use changes

we will get nothing but continued issues and complains if we keep
doing this. it's a fairly pointless mis-feature. thank god its got no
apis - just signals and internals.
This commit is contained in:
Carsten Haitzler 2014-07-02 11:28:42 +09:00
parent a5adffa152
commit 8edc879cc2
4 changed files with 1 additions and 112 deletions

View File

@ -255,48 +255,6 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
return edc;
}
#ifdef HAVE_EIO
static Eina_Bool
_edje_file_warn(void *data)
{
Edje_File *edf = data;
Eina_List *l, *ll;
Edje *ed;
edf->references++;
EINA_LIST_FOREACH(edf->edjes, l, ed)
_edje_ref(ed);
EINA_LIST_FOREACH(edf->edjes, l, ed)
{
_edje_emit(ed, "edje,change,file", "edje");
}
EINA_LIST_FOREACH_SAFE(edf->edjes, l, ll, ed)
_edje_unref(ed);
edf->references--;
edf->timeout = NULL;
return EINA_FALSE;
}
static Eina_Bool
_edje_file_change(void *data, int ev_type EINA_UNUSED, void *event)
{
Edje_File *edf = data;
Eio_Monitor_Event *ev = event;
if (ev->monitor == edf->monitor)
{
if (edf->timeout) ecore_timer_del(edf->timeout);
edf->timeout = ecore_timer_add(0.5, _edje_file_warn, edf);
}
return ECORE_CALLBACK_PASS_ON;
}
#endif
static Edje_File *
_edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, time_t mtime)
{
@ -305,9 +263,6 @@ _edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_
Eina_List *l;
Edje_Part_Collection *edc;
Eet_File *ef;
#ifdef HAVE_EIO
Ecore_Event_Handler *ev;
#endif
ef = eet_mmap(f);
if (!ef)
@ -326,17 +281,6 @@ _edje_file_open(const Eina_File *f, const char *coll, int *error_ret, Edje_Part_
edf->f = eina_file_dup(f);
edf->ef = ef;
edf->mtime = mtime;
#ifdef HAVE_EIO
edf->monitor = eio_monitor_add(eina_file_filename_get(f));
ev = ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, _edje_file_change, edf);
edf->handlers = eina_list_append(edf->handlers, ev);
ev = ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _edje_file_change, edf);
edf->handlers = eina_list_append(edf->handlers, ev);
ev = ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _edje_file_change, edf);
edf->handlers = eina_list_append(edf->handlers, ev);
ev = ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, _edje_file_change, edf);
edf->handlers = eina_list_append(edf->handlers, ev);
#endif
if (edf->version != EDJE_FILE_VERSION)
{
@ -398,15 +342,12 @@ _edje_file_dangling(Edje_File *edf)
#endif
Edje_File *
_edje_cache_file_coll_open(const Eina_File *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed)
_edje_cache_file_coll_open(const Eina_File *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed EINA_UNUSED)
{
Edje_File *edf;
Eina_List *l, *hist;
Edje_Part_Collection *edc;
Edje_Part *ep;
#ifdef HAVE_EIO
Eina_Bool added = EINA_FALSE;
#endif
if (!_edje_file_hash)
{
@ -436,16 +377,6 @@ find_list:
edf = _edje_file_open(file, coll, error_ret, edc_ret, eina_file_mtime_get(file));
if (!edf) return NULL;
#ifdef HAVE_EIO
if (ed)
{
edf->edjes = eina_list_append(edf->edjes, ed);
added = EINA_TRUE;
}
#else
(void) ed;
#endif
eina_hash_direct_add(_edje_file_hash, &edf->f, edf);
/* return edf; */
@ -552,14 +483,6 @@ open:
edc->checked = 1;
}
}
#ifdef HAVE_EIO
if (!added)
{
if (edc && ed) edf->edjes = eina_list_append(edf->edjes, ed);
}
#else
(void) ed;
#endif
if (edc_ret) *edc_ret = edc;

View File

@ -1427,9 +1427,6 @@ _edje_file_del(Edje *ed)
}
if (ed->file)
{
#ifdef HAVE_EIO
ed->file->edjes = eina_list_remove(ed->file->edjes, ed);
#endif
_edje_cache_file_unref(ed->file);
ed->file = NULL;
}
@ -1472,9 +1469,6 @@ void
_edje_file_free(Edje_File *edf)
{
Edje_Color_Class *ecc;
#ifdef HAVE_EIO
Ecore_Event_Handler *event;
#endif
#define HASH_FREE(Hash) \
if (Hash) eina_hash_free(Hash); \
@ -1561,12 +1555,6 @@ _edje_file_free(Edje_File *edf)
}
if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns);
#ifdef HAVE_EIO
if (edf->timeout) ecore_timer_del(edf->timeout);
EINA_LIST_FREE(edf->handlers, event)
ecore_event_handler_del(event);
eio_monitor_del(edf->monitor);
#endif
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
_edje_textblock_style_cleanup(edf);

View File

@ -61,14 +61,6 @@ edje_init(void)
goto shutdown_embryo;
}
#ifdef HAVE_EIO
if (!eio_init())
{
ERR("Eio init failed");
goto shutdown_eet;
}
#endif
_edje_scale = FROM_DOUBLE(1.0);
_edje_edd_init();
@ -119,10 +111,6 @@ edje_init(void)
_edje_text_class_members_free();
_edje_text_class_hash_free();
_edje_edd_shutdown();
#ifdef HAVE_EIO
eio_shutdown();
shutdown_eet:
#endif
eet_shutdown();
shutdown_embryo:
embryo_shutdown();
@ -176,9 +164,6 @@ _edje_shutdown_core(void)
ecore_imf_shutdown();
#endif
#ifdef HAVE_EIO
eio_shutdown();
#endif
eet_shutdown();
embryo_shutdown();
ecore_shutdown();

View File

@ -490,13 +490,6 @@ struct _Edje_File
Eet_File *ef;
Eina_File *f;
#ifdef HAVE_EIO
Eio_Monitor *monitor;
Eina_List *edjes;
Eina_List *handlers;
Ecore_Timer *timeout;
#endif
unsigned char free_strings : 1;
unsigned char dangling : 1;
unsigned char warning : 1;