[Github-comments] [geany/geany] Stash Settings: Expose StashPref to plugins, look up by name (PR #3008)

xiota notifications at xxxxx
Wed Nov 17 18:45:40 UTC 2021


This PR exposes the StashPref struct to the plugin API.  They can later by looked up by name with `stash_group_get_pref_by_name()`.  The caller needs to have a pointer to the StashGroup that contains the desired pref, so this isn't currently very useful.  But it is needed to further extend stash settings without changing the existing API.  (Key comments, override settings, config/session split.)

* `union Value` is also made public.  I don't know how to code it to keep it in `stash.c`.
* Is there a better name for `stash_group_get_pref_by_name()`?
* Existing code using stash settings should continue to work.
* StashGroup will be exposed in a later PR.

Example use of the new lookup function:
```C++
  StashPref *pref = stash_group_get_pref_by_name(group, "price");
  msgwin_status_add("%s = %f", pref->key_name, *(gdouble *)pref->setting);
```
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3008

-- Commit Summary --

  * Stash Settings: Expose StashPref to plugins, look up by name

-- File Changes --

    M src/plugindata.h (2)
    M src/stash.c (52)
    M src/stash.h (36)

-- Patch Links --

https://github.com/geany/geany/pull/3008.patch
https://github.com/geany/geany/pull/3008.diff

-- 
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/3008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211117/43ff867b/attachment-0001.htm>


More information about the Github-comments mailing list