[Github-comments] [geany/geany] Make build_get/set_(current_)menu_item functions symmetrical (#1225)

elextr notifications at xxxxx
Mon Sep 12 01:27:45 UTC 2016


Looks unnecessarily complex.  Shouldn't need all the changes to the internals.

Get any command is a good idea, yes.  To do that I suggest you modify `build_get_menu_item()` which is not in the API and not used in Geany.  Just add the field parameter, and the switch statement from `build_get_current_menu_item()` then add API_SYMBOL and fix the doxygen and there ya go, local changes only.

I'm not sure about `set_current`.  Sure its symmetric, but its modifying a menu item from an unknown source, which could include the defaults.  I don't think thats all that sensible, but I'm open to discussion if you can give a reasonable use-case, but at the moment I think the plugin should know what its modifying.

And don't forget you have to put the original values back in the plugin shutdown code, its hard to do that when you don't know what was modified.

-- 
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/1225#issuecomment-246219258
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160911/bcd9f3f3/attachment.html>


More information about the Github-comments mailing list