Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Wed, 17 Dec 2014 16:59:55 UTC Commit: a862389714b4339d7f98ae6ba7142aa82bc0f926 https://github.com/geany/geany-plugins/commit/a862389714b4339d7f98ae6ba7142a...
Log Message: ----------- webhelper: Add support for string list settings
Modified Paths: -------------- webhelper/src/gwh-settings.c
Modified: webhelper/src/gwh-settings.c 22 lines changed, 22 insertions(+), 0 deletions(-) =================================================================== @@ -291,6 +291,16 @@ key_file_set_value (GKeyFile *kf, g_key_file_set_string (kf, group, key, g_value_get_string (value)); break;
+ case G_TYPE_BOXED: + if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { + gchar **val = g_value_get_boxed (value); + + g_key_file_set_string_list (kf, group, key, (const gchar *const *) val, + val ? g_strv_length (val) : 0); + break; + } + /* fallthrough */ + default: g_set_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, "Unsupported setting type "%s" for setting "%s::%s"", @@ -411,6 +421,18 @@ key_file_get_value (GKeyFile *kf, break; }
+ case G_TYPE_BOXED: + if (G_VALUE_HOLDS (value, G_TYPE_STRV)) { + gchar **val; + + val = g_key_file_get_string_list (kf, group, key, NULL, &err); + if (! err) { + g_value_take_boxed (value, val); + } + break; + } + /* fallthrough */ + default: g_set_error (&err, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_INVALID_VALUE, "Unsupported setting type "%s" for setting "%s::%s"",
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org