GNOME Bugzilla – Bug 755383
Add a GError to PeasEngine::load-plugin
Last modified: 2018-05-22 12:14:40 UTC
This would allow the PeasPluginInfo's GError to be supplied by anyone connecting to this signal. This would be useful if the plugin is invalid in some way that the client can determine.
Created attachment 311828 [details] [review] Add PeasEngine::load-plugin-with-error This still needs some tests.
Created attachment 316003 [details] [review] Add PeasEngine::load-plugin-with-error This allows a plugin's GError to be supplied by connecting to this signal. --- This includes a full set of tests. This feature might be a good way for users to check for version information instead of libpeas.
Created attachment 316028 [details] [review] Added peas_plugin_info_set_error() This is an alternative approach that avoids dealing with a new signal and allows applications to set a plugin's error at any time, not just upon loading.
It would be very nice to get this in libpeas, as I have use-case. In RPM we have plugin for inhibit systemd: static rpmRC systemd_inhibit_init(rpmPlugin plugin, rpmts ts) { struct stat st; if (lstat("/run/systemd/system/", &st) == 0) { if (S_ISDIR(st.st_mode)) { return RPMRC_OK; } } return RPMRC_NOTFOUND; } Actually on activate() it would check if directory exists, if not - disable plugin.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libpeas/issues/17.