Re: [Nautilus-list] continued redhat merge

On Mon, 17 Sep 2001, Darin Adler wrote:

> The code in desktop-file-loader.c does not follow the Nautilus conventions.
> It uses struct _X, which we avoid. It is not in the "nautilus_" namespace.
> It calls isspace on chars, which is a bug. It needs to say "isspace((guchar)
> x)" everywhere it calls isspace. Many of the private functions are named
> g_xxx, which seems like it will make them conflict with the names of public
> functions of similar names added to glib. That doesn't bother me for
> g_strdupv, but g_key_equal seems like a foolish name to use. I'm not sure
> what to think about this code. I'd like to see it added to Eel rather than
> libnautilus-private, and I'd like to see some tests of it in isolation. I'd
> put test .desktop files into eel and run tests on this code with a test
> harness in there.

I started to clean this up. At first i moved it to eel, but this code 
really isn't polished enought to be used by any other library, so i kept 
it in libnautilus-private for now. They're in 
libnautilus-private/nautilus-desktop-parser.[ch] (redhat-merge-branch).

The new version is somewhat cleaned up and fixed, but what we should do is 
write a new .desktop file reader and validation library that is good 
enought to be used for both the panel and Nautilus and any other app that 
needs it.

George was talking about doing this, but i don't know the status of that. 
Otherwise i might have time to do it.

Then we could rip out the current parser and use the common one instead.

I added the comment:
/* This is a quick-hack to read and modify .desktop files.
 * It has severe limitations, but does what nautilus
 * needs right now. You cannot create new sections or add non-existing keys.
 * The right way to solve this is to write a good desktop file parser
 * and put it in another library for use by the panel, nautilus etc.

to the header file, and moved all not externally called functions inside 
the .c file.

I will now continue clean up the rest.

/ Alex

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