From 3121146eccd031a56d410eb48f3002558f41b40a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 29 Mar 2010 22:38:05 -0400 Subject: 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) --- obt/ddparse.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'obt/ddparse.c') 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 #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(); } -- cgit v1.2.3