]> Dogcows Code - chaz/openbox/blobdiff - obt/ddparse.c
parse some of the .desktop stuff into an ObtLink structure
[chaz/openbox] / obt / ddparse.c
index fe7feb93cc3eea25440c8c4ccb416c060b561e1c..6aee25e72ec5f4a8606bd815746846df592cf5cf 100644 (file)
@@ -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();
     }
This page took 0.023943 seconds and 4 git commands to generate.