[gnome-text-editor/gnome-42] utils: fix inconsistent line-ending(s) use
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor/gnome-42] utils: fix inconsistent line-ending(s) use
- Date: Tue, 17 May 2022 19:18:14 +0000 (UTC)
commit 5fac051fc84fb52333ef37d65b2e8094e072822c
Author: Christian Hergert <chergert redhat com>
Date: Tue May 17 12:17:23 2022 -0700
utils: fix inconsistent line-ending(s) use
src/editor-utils.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/editor-utils.c b/src/editor-utils.c
index a68218e..e12c340 100644
--- a/src/editor-utils.c
+++ b/src/editor-utils.c
@@ -35,6 +35,8 @@
#define FONT_WEIGHT "font-weight"
#define FONT_SIZE "font-size"
+#define CHOICE_LINE_ENDING "line-ending"
+
gchar *
_editor_font_description_to_css (const PangoFontDescription *font_desc)
{
@@ -447,17 +449,17 @@ _editor_file_chooser_add_line_endings (GtkFileChooser *chooser,
}
gtk_file_chooser_add_choice (chooser,
- "line-ending",
+ CHOICE_LINE_ENDING,
_("Line Ending:"),
(const char **)(gpointer)choices->data,
(const char **)(gpointer)labels->data);
- gtk_file_chooser_set_choice (chooser, "line-endings", "unix");
+ gtk_file_chooser_set_choice (chooser, CHOICE_LINE_ENDING, "unix");
for (guint i = 0; i < G_N_ELEMENTS (line_endings); i++)
{
if (line_endings[i].type == selected)
{
- gtk_file_chooser_set_choice (chooser, "line-endings", line_endings[i].id);
+ gtk_file_chooser_set_choice (chooser, CHOICE_LINE_ENDING, line_endings[i].id);
break;
}
}
@@ -486,7 +488,7 @@ _editor_file_chooser_get_line_ending (GtkFileChooser *chooser)
g_return_val_if_fail (GTK_IS_FILE_CHOOSER (chooser), 0);
- if ((ending = gtk_file_chooser_get_choice (chooser, "line-ending")))
+ if ((ending = gtk_file_chooser_get_choice (chooser, CHOICE_LINE_ENDING)))
{
for (guint i = 0; i < G_N_ELEMENTS (line_endings); i++)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]