Phuah Yee Keat wrote:
http://www.geocities.com/kiwlm/entrance_xsession_additional.tar.gz
(with whatever bandwidth limit geocities have)
attached a patch against the tarball
1. I have copied the .desktop files from kdm verbatim, and install them
under PACKAGE_DATA_DIR
It is my personal oppinion that .desktop files should be installed by
each xsession providing package, and not be bundled with the login manager.
2. Entrance will now only have a configuration to where to look for
those .desktop files, currently they are stored in a comma separated
path list as '/entrance/sessions/dir'. Being a comma separated value
makes updates to this value harder though, maybe considering
'/entrance/sessions/dir/1', '/entrance/sessions/dir/2'?
like I already mentioned, why did you choose a non-standard path separator?
3. I have added some defaults (from my own consensus) and also the
location that enlightenment would install its enlightenment.desktop if
enlightenment is using the same --prefix as entrance is. I have found
nothing from google about where these XSession .desktop files should
reside, Application .desktop files should go into
/usr/share/applications though...
I would make the default desktop-folder a configure option..
--xsession-dir=/usr/share/xsessions
4. Entrance would try to look for the executable as specified in TryExec
in the desktop file, in the PATH environment variable, as KDM would have
done it.
sounds fine to me
5. Since KDM's .desktop files does not have "Icon" parameters, none of
the entries have default Icons, so I made an addition to check if
entrance have the icon files installed, kde.png, enlightenment.png,
gnome.png...
another reason not to bundle a score of desktop files ;)
Feedback welcomed. :)
there you have my feedback :)
Cheers,
--
Morten
:wq
diff -ur src/client/desktop_entry.c src.mn/client/desktop_entry.c
--- src/client/desktop_entry.c 2005-12-16 03:39:00.000000000 +0100
+++ src.mn/client/desktop_entry.c 2005-12-16 08:35:16.676608777 +0100
@@ -10,7 +10,7 @@
{
Desktop_Entry *d;
FILE *fp;
- char buf[1024];
+ char buf[PATH_MAX];
int len;
char *key, *value;
@@ -22,10 +22,9 @@
return NULL;
}
- d = malloc(sizeof(Desktop_Entry));
- memset(d, 0, sizeof(Desktop_Entry));
+ d = calloc(1, sizeof(Desktop_Entry));
- while (fgets(buf, sizeof(buf), fp)) {
+ while (fgets(buf, PATH_MAX, fp)) {
if (buf[0]==0 || buf[0]=='\n') {
continue;
}
diff -ur src/client/find_command.c src.mn/client/find_command.c
--- src/client/find_command.c 2005-12-16 03:39:06.000000000 +0100
+++ src.mn/client/find_command.c 2005-12-16 08:35:44.094247875 +0100
@@ -3,16 +3,10 @@
#include <string.h>
#include <stdio.h>
-#include "find_command.h"
-
-#ifndef MAXPATHLEN
-# define MAXPATHLEN 1024
-#endif
-
char *find_command_in_path(char *name)
{
char *pathenv;
- char fullpath[MAXPATHLEN];
+ char fullpath[PATH_MAX];
char *onepath;
/* check if its already an absoulute path */
@@ -35,7 +29,7 @@
onepath = strtok(pathenv, ":");
while (onepath) {
- snprintf(fullpath, sizeof(fullpath), "%s/%s", onepath, name);
+ snprintf(fullpath, PATH_MAX, "%s/%s", onepath, name);
if (access(fullpath, X_OK)==0) {
break;