SF.net SVN: geany:[6015] trunk/src/highlighting.c
ntrel at users.sourceforge.net
ntrel at xxxxx
Thu Oct 6 16:18:32 UTC 2011
Revision: 6015
http://geany.svn.sourceforge.net/geany/?rev=6015&view=rev
Author: ntrel
Date: 2011-10-06 16:18:31 +0000 (Thu, 06 Oct 2011)
Log Message:
-----------
Use utils_get_setting() for string keys.
Modified Paths:
--------------
trunk/src/highlighting.c
Modified: trunk/src/highlighting.c
===================================================================
--- trunk/src/highlighting.c 2011-10-06 15:42:00 UTC (rev 6014)
+++ trunk/src/highlighting.c 2011-10-06 16:18:31 UTC (rev 6015)
@@ -162,50 +162,15 @@
static void get_keyfile_keywords(GKeyFile *config, GKeyFile *configh,
const gchar *key, gint ft_id, gint pos)
{
- const gchar section[] = "keywords";
- gchar *result;
- const gchar *default_value = "";
-
- if (config == NULL || configh == NULL)
- {
- style_sets[ft_id].keywords[pos] = g_strdup(default_value);
- return;
- }
-
- result = g_key_file_get_string(configh, section, key, NULL);
- if (result == NULL)
- result = g_key_file_get_string(config, section, key, NULL);
-
- if (result == NULL)
- {
- style_sets[ft_id].keywords[pos] = g_strdup(default_value);
- }
- else
- {
- style_sets[ft_id].keywords[pos] = result;
- }
+ style_sets[ft_id].keywords[pos] =
+ utils_get_setting(string, configh, config, "keywords", key, "");
}
static void get_keyfile_wordchars(GKeyFile *config, GKeyFile *configh, gchar **wordchars)
{
- gchar *result;
-
- if (config == NULL || configh == NULL)
- {
- *wordchars = g_strdup(GEANY_WORDCHARS);
- return;
- }
-
- result = g_key_file_get_string(configh, "settings", "wordchars", NULL);
- if (result == NULL) result = g_key_file_get_string(config, "settings", "wordchars", NULL);
-
- if (result == NULL)
- {
- *wordchars = g_strdup(GEANY_WORDCHARS);
- }
- else
- *wordchars = result;
+ *wordchars = utils_get_setting(string, configh, config,
+ "settings", "wordchars", GEANY_WORDCHARS);
}
@@ -465,21 +430,8 @@
static gchar*
get_keyfile_whitespace_chars(GKeyFile *config, GKeyFile *configh)
{
- gchar *result;
-
- if (config == NULL || configh == NULL)
- {
- result = NULL;
- }
- else
- {
- result = g_key_file_get_string(configh, "settings", "whitespace_chars", NULL);
- if (result == NULL)
- result = g_key_file_get_string(config, "settings", "whitespace_chars", NULL);
- }
- if (result == NULL)
- result = g_strdup(GEANY_WHITESPACE_CHARS);
- return result;
+ return utils_get_setting(string, configh, config,
+ "settings", "whitespace_chars", GEANY_WHITESPACE_CHARS);
}
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