plugins: change return codes of geany_load_module() and GeanyPluginFuncs::init
commit43c58e0fdde9e79fb902925a5854cde81db8db20
authorThomas Martitz <kugel@rockbox.org>
Sun, 23 Aug 2015 13:23:31 +0000 (23 15:23 +0200)
committerThomas Martitz <kugel@rockbox.org>
Sun, 23 Aug 2015 18:01:41 +0000 (23 20:01 +0200)
tree8e5c02014d54d2952e28255a23e2016894d0671d
parent8241278472ceb23e7341a946c758bc8a30ef0fa8
plugins: change return codes of geany_load_module() and GeanyPluginFuncs::init

- The return value from geany_load_module is removed (void). It was ignored
  anyway and we have to check separately whether the plugin loaded OK or not
  anyway. If the plugin specific code fails it should simply not call
  geany_plugin_register() (which it should only call iff all other conditions
  are good).

- GeanyPluginFuncs::init() now returns a bool to allow failing initialization.
  Some plugins might want to defer work to their init() (i.e. only do
  it when the plugin was activated by the user), and some of that work can
  possibly fail (e.g. GtkBuilder fails to load .xml).

Note that the GUI integration of the latter is less than ideal but this kind
of GUI/policy work is out of scope for this patch set. Therefore a plugin
failing to init is simply removed from the PM dialog as if it became
incompatible. However, as the code that generates the list does not call init
they will show up again if the PM dialog is re-opened.
plugins/demoplugin.c
src/plugindata.h
src/plugins.c