Re: [Tracker] [Patch] Correct locales support



Le jeudi 31 aoÃt 2006 Ã 19:20 +0100, Jamie McCracken a Ãcrit :
Laurent Aguerreche wrote:


This is the patch.

* many g_filename_to_utf8() or g_locale_to_utf8() added;
* setlocale(LC_ALL, "") added to get a working g_get_charset() in any
program;
* some g_utf8_validate() removed when g_locale_to_utf8() or
g_filename_to_utf8() need to be called;
* some code refactoring in clients;
* some headers removed or added in clients...;
* realpath(path,NULL) instead of realpath(path,tmp) in clients because
some systems are not limited with deep of directories. NULL handling is
a GNU extension.
* in tracker-extract.c, there were lines like:
   EXTRACTOR_removeEmptyKeywords (keywords);
  but this function modify keywords list and send a new one! So it needs
to be use that way:
   keywords = EXTRACTOR_removeEmptyKeywords (keywords);
* stat() => g_stat(), lstat() => g_lstat()
* some tests removed:

char **foo;
for (foo = bar; *foo; foo++) {
   if (*foo) {   /* it is always true... */
     ...
   }
}



okay this is great - thanks for your hard work here and for cleaning up 
some of the mess!

just one thing : do we really need the setlocale (LC_ALL, ""); stuff?

Currently, yes.

Glib uses some calls to g_get_charset() internally which uses
nl_langinfo() on Linux... Perhaps it is a bug of Glib.

If we are converting to/from utf-8 then we should not need these, surely?



Now Tracker seems to fully work on non UTF-8 systems but FAM backend has
some problems:
- let it index and all your files and extract metadata;
- then do something like:
  $ echo 'foo' > bar
- fam_callback() is called but I can only see plenty of lines:

tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
tracker_exec_sql failed: Table 'tmpfiles' already exists [Call
GetPendingFiles()]
etc.

and it never stops... Is is amazing to see that this bug doesn't happen
if I add breakpoints into fam_callback() and then run it in gdb...


this is probably my fault as I changed the way stuff is sync'ed without 
testing the FAM backend. We should always call 
tracker_db_remove_pending_files before sleeping (and this is why when 
you put a breakpoint you wont see the error cause the 100ms sleep will 
be faster than you stepping thro the code!)

try changing this in trackerd.c, in function process_files_thread so 
tracker_db_remove_pending_files is always called prior to sleeping:

/* pending files are present but not yet ready as we are waiting til 
they stabilize so we should sleep for 100ms (only occurs when using FAM) */
                      tracker_db_remove_pending_files (db_con);

                      if (k == 0) {
                              g_usleep (100000);
                      }

I also inspect tracker-fam.c according to what Marcus said...


Again thanks for the patch, I will need some time to look over it more 
closely so will get back to you in a day or two...

Ok.



Laurent.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]