[gnome-builder] gsettings: handle missing language for file settings
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] gsettings: handle missing language for file settings
- Date: Wed, 23 Nov 2016 04:32:53 +0000 (UTC)
commit d05a8c865f85410b27f183b7cdec8d3881479799
Author: Christian Hergert <chergert redhat com>
Date: Tue Nov 22 20:31:52 2016 -0800
gsettings: handle missing language for file settings
If we don't have a GtkSourceLanguage, fallback to a non-existant language
id "plain-text". Without this, we don't get default values for GSettings
which means things like "overwrite-braces" are not set.
libide/gsettings/ide-gsettings-file-settings.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libide/gsettings/ide-gsettings-file-settings.c b/libide/gsettings/ide-gsettings-file-settings.c
index 4ad7fe3..ab675c8 100644
--- a/libide/gsettings/ide-gsettings-file-settings.c
+++ b/libide/gsettings/ide-gsettings-file-settings.c
@@ -85,12 +85,13 @@ file_notify_language_cb (IdeGsettingsFileSettings *self,
g_clear_object (&self->language_settings);
language = ide_file_get_language (file);
+
if (language == NULL)
- IDE_EXIT;
+ lang_id = "plain-text";
+ else
+ lang_id = gtk_source_language_get_id (language);
- lang_id = gtk_source_language_get_id (language);
- if (lang_id == NULL)
- IDE_EXIT;
+ g_assert (lang_id != NULL);
context = ide_object_get_context (IDE_OBJECT (self));
relative_path = g_strdup_printf ("/editor/language/%s/", lang_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]