Enlightenment CVS committal Author : chaos Project : e17 Module : apps/evfs
Dir : e17/apps/evfs/src/bin Modified Files: evfs_metadata_db.c Log Message: VFolder actually lists =================================================================== RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_metadata_db.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- evfs_metadata_db.c 27 Aug 2007 13:38:53 -0000 1.14 +++ evfs_metadata_db.c 28 Aug 2007 02:45:39 -0000 1.15 @@ -597,3 +597,45 @@ return entries; } + +Ecore_List* evfs_metadata_db_vfolder_search_entries_execute(sqlite3* db, Ecore_List* entries) +{ + char query[PATH_MAX]; + + EvfsVfolderEntry* entry; + ecore_list_first_goto(entries); + Ecore_List* files; + char* file; + int ret; + sqlite3_stmt *pStmt; + + files = ecore_list_new(); + + snprintf(query,sizeof(query),"select distinct f.filename from File f where 1 "); + while ( (entry=ecore_list_next(entries))) { + if (entry->type == 'M') { + strcat(query, " and f.id in (select file from FileMeta where keyword='"); + strcat(query, entry->name); + strcat(query, "'"); + strcat(query, " and value = '"); + strcat(query, entry->value); + strcat(query, "') "); + + } + } + + ret = sqlite3_prepare(db, query, -1, &pStmt, 0); + if (ret == SQLITE_OK) { + while ((ret = sqlite3_step(pStmt)) == SQLITE_ROW) { + file = strdup( sqlite3_column_text(pStmt,0)); + ecore_list_append(files,file); + } + + sqlite3_reset(pStmt); + sqlite3_finalize(pStmt); + + } + printf("%s\n", query); + + return files; +} ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs