[gnome-builder] add more content types we know about



commit 71fd0949fcb82b99b673e3bcce7484f15f429ee7
Author: Christian Hergert <christian hergert me>
Date:   Sat Mar 21 23:29:03 2015 -0700

    add more content types we know about

 src/workbench/gb-workbench.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/workbench/gb-workbench.c b/src/workbench/gb-workbench.c
index 9187261..7ffc058 100644
--- a/src/workbench/gb-workbench.c
+++ b/src/workbench/gb-workbench.c
@@ -477,6 +477,17 @@ gb_workbench_set_active_workspace (GbWorkbench *self,
     gtk_stack_set_visible_child (self->stack, GTK_WIDGET (workspace));
 }
 
+static gboolean
+supports_content_type (const gchar *content_type)
+{
+  return (g_str_has_prefix (content_type, "text/") ||
+          g_str_equal (content_type, "application/x-ruby") ||
+          g_str_equal (content_type, "application/xml") ||
+          g_str_equal (content_type, "application/x-ruby") ||
+          g_str_equal (content_type, "application/javascript") ||
+          g_str_equal (content_type, "application/x-gtk-builder"));
+}
+
 static void
 gb_workbench__query_info_cb (GObject      *object,
                              GAsyncResult *result,
@@ -513,7 +524,7 @@ gb_workbench__query_info_cb (GObject      *object,
   g_debug ("Open with content_type=\"%s\"", content_type);
 
   /* If this doesn't look like text, let's open it with xdg-open */
-  if (!g_str_has_prefix (content_type, "text"))
+  if (!supports_content_type (content_type))
     {
       g_autofree gchar *uri = NULL;
 


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