SF.net SVN: geany:[5432] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Tue Nov 23 17:36:29 UTC 2010
Revision: 5432
http://geany.svn.sourceforge.net/geany/?rev=5432&view=rev
Author: ntrel
Date: 2010-11-23 17:36:29 +0000 (Tue, 23 Nov 2010)
Log Message:
-----------
Remove unnecessary 'global' from long line editor pref field names.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/editor.c
trunk/src/editor.h
trunk/src/keybindings.c
trunk/src/keyfile.c
trunk/src/prefs.c
trunk/src/project.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/ChangeLog 2010-11-23 17:36:29 UTC (rev 5432)
@@ -19,6 +19,9 @@
Add editor_get_prefs() instead of editor_get_long_line_*()
functions. This general function can be extended to support
various project and document overrides.
+ * src/keybindings.c, src/project.c, src/prefs.c, src/keyfile.c,
+ src/editor.c, src/editor.h:
+ Remove unnecessary 'global' from long line editor pref field names.
2010-11-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/editor.c 2010-11-23 17:36:29 UTC (rev 5432)
@@ -383,13 +383,13 @@
case 1: /* use global settings */
break;
case 2: /* custom (enabled) */
- return editor_prefs.long_line_global_type;
+ return editor_prefs.long_line_type;
}
- if (!editor_prefs.long_line_global_enabled)
+ if (!editor_prefs.long_line_enabled)
return 2;
else
- return editor_prefs.long_line_global_type;
+ return editor_prefs.long_line_type;
}
@@ -398,7 +398,7 @@
if (app->project && app->project->long_line_behaviour != 1 /* use global settings */)
return app->project->long_line_column;
else
- return editor_prefs.long_line_global_column;
+ return editor_prefs.long_line_column;
}
@@ -411,8 +411,8 @@
/* project overrides */
eprefs.indentation = (GeanyIndentPrefs*)editor_get_indent_prefs(NULL);
- eprefs.long_line_global_type = editor_get_long_line_type();
- eprefs.long_line_global_column = editor_get_long_line_column();
+ eprefs.long_line_type = editor_get_long_line_type();
+ eprefs.long_line_column = editor_get_long_line_column();
return &eprefs;
}
Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/editor.h 2010-11-23 17:36:29 UTC (rev 5432)
@@ -102,6 +102,7 @@
/** Default prefs when creating a new editor window.
* Some of these can be overridden per document or per project. */
+/* See editor_get_prefs(). */
typedef struct GeanyEditorPrefs
{
GeanyIndentPrefs *indentation; /* Default indentation prefs. Use editor_get_indent_prefs(). */
@@ -109,10 +110,10 @@
gboolean show_indent_guide;
gboolean show_line_endings;
/* 0 - line, 1 - background, 2 - disabled.
- * This setting may be overriden when a project is opened. Use @c editor_get_prefs(). */
- gint long_line_global_type;
- /* This setting may be overriden when a project is opened. Use @c editor_get_prefs(). */
- gint long_line_global_column;
+ * This setting may be overridden when a project is opened. Use @c editor_get_prefs(). */
+ gint long_line_type;
+ /* This setting may be overridden when a project is opened. Use @c editor_get_prefs(). */
+ gint long_line_column;
gchar *long_line_color;
gboolean show_markers_margin; /* view menu */
gboolean show_linenumber_margin; /* view menu */
@@ -143,8 +144,8 @@
gboolean completion_drops_rest_of_word;
gchar *color_scheme;
gint show_virtual_space;
- /* This setting may be overriden when a project is opened. Use @c editor_get_long_line_type(). */
- gboolean long_line_global_enabled;
+ /* This setting may be overridden when a project is opened. Use @c editor_get_prefs(). */
+ gboolean long_line_enabled;
}
GeanyEditorPrefs;
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/keybindings.c 2010-11-23 17:36:29 UTC (rev 5432)
@@ -2328,10 +2328,10 @@
/* use line break column if enabled */
column = eprefs->line_break_column;
}
- else if (eprefs->long_line_global_type != 2)
+ else if (eprefs->long_line_type != 2)
{
/* use long line if enabled */
- column = eprefs->long_line_global_column;
+ column = eprefs->long_line_column;
}
else
{
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/keyfile.c 2010-11-23 17:36:29 UTC (rev 5432)
@@ -375,9 +375,9 @@
g_key_file_set_boolean(config, PACKAGE, "show_line_endings", editor_prefs.show_line_endings);
g_key_file_set_boolean(config, PACKAGE, "show_markers_margin", editor_prefs.show_markers_margin);
g_key_file_set_boolean(config, PACKAGE, "show_linenumber_margin", editor_prefs.show_linenumber_margin);
- g_key_file_set_boolean(config, PACKAGE, "long_line_enabled", editor_prefs.long_line_global_enabled);
- g_key_file_set_integer(config, PACKAGE, "long_line_type", editor_prefs.long_line_global_type);
- g_key_file_set_integer(config, PACKAGE, "long_line_column", editor_prefs.long_line_global_column);
+ g_key_file_set_boolean(config, PACKAGE, "long_line_enabled", editor_prefs.long_line_enabled);
+ g_key_file_set_integer(config, PACKAGE, "long_line_type", editor_prefs.long_line_type);
+ g_key_file_set_integer(config, PACKAGE, "long_line_column", editor_prefs.long_line_column);
g_key_file_set_string(config, PACKAGE, "long_line_color", editor_prefs.long_line_color);
/* editor */
@@ -665,15 +665,15 @@
interface_prefs.use_native_windows_dialogs = utils_get_setting_boolean(config, PACKAGE, "use_native_windows_dialogs", FALSE);
/* display, editor */
- editor_prefs.long_line_global_enabled = utils_get_setting_boolean(config, PACKAGE, "long_line_enabled", TRUE);
- editor_prefs.long_line_global_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0);
- if (editor_prefs.long_line_global_type == 2) /* backward compatibility */
+ editor_prefs.long_line_enabled = utils_get_setting_boolean(config, PACKAGE, "long_line_enabled", TRUE);
+ editor_prefs.long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0);
+ if (editor_prefs.long_line_type == 2) /* backward compatibility */
{
- editor_prefs.long_line_global_type = 0;
- editor_prefs.long_line_global_enabled = FALSE;
+ editor_prefs.long_line_type = 0;
+ editor_prefs.long_line_enabled = FALSE;
}
editor_prefs.long_line_color = utils_get_setting_string(config, PACKAGE, "long_line_color", "#C2EBC2");
- editor_prefs.long_line_global_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72);
+ editor_prefs.long_line_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72);
editor_prefs.symbolcompletion_min_chars = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_min_chars", GEANY_MIN_SYMBOLLIST_CHARS);
editor_prefs.symbolcompletion_max_height = utils_get_setting_integer(config, PACKAGE, "symbolcompletion_max_height", GEANY_MAX_SYMBOLLIST_HEIGHT);
editor_prefs.line_wrapping = utils_get_setting_boolean(config, PACKAGE, "line_wrapping", FALSE); /* default is off for better performance */
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/prefs.c 2010-11-23 17:36:29 UTC (rev 5432)
@@ -397,12 +397,12 @@
gtk_font_button_set_font_name(GTK_FONT_BUTTON(widget), interface_prefs.editor_font);
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_long_line");
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), editor_prefs.long_line_global_column);
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), editor_prefs.long_line_column);
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_long_line");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.long_line_global_enabled);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), editor_prefs.long_line_enabled);
- switch (editor_prefs.long_line_global_type)
+ switch (editor_prefs.long_line_type)
{
case 0: widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_long_line_line"); break;
case 1: widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_long_line_background"); break;
@@ -864,17 +864,17 @@
interface_prefs.sidebar_openfiles_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_long_line");
- editor_prefs.long_line_global_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+ editor_prefs.long_line_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "radio_long_line_line");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
- editor_prefs.long_line_global_type = 0;
+ editor_prefs.long_line_type = 0;
else
/* now only the "background" radio remains */
- editor_prefs.long_line_global_type = 1;
+ editor_prefs.long_line_type = 1;
- if (editor_prefs.long_line_global_column == 0)
- editor_prefs.long_line_global_enabled = FALSE;
+ if (editor_prefs.long_line_column == 0)
+ editor_prefs.long_line_enabled = FALSE;
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_show_notebook_tabs");
interface_prefs.show_notebook_tabs = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
@@ -979,7 +979,7 @@
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "spin_long_line");
/* note: use stash for new code - it updates spin buttons itself */
gtk_spin_button_update(GTK_SPIN_BUTTON(widget));
- editor_prefs.long_line_global_column = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
+ editor_prefs.long_line_column = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widget));
widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_folding");
editor_prefs.folding = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c 2010-11-23 17:25:58 UTC (rev 5431)
+++ trunk/src/project.c 2010-11-23 17:36:29 UTC (rev 5432)
@@ -635,7 +635,7 @@
project->priv = &priv;
project->long_line_behaviour = 1 /* use global settings */;
- project->long_line_column = editor_prefs.long_line_global_column;
+ project->long_line_column = editor_prefs.long_line_column;
app->project = project;
return project;
@@ -998,7 +998,7 @@
p->long_line_behaviour = utils_get_setting_integer(config, "long line marker",
"long_line_behaviour", 1 /* follow global */);
p->long_line_column = utils_get_setting_integer(config, "long line marker",
- "long_line_column", editor_prefs.long_line_global_column);
+ "long_line_column", editor_prefs.long_line_column);
apply_editor_prefs();
build_load_menu(config, GEANY_BCS_PROJ, (gpointer)p);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list