diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-03-29 22:38:05 -0400 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-03-29 22:38:05 -0400 |
| commit | 3121146eccd031a56d410eb48f3002558f41b40a (patch) | |
| tree | e29479b3bc75be258b3b6782e3d95dee47f71e83 /obt/ddparse.c | |
| parent | 67bed35b7c1b1c9470aa8d0ba33974eabd66e089 (diff) | |
parse some of the .desktop stuff into an ObtLink structure
localized names still don't work.
most of the app-specific stuff isn't done yet.
categories aren't handled yet (to only show in/not show in some category)
Diffstat (limited to 'obt/ddparse.c')
| -rw-r--r-- | obt/ddparse.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/obt/ddparse.c b/obt/ddparse.c index fe7feb93..6aee25e7 100644 --- a/obt/ddparse.c +++ b/obt/ddparse.c @@ -17,6 +17,7 @@ */ #include "obt/ddparse.h" +#include "obt/link.h" #ifdef HAVE_STRING_H #include <string.h> #endif @@ -77,8 +78,8 @@ static void parse_value_free(ObtDDParseValue *v) v->value.strings.n = 0; break; case OBT_DDPARSE_BOOLEAN: - break; case OBT_DDPARSE_NUMERIC: + case OBT_DDPARSE_ENUM_APPLICATION: break; default: g_assert_not_reached(); @@ -546,6 +547,18 @@ static gboolean parse_desktop_entry_value(gchar *key, const gchar *val, case OBT_DDPARSE_NUMERIC: v.value.numeric = parse_value_numeric(val, parse, error); break; + case OBT_DDPARSE_ENUM_APPLICATION: + if (val[0] == 'A' && strcmp(val+1, "pplication") == 0) + v.value.enumerable = OBT_LINK_TYPE_APPLICATION; + else if (val[0] == 'L' && strcmp(val+1, "ink") == 0) + v.value.enumerable = OBT_LINK_TYPE_URL; + else if (val[0] == 'D' && strcmp(val+1, "irectory") == 0) + v.value.enumerable = OBT_LINK_TYPE_DIRECTORY; + else { + parse_error("Unknown Type", parse, error); + return FALSE; + } + break; default: g_assert_not_reached(); } |
