Enlightenment CVS committal
Author : lordchaos
Project : e17
Module : proto
Dir : e17/proto/entropy/src
Modified Files:
entropy_config.c entropy_core.c entropy_gui.c
Log Message:
* Centralise structure/location config.
* Make ETK and EWL layout plugins read from central location config
* Fix bug in remote thumbnailer (it was luck that it ever worked)
* Various other bug fixes
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- entropy_config.c 15 Dec 2005 06:40:24 -0000 1.4
+++ entropy_config.c 22 Feb 2006 14:25:54 -0000 1.5
@@ -3,6 +3,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include "entropy_gui.h"
@@ -92,3 +93,59 @@
//printf("STUB\n");
}
+
+
+
+
+
+/*Config helper functions*/
+
+
+Ecore_Hash *
+entropy_config_standard_structures_parse (entropy_gui_component_instance *
instance,
+ char *config)
+{
+ Ecore_Hash *ret = ecore_hash_new (ecore_str_hash, ecore_str_compare);
+
+ if (!strstr (config, "|")) {
+ char *name;
+ char *uri;
+
+ //printf("Simple case - only one object...\n");
+
+ name = strtok (config, ";");
+ uri = strtok (NULL, ";");
+
+ ecore_hash_set(ret, strdup(name), strdup(uri));
+
+ }
+ else {
+ Ecore_List *objects = ecore_list_new ();
+ char *object;
+ char *name;
+ char *uri;
+
+ //printf("Complex case, multiple objects...\n");
+
+ object = strtok (config, "|");
+ ecore_list_append (objects, strdup (object));
+ while ((object = strtok (NULL, "|"))) {
+ ecore_list_append (objects, strdup (object));
+ }
+
+ ecore_list_goto_first (objects);
+ while ((object = ecore_list_next (objects))) {
+ name = strtok (object, ";");
+ uri = strtok (NULL, ";");
+
+
+
+ ecore_hash_set(ret, strdup(name), strdup(uri));
+ free (object);
+ }
+ ecore_list_destroy (objects);
+
+ }
+
+ return ret;
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_core.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- entropy_core.c 21 Feb 2006 12:20:05 -0000 1.48
+++ entropy_core.c 22 Feb 2006 14:25:54 -0000 1.49
@@ -1254,7 +1254,10 @@
ecore_hash_set(core_core->file_interest_list, md5, listener);
} else {
printf("*** BAD: Called set-reference with file already
cached!\n");
+
+ UNLOCK(&core_core->file_cache_mutex);
entropy_core_file_cache_add_reference(md5);
+ LOCK(&core_core->file_cache_mutex);
}
entropy_generic_file_uri_set(listener->file);
@@ -1340,9 +1343,17 @@
entropy_generic_file* entropy_core_parse_uri(char* uri) {
char* pos;
- entropy_generic_file* file = entropy_generic_file_new();
- evfs_file_uri_path* uri_path = evfs_parse_uri(uri);
+ entropy_generic_file* file;
+ evfs_file_uri_path* uri_path;
+ entropy_file_listener* listener;
+
+ /*If we already have this file made, don't remake it..*/
+ if ( (file = entropy_core_uri_generic_file_retrieve(uri))) {
+ return file;
+ }
+ file = entropy_generic_file_new();
+ uri_path = evfs_parse_uri(uri);
/*Get the last "/", after this is the filename (or dir name, or
whatever)*/
/*printf("Path: '%s'\n", uri_path->files[0]->path);*/
@@ -1365,8 +1376,12 @@
strcpy(file->uri_base, uri_path->files[0]->plugin_uri);
- //printf("Made a file with plugin '%s', path '%s', filename '%s'\n",
file->uri_base, file->path, file->filename);
-
+ /*Cache the file*/
+ listener = entropy_malloc(sizeof(entropy_file_listener));
+ file->md5 = md5_entropy_path_file(file->uri_base, file->path,
file->filename);
+ listener->file = file;
+ listener->count = 1;
+ entropy_core_file_cache_add(file->md5, listener);
return file;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/entropy_gui.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- entropy_gui.c 16 Jan 2006 11:17:30 -0000 1.3
+++ entropy_gui.c 22 Feb 2006 14:25:54 -0000 1.4
@@ -4,6 +4,8 @@
entropy_gui_component_instance* entropy_gui_component_instance_new() {
entropy_gui_component_instance* inst =
entropy_malloc(sizeof(entropy_gui_component_instance));
inst->active = COMPONENT_ACTIVE;
+
+ return inst;
}
void entropy_gui_component_instance_disable(entropy_gui_component_instance*
instance) {
-------------------------------------------------------
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