Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: etk_list_viewer.c filesystem.c layout_etk_simple.c Log Message: * File monitor system rationalisation =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/etk_list_viewer.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -3 -r1.37 -r1.38 --- etk_list_viewer.c 5 Mar 2006 02:00:54 -0000 1.37 +++ etk_list_viewer.c 5 Mar 2006 05:42:37 -0000 1.38 @@ -640,6 +640,13 @@ /*Check that this file is the current dir we are displaying*/ entropy_generic_file* parent_folder = entropy_core_parent_folder_file_get(file); + + printf("At list viewer, Parent folder is: %p : Current folder: %p\n", parent_folder, viewer->current_folder); + if (parent_folder) { + printf("Parent folder string: %s/%s : Current folder: %s/%s", parent_folder->path, parent_folder->filename, + viewer->current_folder->path, viewer->current_folder->filename); + } + if (parent_folder && parent_folder == viewer->current_folder) { list_viewer_add_row (comp, file); } =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/filesystem.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -3 -r1.51 -r1.52 --- filesystem.c 4 Mar 2006 08:23:16 -0000 1.51 +++ filesystem.c 5 Mar 2006 05:42:37 -0000 1.52 @@ -51,6 +51,9 @@ //printf("DEMO: For file: '%s'\n", (char*)data->file_monitor.filename); //printf("DEMO: Directory '%s\n", folder); //printf("DEMO: Plugin: '%s'\n", (char*)data->file_monitor.plugin); + // + + printf("Got a monitor event for folder '%s'..\n", folder); watchers = ecore_hash_keys (folder_monitor_hash); @@ -64,6 +67,9 @@ entropy_file_listener *listener; + printf("Creating event for instance/layout %p..\n", key); + + entropy_generic_file *file; if (!(listener = entropy_core_file_cache_retrieve (md5))) { file = entropy_generic_file_new (); @@ -128,6 +134,8 @@ } + printf("Dispatching create event for '%s' to %p\n", file->filename, key); + gui_event->data = file; entropy_core_layout_notify_event (key, gui_event, ENTROPY_EVENT_LOCAL); @@ -459,7 +467,8 @@ /*Internal functions*/ void filesystem_monitor_directory (void *requester, evfs_file_uri_path * folder) -{ +{ + printf("Monitoring '%s' for '%p'\n", folder->files[0]->path, requester); ecore_hash_set (folder_monitor_hash, requester, folder); } @@ -468,9 +477,32 @@ { /*We assume we only monitor one dir at a time, per requester */ evfs_file_uri_path *dir = ecore_hash_get (folder_monitor_hash, requester); + Ecore_List* keys; + entropy_gui_component_instance* key; + evfs_file_uri_path* compare; + int found = 0; + if (dir) { - //fprintf(stderr, "Demonitoring '%s'\n", dir->files[0]->path); - evfs_monitor_remove (con, dir->files[0]); + ecore_hash_remove(folder_monitor_hash, requester); + + //fprintf(stderr, "Demonitoring '%s' for '%p'...\n", dir->files[0]->path, requester); + + /*Now check if anyone else is monitoring this dir - if not, remove the evfs listener*/ + keys = ecore_hash_keys(folder_monitor_hash); + while ( (key = ecore_list_remove_first(keys))) { + compare = ecore_hash_get(folder_monitor_hash, key); + if (compare && evfs_filereference_equal_is(dir->files[0], compare->files[0])) + found = 1; + } + + if (!found) { + //printf("Removing last watcher on directory!\n"); + evfs_monitor_remove (con, dir->files[0]); + } else { + //printf("More watchers on directory!\n"); + } + + evfs_cleanup_file_uri_path(dir); } else { //fprintf(stderr, "This requester has no monitored directories\n"); =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_etk_simple.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -3 -r1.24 -r1.25 --- layout_etk_simple.c 5 Mar 2006 02:00:54 -0000 1.24 +++ layout_etk_simple.c 5 Mar 2006 05:42:37 -0000 1.25 @@ -196,6 +196,9 @@ /*Parse the file from the URI*/ file = entropy_core_parse_uri (uri); + printf("Object for %s/%s is %p....\n", file->path, file->filename, file); + + /*This will be moved to a central function. TODO*/ if (!strcmp(file->uri_base, "file")) icon_string = PACKAGE_DATA_DIR "/icons/local-system.jpg"; ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs