Enlightenment CVS committal
Author : lordchaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src
Modified Files:
entropy_core.c
Log Message:
* More DND work
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_core.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- entropy_core.c 20 Feb 2006 10:03:44 -0000 1.45
+++ entropy_core.c 21 Feb 2006 10:15:55 -0000 1.46
@@ -184,6 +184,7 @@
//printf ("Initialising the file cache..\n");
core->file_interest_list = ecore_hash_new(ecore_str_hash,
ecore_str_compare);
+ core->uri_reference_list = ecore_hash_new(ecore_str_hash,
ecore_str_compare);
//Misc setup (thumbnail path)
core->user_home_dir = strdup(getenv("HOME"));
@@ -1261,12 +1262,26 @@
}
+entropy_generic_file* entropy_core_uri_generic_file_retrieve(char* uri) {
+ entropy_generic_file* file;
+
+ file = ecore_hash_get(core_core->uri_reference_list, uri);
+ return file;
+}
+
void entropy_core_file_cache_add_reference(char* md5) {
LOCK(&core_core->file_cache_mutex);
entropy_file_listener* listener =
ecore_hash_get(core_core->file_interest_list, md5);
if (listener) {
listener->count++;
+
+ /*At this point, check if the file needs a uri generating..
+ * And generate if necesary */
+ if (!listener->file->uri) {
+ listener->file->uri =
entropy_core_generic_file_uri_create(listener->file,0);
+ ecore_hash_set(core_core->uri_reference_list,
listener->file->uri, listener->file);
+ }
}
UNLOCK(&core_core->file_cache_mutex);
}
@@ -1280,9 +1295,8 @@
listener->count--;
if (listener->count <= 0 && 0) {
- //printf("Freeing file '%s'\n",
listener->file->filename);
-
- /*This should be a seperate function*/
+ ecore_hash_remove(core_core->uri_reference_list,
listener->file->uri);
+
entropy_generic_file_destroy(listener->file);
free(listener);
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs