[gnome-builder] style-scheme: let the caller know if we couldn't update the style
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] style-scheme: let the caller know if we couldn't update the style
- Date: Tue, 8 Mar 2016 06:40:16 +0000 (UTC)
commit e5b1e919e7b2dc938fd1ccd3d9b30e6158b3ff99
Author: Christian Hergert <christian hergert me>
Date: Mon Mar 7 22:38:33 2016 -0800
style-scheme: let the caller know if we couldn't update the style
libide/ide-source-style-scheme.c | 10 ++++++----
libide/ide-source-style-scheme.h | 6 +++---
2 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/libide/ide-source-style-scheme.c b/libide/ide-source-style-scheme.c
index bb5012c..0dfe0e2 100644
--- a/libide/ide-source-style-scheme.c
+++ b/libide/ide-source-style-scheme.c
@@ -20,7 +20,7 @@
#include "ide-source-style-scheme.h"
-void
+gboolean
ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
const gchar *style_name,
GtkTextTag *tag)
@@ -39,8 +39,8 @@ ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
gboolean italic = FALSE;
gboolean italic_set = FALSE;
- g_return_if_fail (GTK_SOURCE_IS_STYLE_SCHEME (style_scheme));
- g_return_if_fail (style_name != NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_STYLE_SCHEME (style_scheme), FALSE);
+ g_return_val_if_fail (style_name != NULL, FALSE);
g_object_set (tag,
"foreground-set", FALSE,
@@ -61,7 +61,7 @@ ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
style = gtk_source_style_scheme_get_style (style_scheme, defname);
if (style == NULL)
- return;
+ return FALSE;
}
g_object_get (style,
@@ -91,4 +91,6 @@ ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
if (underline_set && underline)
g_object_set (tag, "underline", PANGO_UNDERLINE_SINGLE, NULL);
+
+ return TRUE;
}
diff --git a/libide/ide-source-style-scheme.h b/libide/ide-source-style-scheme.h
index 118656f..b72cf73 100644
--- a/libide/ide-source-style-scheme.h
+++ b/libide/ide-source-style-scheme.h
@@ -23,9 +23,9 @@
G_BEGIN_DECLS
-void ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
- const gchar *style,
- GtkTextTag *tag);
+gboolean ide_source_style_scheme_apply_style (GtkSourceStyleScheme *style_scheme,
+ const gchar *style,
+ GtkTextTag *tag);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]