> The separate API allows to do the registration in the plugin's init(), and have the file extensions deppend on plugin configuration. Also a API-wise separattion to geany_plugin_register() is needed to allow for nested proxies.
I get that, my point was that I would find the API less odd if one filled a specific structure, rather than one already used for something else.
e.g.
```C
Proxy proxy = {
.extensions = { "so", NULL },
.load = my_load,
.probe = my_probe,
.unload = my_unload
};
geany_plugin_register_proxy(plugin, &proxy);
```
or alike. But I know it has drawbacks, like binary incompatibility if the struct expands (solvable by versioning the struct, but a bit annoying), etc.
I don't really mind though, as it does has a few advantages (at least being simple and easy to expand), and that API won't be used by everyone so any oddness won't affect too many people.
> A proxy can be a proxy for many types. the only limitation is that only one set of ProxyFuncs is supported per proxy. But this limitation is not a problem, since the proxies can do their own dispatching. For geany it simplifies storing the pointers (avoids introducing a list of vtables, etc)
Okay, so maybe that part is not really relevant indeed.
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629#issuecomment-143058333
> PLUGIN_COLUMN_CHECK, state,
> PLUGIN_COLUMN_PLUGIN, p, -1);
>
> /* set again the sensitiveness of the configure and help buttons */
> pm_update_buttons(p);
> +
> + /* Depending on the state disable the checkbox for the proxy of this plugin, and
> + * only re-enable if the proxy is not used by any other plugin */
> + if (p->proxy != &builtin_so_proxy_plugin)
> + {
> + GtkTreeIter parent;
> + gboolean can_uncheck;
> + GtkTreePath *store_path = gtk_tree_model_filter_convert_path_to_child_path(
> + GTK_TREE_MODEL_FILTER(model), path);
hum nevermind my remark, I assumed (incorrectly) the row was removed and re-added, which could change the layout of the data store. But actually it's not, the existing one is only updated, so it's totally fine.
sorry for the noise
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629/files#r40374194
> + GList *list;
> +
> + gtk_tree_store_clear(store);
> + list = g_list_first(plugin_list);
> + if (list == NULL)
> + {
> + gtk_tree_store_append(store, &iter, NULL);
> + gtk_tree_store_set(store, &iter, PLUGIN_COLUMN_CHECK, FALSE,
> + PLUGIN_COLUMN_PLUGIN, NULL, -1);
> + }
> + else
> + {
> + Plugin *p;
> + for (; list != NULL; list = list->next)
> + {
> + p = list->data;
(OK I see it was like this in the original code)
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629/files#r40365476
> PLUGIN_COLUMN_CHECK, state,
> PLUGIN_COLUMN_PLUGIN, p, -1);
>
> /* set again the sensitiveness of the configure and help buttons */
> pm_update_buttons(p);
> +
> + /* Depending on the state disable the checkbox for the proxy of this plugin, and
> + * only re-enable if the proxy is not used by any other plugin */
> + if (p->proxy != &builtin_so_proxy_plugin)
> + {
> + GtkTreeIter parent;
> + gboolean can_uncheck;
> + GtkTreePath *store_path = gtk_tree_model_filter_convert_path_to_child_path(
> + GTK_TREE_MODEL_FILTER(model), path);
The rest of the function assumes the same. I think it's nearly impossible that it changed, since the tree was just created when opening the PM dialog (i.e. it's not cached from the startup).
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629/files#r40365367
> PLUGIN_COLUMN_CHECK, state,
> PLUGIN_COLUMN_PLUGIN, p, -1);
>
> /* set again the sensitiveness of the configure and help buttons */
> pm_update_buttons(p);
> +
> + /* Depending on the state disable the checkbox for the proxy of this plugin, and
> + * only re-enable if the proxy is not used by any other plugin */
> + if (p->proxy != &builtin_so_proxy_plugin)
> + {
> + GtkTreeIter parent;
> + gboolean can_uncheck;
> + GtkTreePath *store_path = gtk_tree_model_filter_convert_path_to_child_path(
> + GTK_TREE_MODEL_FILTER(model), path);
are we sure the path is still the same? I could imagine not if e.g. the plugin changed name upon reload maybe
---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/629/files#r40364858