<p dir="auto">This PR exposes the StashPref struct to the plugin API. They can later by looked up by name with <code>stash_group_get_pref_by_name()</code>. 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.)</p>
<ul dir="auto">
<li><code>union Value</code> is also made public. I don't know how to code it to keep it in <code>stash.c</code>.</li>
<li>Is there a better name for <code>stash_group_get_pref_by_name()</code>?</li>
<li>Existing code using stash settings should continue to work.</li>
<li>StashGroup will be exposed in a later PR.</li>
</ul>
<p dir="auto">Example use of the new lookup function:</p>
<div class="highlight highlight-source-c++ position-relative overflow-auto" data-snippet-clipboard-copy-content=" StashPref *pref = stash_group_get_pref_by_name(group, "price");
msgwin_status_add("%s = %f", pref->key_name, *(gdouble *)pref->setting);
"><pre> StashPref *pref = stash_group_get_pref_by_name(group, <span class="pl-s"><span class="pl-pds">"</span>price<span class="pl-pds">"</span></span>);
<span class="pl-en">msgwin_status_add</span>(<span class="pl-s"><span class="pl-pds">"</span>%s = %f<span class="pl-pds">"</span></span>, pref->key_name, *(gdouble *)pref->setting);</pre></div>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/geany/geany/pull/3008'>https://github.com/geany/geany/pull/3008</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/geany/geany/pull/3008/commits/f811c590b11f2d3b85368f3a58ac52cd176a289b" class="commit-link">f811c59</a> Stash Settings: Expose StashPref to plugins, look up by name</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/geany/geany/pull/3008/files">3 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/geany/geany/pull/3008/files#diff-4316f93b38ec68bc3ee98a1ff6a08db0164f9baad6b3b2403909064202cc8fcc">src/plugindata.h</a>
(2)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/geany/geany/pull/3008/files#diff-0c3db84681c58ad4dc7668d31387972c91347df06ee380375de338f321b5b537">src/stash.c</a>
(52)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/geany/geany/pull/3008/files#diff-0c9dc9d7e85e6ac35bdb7fdc99ece8330a38a45c3c7848617968c6b47aea3fc6">src/stash.h</a>
(36)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/geany/geany/pull/3008.patch'>https://github.com/geany/geany/pull/3008.patch</a></li>
<li><a href='https://github.com/geany/geany/pull/3008.diff'>https://github.com/geany/geany/pull/3008.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3008">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJY63GRSM5H6YJM7HVTUMPZ5JANCNFSM5IHW75EQ">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ7Y336AWH3QC53DNYTUMPZ5JA5CNFSM5IHW75E2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PXYTL4Q.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3008",
"url": "https://github.com/geany/geany/pull/3008",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>