Enlightenment CVS committal
Author : lordchaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src/plugins
Modified Files:
etk_list_viewer.c layout_etk_simple.c
Log Message:
* Hook up the file cache dialog. Also supports sorting by # of listeners.
More details to come
* Fix logic flaw in event cycle for file listing and file-decaching (success #1
for file cache debug dialog)
===================================================================
RCS file:
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/etk_list_viewer.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- etk_list_viewer.c 5 Mar 2006 05:58:26 -0000 1.39
+++ etk_list_viewer.c 6 Mar 2006 10:41:40 -0000 1.40
@@ -359,17 +359,21 @@
}
-void
+Ecore_List*
gui_object_destroy_and_free (entropy_gui_component_instance * comp,
Ecore_Hash * gui_hash)
{
Ecore_List *list;
+ Ecore_List *file_remove_ref_list;
entropy_generic_file *obj;
gui_file *freeobj;
Etk_Tree_Row* row;
entropy_etk_file_list_viewer *view = comp->data;
+
+ file_remove_ref_list = ecore_list_new();
+
/*Temporarily stop callbacks, we don't want to clobber an in-op process */
entropy_notify_lock_loop (comp->core->notify);
@@ -388,7 +392,7 @@
}
/*Tell the core we no longer need this file - it might free it now */
- entropy_core_file_cache_remove_reference (obj->md5);
+ ecore_list_append(file_remove_ref_list, obj->md5);
}
ecore_hash_destroy (gui_hash);
view->gui_hash = ecore_hash_new(ecore_direct_hash, ecore_direct_compare);
@@ -403,6 +407,8 @@
entropy_notify_unlock_loop (comp->core->notify);
+ return file_remove_ref_list;
+
}
@@ -573,14 +579,15 @@
case ENTROPY_NOTIFY_FILELIST_REQUEST_EXTERNAL:
case ENTROPY_NOTIFY_FILELIST_REQUEST:{
entropy_generic_file *file;
+ Ecore_List* remove_ref;
+ char* ref;
entropy_generic_file *event_file =
((entropy_file_request *) eevent->data)->file;
viewer->current_folder = event_file;
- gui_object_destroy_and_free(comp, viewer->gui_hash);
-
+ remove_ref = gui_object_destroy_and_free(comp, viewer->gui_hash);
etk_tree_clear(ETK_TREE(viewer->tree));
@@ -596,6 +603,11 @@
list_viewer_add_row (comp, file);
}
+ while ( (ref = ecore_list_remove_first(remove_ref)))
+ entropy_core_file_cache_remove_reference (ref);
+ ecore_list_destroy(remove_ref);
+
+
}
break;
===================================================================
RCS file:
/cvsroot/enlightenment/e17/proto/entropy/src/plugins/layout_etk_simple.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- layout_etk_simple.c 6 Mar 2006 09:04:55 -0000 1.27
+++ layout_etk_simple.c 6 Mar 2006 10:41:40 -0000 1.28
@@ -3,6 +3,7 @@
#include "entropy_gui.h"
#include "etk_location_add_dialog.h"
#include "etk_mime_dialog.h"
+#include "etk_file_cache_dialog.h"
#include <dlfcn.h>
#include <Ecore.h>
#include <stdlib.h>
@@ -165,6 +166,11 @@
etk_mime_dialog_create();
}
+void etk_file_cache_dialog_cb(Etk_Object *obj, void *data)
+{
+ etk_file_cache_dialog_create();
+}
+
void _location_add_cb(Etk_Object *obj, void *data)
{
printf("Add location\n");
@@ -330,7 +336,8 @@
menu_item = _entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("Debug"),
ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menubar), NULL);
menu = etk_menu_new();
etk_menu_item_submenu_set(ETK_MENU_ITEM(menu_item), ETK_MENU(menu));
- _entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("File Cache"),
ETK_STOCK_PLACES_FOLDER_SAVED_SEARCH, ETK_MENU_SHELL(menu), NULL);
+ menu_item = _entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("File
Cache"), ETK_STOCK_PLACES_FOLDER_SAVED_SEARCH, ETK_MENU_SHELL(menu), NULL);
+ etk_signal_connect("activated", ETK_OBJECT(menu_item),
ETK_CALLBACK(etk_file_cache_dialog_cb), layout);
menu_item = _entropy_etk_menu_item_new(ETK_MENU_ITEM_NORMAL, _("Help"),
ETK_STOCK_NO_STOCK, ETK_MENU_SHELL(menubar), NULL);
menu = etk_menu_new();
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs