[gedit] Use enums directly with gsettings.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use enums directly with gsettings.
- Date: Sat, 19 Jun 2010 18:01:47 +0000 (UTC)
commit 26e730181fb6ba081d13d2a0059cce93c63903bd
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Jun 19 19:38:00 2010 +0200
Use enums directly with gsettings.
configure.ac | 4 +-
data/org.gnome.gedit.gschema.xml.in.in | 53 +++++++++---
gedit/dialogs/gedit-preferences-dialog.c | 10 +-
gedit/gedit-notebook.c | 67 +--------------
gedit/gedit-print-job.c | 25 +++---
gedit/gedit-settings.c | 128 +-----------------------------
gedit/gedit-settings.h | 13 +---
gedit/gedit-view.c | 7 +-
gedit/gedit-window.c | 3 +-
9 files changed, 74 insertions(+), 236 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c4e2258..122abbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,7 +55,7 @@ ACTIVE_PLUGINS="'docinfo', 'modelines', 'filebrowser', 'spell', 'time'"
AC_SUBST(ACTIVE_PLUGINS)
dnl toolbar style for gedit schemas
-TOOLBAR_STYLE="GEDIT_TOOLBAR_SYSTEM"
+TOOLBAR_STYLE="system"
AC_SUBST(TOOLBAR_STYLE)
dnl check for win32 platform
@@ -63,7 +63,7 @@ AC_MSG_CHECKING([for Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
- TOOLBAR_STYLE="'GEDIT_TOOLBAR_ICONS'"
+ TOOLBAR_STYLE="icons"
;;
*)
platform_win32=no
diff --git a/data/org.gnome.gedit.gschema.xml.in.in b/data/org.gnome.gedit.gschema.xml.in.in
index 7171695..f92ddc2 100644
--- a/data/org.gnome.gedit.gschema.xml.in.in
+++ b/data/org.gnome.gedit.gschema.xml.in.in
@@ -1,4 +1,31 @@
<schemalist>
+ <enum id="org.gnome.gedit.WrapMode">
+ <value nick="none" value="0"/>
+ <value nick="char" value="1"/>
+ <value nick="word" value="2"/>
+ <value nick="word-char" value="3"/>
+ </enum>
+
+ <enum id="org.gnome.gedit.ShowTabs">
+ <value nick="never" value="0"/>
+ <value nick="auto" value="1"/>
+ <value nick="always" value="2"/>
+ </enum>
+
+ <enum id="org.gnome.gedit.ToolbarSetting">
+ <value nick="system" value="0"/>
+ <value nick="icons" value="1"/>
+ <value nick="icons-and-text" value="2"/>
+ <value nick="icons-both-horiz" value="3"/>
+ </enum>
+
+ <enum id="org.gnome.gedit.SmartHomeEnd">
+ <value nick="disabled" value="0"/>
+ <value nick="before" value="1"/>
+ <value nick="after" value="2"/>
+ <value nick="always" value="3"/>
+ </enum>
+
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gedit" path="/apps/gedit/">
<child name="preferences" schema="org.gnome.gedit.preferences"/>
<child name="state" schema="org.gnome.gedit.state"/>
@@ -51,10 +78,10 @@
<_summary>Maximum Number of Undo Actions</_summary>
<_description>Maximum number of actions that gedit will be able to undo or redo. Use "-1" for unlimited number of actions.</_description>
</key>
- <key name="wrap-mode" type="s">
- <default>'GTK_WRAP_WORD'</default>
+ <key name="wrap-mode" enum="org.gnome.gedit.WrapMode">
+ <default>'word'</default>
<_summary>Line Wrapping Mode</_summary>
- <_description>Specifies how to wrap long lines in the editing area. Use "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for wrapping at word boundaries, and "GTK_WRAP_CHAR" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
+ <_description>Specifies how to wrap long lines in the editing area. Use "none" for no wrapping, "word" for wrapping at word boundaries, and "char" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
</key>
<key name="tabs-size" type="u">
<default>8</default>
@@ -96,10 +123,10 @@
<_summary>Right Margin Position</_summary>
<_description>Specifies the position of the right margin.</_description>
</key>
- <key name="smart-home-end" type="s">
+ <key name="smart-home-end" enum="org.gnome.gedit.SmartHomeEnd">
<default>'after'</default>
<_summary>Smart Home End</_summary>
- <_description>Specifies how the cursor moves when the HOME and END keys are pressed. Use "DISABLED" to always move at the start/end of the line, "AFTER" to move to the start/end of the line the first time the keys are pressed and to the start/end of the text ignoring whitespaces the second time the keys are pressed, "BEFORE" to move to the start/end of the text before moving to the start/end of the line and "ALWAYS" to always move to the start/end of the text instead of the start/end of the line.</_description>
+ <_description>Specifies how the cursor moves when the HOME and END keys are pressed. Use "disabled" to always move at the start/end of the line, "after" to move to the start/end of the line the first time the keys are pressed and to the start/end of the text ignoring whitespaces the second time the keys are pressed, "before" to move to the start/end of the text before moving to the start/end of the line and "always" to always move to the start/end of the text instead of the start/end of the line.</_description>
</key>
<key name="writable-vfs-schemes" type="as">
<default>['dav', 'davs', 'ftp', 'sftp', 'smb', 'ssh']</default>
@@ -128,15 +155,15 @@
<_summary>Toolbar is Visible</_summary>
<_description>Whether the toolbar should be visible in editing windows.</_description>
</key>
- <key name="toolbar-buttons-style" type="s">
+ <key name="toolbar-buttons-style" enum="org.gnome.gedit.ToolbarSetting">
<default>'@TOOLBAR_STYLE@'</default>
<_summary>Toolbar Buttons Style</_summary>
- <_description>Style for the toolbar buttons. Possible values are "GEDIT_TOOLBAR_SYSTEM" to use the system's default style, "GEDIT_TOOLBAR_ICONS" to display icons only, "GEDIT_TOOLBAR_ICONS_AND_TEXT" to display both icons and text, and "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ" to display prioritized text beside icons. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
+ <_description>Style for the toolbar buttons. Possible values are "system" to use the system's default style, "icons" to display icons only, "icons-and-text" to display both icons and text, and "icons-both-horiz" to display prioritized text beside icons. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
</key>
- <key name="notebook-show-tabs-mode" type="s">
- <default>'ALWAYS'</default>
+ <key name="notebook-show-tabs-mode" enum="org.gnome.gedit.ShowTabs">
+ <default>'always'</default>
<_summary>Notebook Show Tabs Mode</_summary>
- <_description>Specifies when to show the notebook tabs. Use "NEVER" to never show the tabs, "ALWAYS" to always show the tabs, and "AUTO" to show the tabs only when there is more than one tab. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
+ <_description>Specifies when to show the notebook tabs. Use "never" to never show the tabs, "always" to always show the tabs, and "auto" to show the tabs only when there is more than one tab. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
</key>
<key name="statusbar-visible" type="b">
<default>true</default>
@@ -168,10 +195,10 @@
<_summary>Print Header</_summary>
<_description>Whether gedit should include a document header when printing documents.</_description>
</key>
- <key name="print-wrap-mode" type="s">
- <default>'GTK_WRAP_WORD'</default>
+ <key name="print-wrap-mode" enum="org.gnome.gedit.WrapMode">
+ <default>'word'</default>
<_summary>Printing Line Wrapping Mode</_summary>
- <_description>Specifies how to wrap long lines for printing. Use "GTK_WRAP_NONE" for no wrapping, "GTK_WRAP_WORD" for wrapping at word boundaries, and "GTK_WRAP_CHAR" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
+ <_description>Specifies how to wrap long lines for printing. Use "none" for no wrapping, "word" for wrapping at word boundaries, and "char" for wrapping at individual character boundaries. Note that the values are case-sensitive, so make sure they appear exactly as mentioned here.</_description>
</key>
<key name="print-line-numbers" type="u">
<default>0</default>
diff --git a/gedit/dialogs/gedit-preferences-dialog.c b/gedit/dialogs/gedit-preferences-dialog.c
index 2cbbce4..e63258b 100644
--- a/gedit/dialogs/gedit-preferences-dialog.c
+++ b/gedit/dialogs/gedit-preferences-dialog.c
@@ -291,9 +291,9 @@ wrap_mode_checkbutton_toggled (GtkToggleButton *button,
}
}
- gedit_settings_set_wrap_mode (dlg->priv->editor,
- GEDIT_SETTINGS_WRAP_MODE,
- mode);
+ g_settings_set_enum (dlg->priv->editor,
+ GEDIT_SETTINGS_WRAP_MODE,
+ mode);
}
static void
@@ -329,8 +329,8 @@ setup_view_page (GeditPreferencesDialog *dlg)
"u", &right_margin_position);
/* Set initial state */
- wrap_mode = gedit_settings_get_wrap_mode (dlg->priv->editor,
- GEDIT_SETTINGS_WRAP_MODE);
+ wrap_mode = g_settings_get_enum (dlg->priv->editor,
+ GEDIT_SETTINGS_WRAP_MODE);
switch (wrap_mode)
{
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index eea3431..fa5547e 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -766,60 +766,6 @@ gedit_notebook_switch_page_cb (GtkNotebook *notebook,
gtk_widget_grab_focus (child);
}
-static gboolean
-show_tabs_mode_get_mapping (GValue *value,
- GVariant *variant,
- gpointer user_data G_GNUC_UNUSED)
-{
- const gchar *str;
- GeditNotebookShowTabsModeType show_tabs_mode;
-
- str = g_variant_get_string (variant, NULL);
-
- if (g_strcmp0 (str, "NEVER") == 0)
- {
- show_tabs_mode = GEDIT_NOTEBOOK_SHOW_TABS_NEVER;
- }
- else if (g_strcmp0 (str, "AUTO") == 0)
- {
- show_tabs_mode = GEDIT_NOTEBOOK_SHOW_TABS_AUTO;
- }
- else /* ALWAYS */
- {
- show_tabs_mode = GEDIT_NOTEBOOK_SHOW_TABS_ALWAYS;
- }
-
- g_value_set_enum (value, show_tabs_mode);
-
- return TRUE;
-}
-
-static GVariant *
-show_tabs_mode_set_mapping (const GValue *value,
- const GVariantType *expected_type,
- gpointer user_data G_GNUC_UNUSED)
-{
- GVariant *result = NULL;
-
- switch (g_value_get_enum (value))
- {
- case GEDIT_NOTEBOOK_SHOW_TABS_NEVER:
- result = g_variant_new_string ("NEVER");
- break;
-
- case GEDIT_NOTEBOOK_SHOW_TABS_AUTO:
- result = g_variant_new_string ("AUTO");
- break;
-
- case GEDIT_NOTEBOOK_SHOW_TABS_ALWAYS:
- default:
- result = g_variant_new_string ("ALWAYS");
- break;
- }
-
- return result;
-}
-
static void
gedit_notebook_init (GeditNotebook *notebook)
{
@@ -835,14 +781,11 @@ gedit_notebook_init (GeditNotebook *notebook)
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), TRUE);
- g_settings_bind_with_mapping (notebook->priv->ui_settings,
- GEDIT_SETTINGS_SHOW_TABS_MODE,
- notebook,
- "show-tabs-mode",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
- show_tabs_mode_get_mapping,
- show_tabs_mode_set_mapping,
- NULL, NULL);
+ g_settings_bind (notebook->priv->ui_settings,
+ GEDIT_SETTINGS_SHOW_TABS_MODE,
+ notebook,
+ "show-tabs-mode",
+ G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
g_signal_connect (notebook,
"button-press-event",
diff --git a/gedit/gedit-print-job.c b/gedit/gedit-print-job.c
index 6ec966b..45695eb 100644
--- a/gedit/gedit-print-job.c
+++ b/gedit/gedit-print-job.c
@@ -390,8 +390,8 @@ create_custom_widget_cb (GtkPrintOperation *operation,
}
/* Text wrapping */
- wrap_mode = gedit_settings_get_wrap_mode (job->priv->print_settings,
- GEDIT_SETTINGS_PRINT_WRAP_MODE);
+ wrap_mode = g_settings_get_enum (job->priv->print_settings,
+ GEDIT_SETTINGS_PRINT_WRAP_MODE);
switch (wrap_mode)
{
@@ -457,6 +457,7 @@ custom_widget_apply_cb (GtkPrintOperation *operation,
{
gboolean syntax, page_header;
const gchar *body, *header, *numbers;
+ GtkWrapMode wrap_mode;
syntax = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->syntax_checkbutton));
page_header = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->page_header_checkbutton));
@@ -489,25 +490,23 @@ custom_widget_apply_cb (GtkPrintOperation *operation,
if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->text_wrapping_checkbutton)))
{
- gedit_settings_set_wrap_mode (job->priv->print_settings,
- GEDIT_SETTINGS_PRINT_WRAP_MODE,
- GTK_WRAP_NONE);
+ wrap_mode = GTK_WRAP_NONE;
}
else
{
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->do_not_split_checkbutton)))
{
- gedit_settings_set_wrap_mode (job->priv->print_settings,
- GEDIT_SETTINGS_PRINT_WRAP_MODE,
- GTK_WRAP_WORD);
+ wrap_mode = GTK_WRAP_WORD;
}
else
{
- gedit_settings_set_wrap_mode (job->priv->print_settings,
- GEDIT_SETTINGS_PRINT_WRAP_MODE,
- GTK_WRAP_CHAR);
+ wrap_mode = GTK_WRAP_CHAR;
}
}
+
+ g_settings_set_enum (job->priv->print_settings,
+ GEDIT_SETTINGS_PRINT_WRAP_MODE,
+ GTK_WRAP_NONE);
}
static void
@@ -535,8 +534,8 @@ create_compositor (GeditPrintJob *job)
print_header = g_settings_get_boolean (job->priv->print_settings,
GEDIT_SETTINGS_PRINT_HEADER);
- wrap_mode = gedit_settings_get_wrap_mode (job->priv->print_settings,
- GEDIT_SETTINGS_PRINT_WRAP_MODE);
+ wrap_mode = g_settings_get_enum (job->priv->print_settings,
+ GEDIT_SETTINGS_PRINT_WRAP_MODE);
job->priv->compositor = GTK_SOURCE_PRINT_COMPOSITOR (
g_object_new (GTK_TYPE_SOURCE_PRINT_COMPOSITOR,
diff --git a/gedit/gedit-settings.c b/gedit/gedit-settings.c
index d0eb84e..a65e08b 100644
--- a/gedit/gedit-settings.c
+++ b/gedit/gedit-settings.c
@@ -354,7 +354,7 @@ on_wrap_mode_changed (GSettings *settings,
GtkWrapMode wrap_mode;
GList *views, *l;
- wrap_mode = gedit_settings_get_wrap_mode (settings, key);
+ wrap_mode = g_settings_get_enum (settings, key);
views = gedit_app_get_views (gedit_app_get_default ());
@@ -550,7 +550,7 @@ on_smart_home_end_changed (GSettings *settings,
GtkSourceSmartHomeEndType smart_he;
GList *views, *l;
- smart_he = gedit_settings_get_smart_home_end (gs);
+ smart_he = g_settings_get_enum (settings, key);
views = gedit_app_get_views (gedit_app_get_default ());
@@ -903,128 +903,4 @@ gedit_settings_set_list (GSettings *settings,
g_free (values);
}
-GeditToolbarSetting
-gedit_settings_get_toolbar_style (GeditSettings *gs)
-{
- GeditToolbarSetting res;
- gchar *str;
-
- g_return_val_if_fail (GEDIT_IS_SETTINGS (gs), 0);
-
- str = g_settings_get_string (gs->priv->ui,
- "toolbar-buttons-style");
-
- g_return_val_if_fail (str != NULL, 0);
-
- if (strcmp (str, "GEDIT_TOOLBAR_ICONS") == 0)
- res = GEDIT_TOOLBAR_ICONS;
- else if (strcmp (str, "GEDIT_TOOLBAR_ICONS_AND_TEXT") == 0)
- res = GEDIT_TOOLBAR_ICONS_AND_TEXT;
- else if (strcmp (str, "GEDIT_TOOLBAR_ICONS_BOTH_HORIZ") == 0)
- res = GEDIT_TOOLBAR_ICONS_BOTH_HORIZ;
- else
- res = GEDIT_TOOLBAR_SYSTEM;
-
- g_free (str);
-
- return res;
-}
-
-GtkSourceSmartHomeEndType
-gedit_settings_get_smart_home_end (GeditSettings *gs)
-{
- GtkSourceSmartHomeEndType res;
- gchar *str;
-
- g_return_val_if_fail (GEDIT_IS_SETTINGS (gs), GTK_SOURCE_SMART_HOME_END_AFTER);
-
- str = g_settings_get_string (gs->priv->editor, "smart-home-end");
-
- g_return_val_if_fail (str != NULL, GTK_SOURCE_SMART_HOME_END_AFTER);
-
- if (strcmp (str, "DISABLED") == 0)
- res = GTK_SOURCE_SMART_HOME_END_DISABLED;
- else if (strcmp (str, "BEFORE") == 0)
- res = GTK_SOURCE_SMART_HOME_END_BEFORE;
- else if (strcmp (str, "ALWAYS") == 0)
- res = GTK_SOURCE_SMART_HOME_END_ALWAYS;
- else
- res = GTK_SOURCE_SMART_HOME_END_AFTER;
-
- g_free (str);
-
- return res;
-}
-
-static gchar *
-get_wrap_str (guint mode)
-{
- gchar *str;
-
- switch (mode)
- {
- case GTK_WRAP_NONE:
- str = g_strdup ("GTK_WRAP_NONE");
- break;
-
- case GTK_WRAP_CHAR:
- str = g_strdup ("GTK_WRAP_CHAR");
- break;
-
- case GTK_WRAP_WORD:
- default:
- str = g_strdup ("GTK_WRAP_WORD");
- break;
- }
-
- return str;
-}
-
-GtkWrapMode
-gedit_settings_get_wrap_mode (GSettings *settings,
- const gchar *key)
-{
- GtkWrapMode res;
- gchar *str;
-
- g_return_val_if_fail (G_IS_SETTINGS (settings), GTK_WRAP_WORD);
- g_return_val_if_fail (key != NULL, GTK_WRAP_WORD);
-
- str = g_settings_get_string (settings, key);
-
- g_return_val_if_fail (str != NULL, GTK_WRAP_WORD);
-
- if (strcmp (str, "GTK_WRAP_NONE") == 0)
- {
- res = GTK_WRAP_NONE;
- }
- else if (strcmp (str, "GTK_WRAP_CHAR") == 0)
- {
- res = GTK_WRAP_CHAR;
- }
- else
- {
- res = GTK_WRAP_WORD;
- }
-
- g_free (str);
-
- return res;
-}
-
-void
-gedit_settings_set_wrap_mode (GSettings *settings,
- const gchar *key,
- GtkWrapMode mode)
-{
- gchar *str;
-
- g_return_if_fail (G_IS_SETTINGS (settings));
- g_return_if_fail (key != NULL);
-
- str = get_wrap_str (mode);
-
- g_settings_set_string (settings, key, str);
-}
-
/* ex:ts=8:noet: */
diff --git a/gedit/gedit-settings.h b/gedit/gedit-settings.h
index 64b9f47..51c56e9 100644
--- a/gedit/gedit-settings.h
+++ b/gedit/gedit-settings.h
@@ -70,10 +70,6 @@ GeditLockdownMask gedit_settings_get_lockdown (GeditSettings *gs);
gchar *gedit_settings_get_system_font (GeditSettings *gs);
-GtkSourceSmartHomeEndType gedit_settings_get_smart_home_end (GeditSettings *gs);
-
-GeditToolbarSetting gedit_settings_get_toolbar_style (GeditSettings *gs);
-
/* Utility functions */
GSList *gedit_settings_get_list (GSettings *settings,
const gchar *key);
@@ -82,13 +78,6 @@ void gedit_settings_set_list (GSettings *settings,
const gchar *key,
const GSList *list);
-GtkWrapMode gedit_settings_get_wrap_mode (GSettings *settings,
- const gchar *key);
-
-void gedit_settings_set_wrap_mode (GSettings *settings,
- const gchar *key,
- GtkWrapMode mode);
-
/* key constants */
#define GEDIT_SETTINGS_USE_DEFAULT_FONT "use-default-font"
#define GEDIT_SETTINGS_EDITOR_FONT "editor-font"
@@ -107,11 +96,13 @@ void gedit_settings_set_wrap_mode (GSettings *settings,
#define GEDIT_SETTINGS_BRACKET_MATCHING "bracket-matching"
#define GEDIT_SETTINGS_DISPLAY_RIGHT_MARGIN "display-right-margin"
#define GEDIT_SETTINGS_RIGHT_MARGIN_POSITION "right-margin-position"
+#define GEDIT_SETTINGS_SMART_HOME_END "smart-home-end"
#define GEDIT_SETTINGS_WRITABLE_VFS_SCHEMES "writable-vfs-schemes"
#define GEDIT_SETTINGS_RESTORE_CURSOR_POSITION "restore-cursor-position"
#define GEDIT_SETTINGS_SYNTAX_HIGHLIGHTING "syntax-highlighting"
#define GEDIT_SETTINGS_SEARCH_HIGHLIGHTING "search-highlighting"
#define GEDIT_SETTINGS_TOOLBAR_VISIBLE "toolbar-visible"
+#define GEDIT_SETTINGS_TOOLBAR_BUTTONS_STYLE "toolbar-buttons-style"
#define GEDIT_SETTINGS_STATUSBAR_VISIBLE "statusbar-visible"
#define GEDIT_SETTINGS_SIDE_PANE_VISIBLE "side-pane-visible"
#define GEDIT_SETTINGS_BOTTOM_PANE_VISIBLE "bottom-pane-visible"
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index eeab4ce..200fd6d 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -394,10 +394,11 @@ gedit_view_init (GeditView *view)
hl_current_line = g_settings_get_boolean (view->priv->editor_settings,
GEDIT_SETTINGS_HIGHLIGHT_CURRENT_LINE);
- wrap_mode = gedit_settings_get_wrap_mode (view->priv->editor_settings,
- GEDIT_SETTINGS_WRAP_MODE);
+ wrap_mode = g_settings_get_enum (view->priv->editor_settings,
+ GEDIT_SETTINGS_WRAP_MODE);
- smart_home_end = gedit_settings_get_smart_home_end (GEDIT_SETTINGS (gs));
+ smart_home_end = g_settings_get_enum (view->priv->editor_settings,
+ GEDIT_SETTINGS_SMART_HOME_END);
g_object_set (G_OBJECT (view),
"wrap_mode", wrap_mode,
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index cf89928..e879c80 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -654,7 +654,8 @@ set_toolbar_style (GeditWindow *window,
GSettings *settings;
settings = _gedit_app_get_settings (gedit_app_get_default ());
- style = gedit_settings_get_toolbar_style (GEDIT_SETTINGS (settings));
+ style = g_settings_get_enum (window->priv->ui_settings,
+ GEDIT_SETTINGS_TOOLBAR_BUTTONS_STYLE);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]