gplugin/gplugin

Clean up some stuff found in review.
feature/plugin-errors
2020-04-19, Gary Kramlich
8da7832f7cc2
Parents 16a5cfcf0961
Children 3b91b4860a7b
Clean up some stuff found in review.
--- a/gplugin-gtk/gplugin-gtk-plugin-info.c Sat Apr 18 04:13:27 2020 -0500
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.c Sun Apr 19 04:56:26 2020 -0500
@@ -195,6 +195,7 @@
g_free(version);
g_free(website);
g_free(loader);
+ g_clear_error(&error);
/* set the authors */
if(authors) {
@@ -416,7 +417,11 @@
if(g_set_object(&info->plugin, plugin)) {
_gplugin_gtk_plugin_info_refresh(info);
- /* Connect a signal to refresh when the plugin's state changes. */
+ /* Connect a signal to refresh when the plugin's state changes. We
+ * can't use g_signal_connect_object because the plugin object never
+ * gets destroyed, as the manager and the loader both keep a reference
+ * to it which means we just have to manage the callback ourselves.
+ */
info->signal_id = g_signal_connect(
G_OBJECT(plugin),
"notify::state",
--- a/gplugin-gtk/gplugin-gtk-store.c Sat Apr 18 04:13:27 2020 -0500
+++ b/gplugin-gtk/gplugin-gtk-store.c Sun Apr 19 04:56:26 2020 -0500
@@ -34,7 +34,7 @@
/**
* GPluginGtkStoreColumns:
- * @GPLUGIN_GTK_STORE_ENABLED_COLUMN: The disabled column. This used when a
+ * @GPLUGIN_GTK_STORE_ENABLED_COLUMN: The disabled column. This is used when a
* plugin is in a state that can't be
* changed. So the row should be disabled.
* @GPLUGIN_GTK_STORE_LOADED_COLUMN: The loaded column.
--- a/gplugin/gplugin-manager.c Sat Apr 18 04:13:27 2020 -0500
+++ b/gplugin/gplugin-manager.c Sun Apr 19 04:56:26 2020 -0500
@@ -975,7 +975,7 @@
*/
g_clear_error(&error);
- /* Like, make sure the plugin's error is set to NULL. */
+ /* Likewise, make sure the plugin's error is set to NULL. */
g_object_set(G_OBJECT(plugin), "error", NULL, NULL);
gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOADED);