@kugel- requested changes on this pull request.
What does your plugin do? I can understand the desire for doubles but comments (given that keyfiles are typically not meant to be looked at by users)?
@@ -795,11 +795,11 @@ gchar *utils_get_initials(const gchar *name)
* @param config A GKeyFile object. * @param section The group name to look in for the key. * @param key The key to find. - * @param default_value The default value which will be returned when @a section or @a key - * don't exist. + * @param default_value The default value which will be returned when @a section + * or @a key don't exist.
No unrelated changes, please.
@@ -476,6 +497,20 @@ void stash_group_add_boolean(StashGroup *group, gboolean *setting,
}
+/** Adds double setting. + * @param group . + * @param setting Address of setting variable. + * @param key_name Name for key in a @c GKeyFile. + * @param default_value Value to use if the key doesn't exist when loading. */ +GEANY_API_SYMBOL +void stash_group_add_double(StashGroup *group, gdouble *setting, + const gchar *key_name, gdouble default_value) +{ + gulong *default_long = (gulong*) &default_value; + add_pref(group, G_TYPE_DOUBLE, setting, key_name, (gpointer) *default_long);
add_pref should use a union. I'll prepare a change, then you can rebase this.