[Github-comments] [geany/geany] Stash Settings: Add double key type (PR #3004)

Thomas Martitz notifications at xxxxx
Tue Nov 16 06:17:23 UTC 2021


@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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3004#pullrequestreview-806857880
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211115/f690dc7f/attachment.htm>


More information about the Github-comments mailing list