[gnome-builder] libide/gui: load all languages



commit 2d4f36a3fb8628c7e5a6045fa6224360af72a2bd
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 11 15:00:37 2022 -0700

    libide/gui: load all languages
    
    We may want to approach this differently using the editorui plugin which
    can add the objects with a factory and classify them into sections.
    
    We could also show titles if sections have :title property set.

 src/libide/gui/ide-application-actions.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/gui/ide-application-actions.c b/src/libide/gui/ide-application-actions.c
index e8fad4881..c5e18a934 100644
--- a/src/libide/gui/ide-application-actions.c
+++ b/src/libide/gui/ide-application-actions.c
@@ -79,14 +79,15 @@ ide_application_actions_tweaks (GSimpleAction *action,
   {
     GtkSourceLanguageManager *lm = gtk_source_language_manager_get_default ();
     const char * const *ids = gtk_source_language_manager_get_language_ids (lm);
-    const char * const *allowed = IDE_STRV_INIT ("c", "chdr", "css", "xml");
 
     languages = g_list_store_new (GTK_SOURCE_TYPE_LANGUAGE);
 
     for (guint i = 0; ids[i]; i++)
       {
-        if (g_strv_contains (allowed, ids[i]))
-          g_list_store_append (languages, gtk_source_language_manager_get_language (lm, ids[i]));
+        GtkSourceLanguage *l = gtk_source_language_manager_get_language (lm, ids[i]);
+
+        if (!gtk_source_language_get_hidden (l))
+          g_list_store_append (languages, l);
       }
 
     ide_tweaks_expose_object (tweaks, "GtkSourceLanguages", G_OBJECT (languages));


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