Enlightenment CVS committal

Author  : chaos
Project : e17
Module  : apps/evfs

Dir     : e17/apps/evfs/src/plugins/file


Modified Files:
        evfs_fs_vfolder.c 


Log Message:
* More migration to plugin-based vfolders.  Vfolder plugins use a very 
restricted subset of the existing plugin api (basically just list), therefore 
in the interest of simplicity they do not re-use th existing file plugin system

===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/plugins/file/evfs_fs_vfolder.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- evfs_fs_vfolder.c   12 Aug 2006 08:17:24 -0000      1.10
+++ evfs_fs_vfolder.c   12 Aug 2006 12:34:25 -0000      1.11
@@ -26,7 +26,8 @@
 # include <config.h>
 #endif
 
-#include <evfs.h>
+#include "evfs.h"
+#include "evfs_plugin.h"
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -39,9 +40,8 @@
 #include <dirent.h>
 #include <Ecore_File.h>
 
-#define EVFS_PLUGIN_VFOLDER_GROUPS_ID "/Groups"
-#define EVFS_PLUGIN_VFOLDER_QUERIES_ID "/Queries"
-#define EVFS_PLUGIN_VFOLDER_URI "vfolder"
+
+//#define EVFS_PLUGIN_VFOLDER_QUERIES_ID "/Queries"
 #define MAX_GROUP_LENGTH 255
 
 void evfs_dir_list(evfs_client * client, evfs_command * command,
@@ -93,7 +93,6 @@
           while ((key = ecore_list_next(keys))) {
                   snprintf(path,sizeof(path),"/%s",key); 
 
-                  /*Metadata groups ref*/
                   ref = NEW(evfs_filereference);
                   ref->plugin_uri = strdup(EVFS_PLUGIN_VFOLDER_URI);
                   ref->path = strdup(path);
@@ -102,55 +101,26 @@
           }
           ecore_list_destroy(keys);
 
-   } else if (!strncmp(path, EVFS_PLUGIN_VFOLDER_GROUPS_ID, 
strlen(EVFS_PLUGIN_VFOLDER_GROUPS_ID))) {
-          if (!strcmp(path, EVFS_PLUGIN_VFOLDER_GROUPS_ID)) {
-                  Evas_List* group_list;
-                  Evas_List* iter;
-                  char assemble[PATH_MAX];
-                  evfs_metadata_group_header* g;
-                  
-                  /*Get group list, and return*/
-                  group_list = evfs_metadata_groups_get();
-                  
-                  for (iter = group_list; iter; ) {
-                          g = iter->data;
-                          
-                          snprintf(assemble, sizeof(assemble), "%s/%s", 
-                                          EVFS_PLUGIN_VFOLDER_GROUPS_ID, 
g->name);
-                          
-                          ref = NEW(evfs_filereference);
-                          ref->plugin_uri = strdup(EVFS_PLUGIN_VFOLDER_URI);
-                          ref->path = strdup(assemble);
-                          if (g->visualhint) ref->attach = 
strdup(g->visualhint);
-                          ref->file_type = EVFS_FILE_DIRECTORY;
-                          ecore_list_append(files, ref);
-
-                          iter = iter->next;
+   } else {
+          /*Find the plugin that handles this, */
+          if (path[0] == '/') {
+                  char vfolder_type[MAX_GROUP_LENGTH];
+                  char* pos=strchr(&path[1], '/');
+                  if (!pos) {
+                          strncpy(vfolder_type, &path[1], MAX_GROUP_LENGTH);
+                  } else {
+                          strncpy(vfolder_type, &path[1], pos-path-1);
+                          vfolder_type[pos-path-1] = '\0';
                   }
-          } else {
-                  char* group_name;
-                  char* item;
-                  Ecore_List* list;
-                  int i;
-                  group_name = strstr(path + 1, "/") + 1;
-                  evfs_file_uri_path* path;
-
-                  printf("Group name: %s\n", group_name);
-
-                  list = evfs_metadata_file_group_list(group_name);
-
-                  ecore_list_goto_first(list);
-                  while ( (item = ecore_list_remove_first(list))) {
-                          path = evfs_parse_uri(item);
-                          ecore_list_append(files, path->files[0]);
+                  printf("Looking for vfolder plugin for: %s\n", vfolder_type);
+
+                  evfs_plugin* plugin = 
ecore_hash_get(evfs_server_get()->plugin_vfolder_hash, vfolder_type);
+
+                  
(*EVFS_PLUGIN_VFOLDER(plugin)->functions->evfs_vfolder_list)(command->file_command.files[0],
 &files);
 
-                          /*TEMP FIXME - check this file for keywords*/
-                          evfs_metadata_extract_queue(path->files[0]);
 
-                          evfs_cleanup_file_uri_path(path);
-                  }
-                  ecore_list_destroy(list);
           }
+          
    }
                   
    *directory_list = evfs_file_list_sort(files);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to