Commit Graph

61 Commits

Author SHA1 Message Date
Vincent Torri 285297dcdd * API break: _shutdown() functions return an int, now
* simplify a bit and fix init/shutdown functions



SVN revision: 42996
2009-10-10 06:19:13 +00:00
Cedric BAIL 703fb37368 * efreet: Prevent div by zero.
SVN revision: 42940
2009-10-07 12:57:13 +00:00
Vincent Torri 1403d26dce remoove unused variables
SVN revision: 42877
2009-10-04 22:28:12 +00:00
Cedric BAIL 05126826a3 * efreet: Use eina_log.
Patch from Matthieu.


SVN revision: 42599
2009-09-21 16:36:29 +00:00
Hannes Janetzek 51fd74a36f efreet_mime add fallback check for executables
SVN revision: 42474
2009-09-14 00:28:51 +00:00
Vincent Torri 2e38151ed8 formatting
SVN revision: 42084
2009-08-29 05:29:05 +00:00
Gustavo Sverzut Barbieri 85c2e25399 have efreet to match x-generic as well, requested by jeffdameth.
SVN revision: 41907
2009-08-21 03:03:59 +00:00
Gustavo Sverzut Barbieri 4faa46cab3 Efreet_Mime: bugfix for magic matching.
Efreet_Mime did not match last set of magics for given mime-type due to
missing check after the loop. This bug was partially masked by the
problem fixed in my previous patch.

By: Mikhail Gusarov


SVN revision: 41305
2009-07-11 14:26:53 +00:00
Gustavo Sverzut Barbieri 9aef9f5eca Efreet_Mime: fix subrules with non-zero depth.
Hello,

I've fixed a bug in parsing magic file in Efreet_Mime: if some magic
rule has a subrule with non-zero depth, then the 0 depth is used instead
for subrule. This led to nonsense like all .xml documents matched as
application/docbook+xml.

By: Mikhail Gusarov


SVN revision: 41304
2009-07-11 14:23:36 +00:00
Gustavo Sverzut Barbieri adf5c3553e use new stringshared hash, pointer was being misused since api is confusing.
The pointer type is really confusing, it was expecting pointer to
pointer what is really weird.

Cedric just added a stringshared variant that should be as fast
(removing the strcmp()) and is the api one would expect.

This fix a long standing bug I introduced (sorry!) when added the
cache, but it was bit hard to hit as if you didn't find a collision
you'd be adding to cache and never finding it. But I recently started
to use icons on desktop and for some weird reason the PDF icons
started to show in TAR :-P



SVN revision: 41113
2009-06-19 15:00:38 +00:00
Vincent Torri 361f682833 typo
SVN revision: 40260
2009-04-21 06:16:19 +00:00
Vincent Torri 1bf086809e * move header files in efree_provate.h to the source files
* fix compilation on Windows XP (not sure that Windows CE port is needed...)

note that, as ecore_exe is not available on Windows, some code have
been disables for that platform in src/lib/efreet_desktop.c. Also, a new Evil
version should be used (not in svn yet)

The compilation on Windows is needed for Ewl (icon and mime)



SVN revision: 40257
2009-04-20 23:20:40 +00:00
Vincent Torri 312a4365b8 fix header files
SVN revision: 39752
2009-03-27 11:14:21 +00:00
Cedric BAIL 81ee186382 * efreet: Use the right macro for the cast.
SVN revision: 39731
2009-03-26 17:56:51 +00:00
Vincent Torri 908a722bfa more leak fixes
SVN revision: 39650
2009-03-23 12:19:31 +00:00
Carsten Haitzler ddb11ee846 leaks--! this code is riddled with leaks! really really bad!
SVN revision: 39647
2009-03-23 10:27:54 +00:00
Gustavo Sverzut Barbieri ba1e67fcd8 Add LRU to mime icons cache.
This should really remove unused items that would age forever in the
last, forcing old but not so to be evicted before them.

Fortunately it was not so complex to add, and should wait just 3
pointers more of space per node.


SVN revision: 39350
2009-03-03 22:38:21 +00:00
Gustavo Sverzut Barbieri 200c92f82a efreet mime types icon cache.
This cache is very simple and should work fine when system does not
change, it keeps a direct association of mime-types and found icons,
remembering theme and icon size. Search is very fast since it uses
stringshared strings and thus direct pointer comparison in hash
search. We could optimize it even more if we assumed stringshared
strings to come in, so no need to eina_stringshare_add() (which is a
hash per se), using just eina_stringshare_ref().

Cache population is limited to compile-time value and just values
older than a given threshold are deleted. I do not keep a LRU explicit
list, so you might have some old but unused items always alive. I
don't find this too bad, sure it will consume more memory, but will
not hurt performance. We can change this to purge all expired items by
not checking for number of items to remove, removing all that match.

Next I plan to find out a good way to cache and speed up file->mime
discovery. I plan to do auto-generated state-machine to match
extensions, so you don't need to check the same extension character
more than once. Example:

   Input: bla.edc
   Extensions: edc edj eps png bmp

It would first try to match against 'e', 'p' and 'b'. It will match
'e' and then check for 'd' (edc or edj) or 'p' (eps). It will match
'd' and then check for 'c' or 'j'. This will reduce number of
comparisons considerably.

As I'm running out of time (4am, not much time left on this month), I
could use some help here.



SVN revision: 39343
2009-03-03 07:20:21 +00:00
Cedric BAIL 6978e98dc6 * estickies,
* etk,
	* PROTO/exalt,
	* E-MODULES-EXTRA/diskio,
	* E-MODULES-EXTRA/drawer,
	* E-MODULES-EXTRA/penguins,
	* E-MODULES-EXTRA/slideshow,
	* E-MODULES-EXTRA/mail,
	* E-MODULES-EXTRA/forecasts,
	* E-MODULES-EXTRA/iiirk,
	* E-MODULES-EXTRA/places,
	* e,
	* ewl,
	* ecore,
	* elitaire,
	* entrance,
	* e_dbus,
	* efreet: Here we go, move from Ecore_List to Eina_List.

	NOTE: This patch is huge, I did test it a lot, and I hope nothing is
	broken. But if you think something change after this commit, please
	contact me ASAP.


SVN revision: 39200
2009-02-25 11:03:47 +00:00
Cedric BAIL 35540b3a3b This commit is huge. I did test it a lot on my computer, and it run fine here.
But is so big i fear i could have broken some piece of code. So report any wrong
behaviour to me (cedric on #edevelop).

So moving e17 and efreet to eina_hash. With a little efreet API break so they
must come together.


SVN revision: 38185
2008-12-17 15:33:43 +00:00
Cedric BAIL 01befd2b67 Switch ecore_strings to eina_stringshare.
SVN revision: 36676
2008-10-15 14:48:03 +00:00
Sebastian Dransfeld bfb18778e2 Pass icon size as unsigned int.
SVN revision: 35490
2008-08-14 20:48:41 +00:00
Dan Sinclair 5c0aaab8f1 - cleanups
SVN revision: 35309
2008-08-02 22:09:04 +00:00
Davide Andreoli f438c7eb9a * Fix Doxy warnings
SVN revision: 35307
2008-08-02 21:48:44 +00:00
Carsten Haitzler 43821d36e4 * add efreet garbage data check
* remove printfs that clutter output
* add efreet file type check - only parse regular files
* chekc mmap returns correctly for MAP_FAILED results
* edje has some stubs for adding script-only objecvts - but nothing useful
right now


SVN revision: 34689
2008-05-29 02:00:04 +00:00
Sebastian Dransfeld b495b19470 formatting
SVN revision: 34212
2008-04-07 05:52:45 +00:00
Carsten Haitzler ec51ff71c6 1. stop doing unaligned memory accesses - htons() on a pointer to some
arbitrary point...
2. use int not long - long will be 64bit on 64bit platforms, but 32bit almost
everywhere (yes in theory it may not - but in practice, it won't - long
though will vary).


SVN revision: 34211
2008-04-06 23:02:54 +00:00
Sebastian Dransfeld d15dcd181c EAPI
SVN revision: 32339
2007-11-04 09:32:35 +00:00
Sebastian Dransfeld ee2d0762f4 Check for data size. Should be done throught the whole function!
SVN revision: 31723
2007-09-15 09:51:19 +00:00
doursse 6a7494bba7 remove trailing spaces
SVN revision: 31638
2007-09-06 16:15:10 +00:00
Sebastian Dransfeld f619a05536 Fix const warnings.
SVN revision: 31293
2007-08-13 05:36:03 +00:00
Sebastian Dransfeld b9c551c57d formatting
SVN revision: 31292
2007-08-13 05:33:26 +00:00
Sebastian Dransfeld b3e01bb957 Formatting
SVN revision: 31271
2007-08-12 19:28:02 +00:00
Sebastian Dransfeld 399d1a5c1b Formatting.
SVN revision: 31269
2007-08-12 19:18:16 +00:00
Carsten Haitzler 2f35dd7ab3 only check ext.. if there is one!
SVN revision: 31265
2007-08-12 11:14:56 +00:00
Carsten Haitzler 6b0688752a and for the picky - there's less copies for tolowoer. i also saw some BAD BAD
leaks. bad! alloc pointer but not freeing them! also fixed up #include of
alloca.h if needed.


SVN revision: 31260
2007-08-12 10:00:02 +00:00
Carsten Haitzler 492e5f9644 externsion checks should be case-insensitve.
SVN revision: 31245
2007-08-11 13:20:16 +00:00
Sebastian Dransfeld 3b116f3a2b Remove the icon cache.
This means that users of efreet_icon_list_find, efreet_icon_path_find and
efreet_icon_find must clean up after themselves!


SVN revision: 30986
2007-07-26 11:30:10 +00:00
Peter Wehrfritz cd20fbc9d9 *API BREAK* see the discussion in the mailing list. misc and e_modules will follow
SVN revision: 30970
2007-07-25 17:01:04 +00:00
Dan Sinclair 6d48fb4e38 - efreet_init will call efreet_icon_init so there is no reason to do the
call again


SVN revision: 30905
2007-07-19 14:56:35 +00:00
Nicholas Hughart 0a4d1e3605 Added efreet_mime_type_icon_get which will retrieve a mimetype icon. This follows the loose specification described in the fdo icon spec. Also added efreet_icon_list_find which will search for a list of icons in a theme before falling back to inherited themes. Also made a slight modification to the fallback detection for efreet_mime. Tabs will no longer trigger the return of application/octet-stream.
SVN revision: 30875
2007-07-17 19:21:20 +00:00
codewarrior 61b09fd882 no need to work on a file if its empty. speeds things up a hell of a lot.
SVN revision: 30803
2007-07-13 23:23:13 +00:00
Nicholas Hughart 5f4e0e936e API update. Now you have more control over which methods are used to check for a type by using the efreet_mime_*_type_get functions. Also vastly increased the speed of the glob checking.
SVN revision: 30612
2007-07-06 03:01:21 +00:00
Nicholas Hughart 7a470acd75 No debugging
SVN revision: 30593
2007-07-04 15:46:19 +00:00
Nicholas Hughart 4e6ce1caf5 This should work now for big endian.
SVN revision: 30592
2007-07-04 15:29:29 +00:00
Dan Sinclair 1a14377b08 - hm, change this back...
SVN revision: 30587
2007-07-04 03:00:46 +00:00
Dan Sinclair 54f06c5e70 - formatting
SVN revision: 30580
2007-07-03 18:01:56 +00:00
Nicholas Hughart 93d3922d79 Added fallback mime types according to the spec. Should only get a NULL return when the file doesn't exist.
SVN revision: 30579
2007-07-03 17:55:20 +00:00
Dan Sinclair 0445f933df - stop losing the last mime
SVN revision: 30578
2007-07-03 16:22:17 +00:00
Dan Sinclair d1cd6e6710 - remove debug
SVN revision: 30577
2007-07-03 16:15:51 +00:00