--- a/gplugin/gplugin-manager.c Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/gplugin-manager.c Sat Sep 17 23:34:03 2022 -0500
@@ -965,8 +965,9 @@
/* Build the path and see if we need to probe it! */
filename = g_build_filename(path, e->filename, NULL);
- g_hash_table_lookup(manager->plugins_filename_view, filename);
+ plugin = g_hash_table_lookup( + manager->plugins_filename_view, if(plugin && GPLUGIN_IS_PLUGIN(plugin)) {
GPluginPluginState state = gplugin_plugin_get_state(plugin);
--- a/gplugin/gplugin-plugin-info.c Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/gplugin-plugin-info.c Sat Sep 17 23:34:03 2022 -0500
@@ -207,8 +207,9 @@
-gplugin_plugin_info_set_settings_schema(GPluginPluginInfo *info,
- const gchar *settings_schema)
+gplugin_plugin_info_set_settings_schema( + GPluginPluginInfo *info, + const gchar *settings_schema) GPluginPluginInfoPrivate *priv =
gplugin_plugin_info_get_instance_private(info);
--- a/gplugin/gplugin-source.c Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/gplugin-source.c Sat Sep 17 23:34:03 2022 -0500
@@ -31,7 +31,8 @@
* GInterface implementation
*****************************************************************************/
-gplugin_source_default_init(G_GNUC_UNUSED GPluginSourceInterface *iface) {
+gplugin_source_default_init(G_GNUC_UNUSED GPluginSourceInterface *iface) /******************************************************************************
@@ -54,15 +55,16 @@
-gplugin_source_scan(GPluginSource *source) {
- GPluginSourceInterface *iface = NULL;
+gplugin_source_scan(GPluginSource *source) + GPluginSourceInterface *iface = NULL; - g_return_val_if_fail(GPLUGIN_IS_SOURCE(source), FALSE);
+ g_return_val_if_fail(GPLUGIN_IS_SOURCE(source), FALSE); - iface = GPLUGIN_SOURCE_GET_IFACE(source);
- if(iface && iface->scan) {
- return iface->scan(source);
+ iface = GPLUGIN_SOURCE_GET_IFACE(source); + if(iface && iface->scan) { + return iface->scan(source);
--- a/gplugin/gplugin-source.h Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/gplugin-source.h Sat Sep 17 23:34:03 2022 -0500
@@ -24,18 +24,17 @@
#define GPLUGIN_TYPE_SOURCE (gplugin_source_get_type())
-G_DECLARE_INTERFACE(GPluginSource, gplugin_source, GPLUGIN, SOURCE,
+G_DECLARE_INTERFACE(GPluginSource, gplugin_source, GPLUGIN, SOURCE, GObject) struct _GPluginSourceInterface {
- gboolean (*scan)(GPluginSource *source);
+ gboolean (*scan)(GPluginSource *source);
gboolean gplugin_source_scan(GPluginSource *source);
--- a/gplugin/tests/test-plugin-manager-paths.c Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/tests/test-plugin-manager-paths.c Sat Sep 17 23:34:03 2022 -0500
@@ -123,16 +123,28 @@
test_path_count(manager, 0);
- gplugin_manager_append_path(manager, G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user1" G_DIR_SEPARATOR_S ".plugins");
+ gplugin_manager_append_path( + G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user1" G_DIR_SEPARATOR_S test_path_count(manager, 1);
- gplugin_manager_append_path(manager, G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user2" G_DIR_SEPARATOR_S ".plugins" G_DIR_SEPARATOR_S "");
+ gplugin_manager_append_path( + G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user2" G_DIR_SEPARATOR_S + ".plugins" G_DIR_SEPARATOR_S ""); test_path_count(manager, 2);
- gplugin_manager_remove_path(manager, G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user1" G_DIR_SEPARATOR_S ".plugins" G_DIR_SEPARATOR_S "");
+ gplugin_manager_remove_path( + G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user1" G_DIR_SEPARATOR_S + ".plugins" G_DIR_SEPARATOR_S ""); test_path_count(manager, 1);
- gplugin_manager_remove_path(manager, G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user2" G_DIR_SEPARATOR_S ".plugins");
+ gplugin_manager_remove_path( + G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user2" G_DIR_SEPARATOR_S test_path_count(manager, 0);
@@ -239,14 +251,16 @@
path_count = g_list_length(paths);
/* build contents of environment vars */
- pre_paths = g_strdup_printf("%s%s%s",
- G_DIR_SEPARATOR_S "prefoo",
- G_SEARCHPATH_SEPARATOR_S,
- G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S);
- post_paths = g_strdup_printf("%s%s%s",
- G_DIR_SEPARATOR_S "postfoo",
- G_SEARCHPATH_SEPARATOR_S,
- G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S);
+ pre_paths = g_strdup_printf( + G_DIR_SEPARATOR_S "prefoo", + G_SEARCHPATH_SEPARATOR_S, + G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S); + post_paths = g_strdup_printf( + G_DIR_SEPARATOR_S "postfoo", + G_SEARCHPATH_SEPARATOR_S, + G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S); /* put /envfoo and /envbar as paths in an environment variable */
g_setenv(pre_env_var_name, pre_paths, TRUE);
@@ -266,16 +280,23 @@
for(l = paths; l != NULL; l = l->next) {
- if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "prefoo" G_DIR_SEPARATOR_S) == 0) {
+ if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "prefoo" G_DIR_SEPARATOR_S) == + g_assert_cmpint(2, >=, path_pos); + g_strcmp0(l->data, G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S) == g_assert_cmpint(2, >=, path_pos);
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S) == 0) {
- g_assert_cmpint(2, >=, path_pos);
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "postfoo" G_DIR_SEPARATOR_S) == 0) {
+ g_strcmp0(l->data, G_DIR_SEPARATOR_S "postfoo" G_DIR_SEPARATOR_S) == g_assert_cmpint(2, <, path_pos);
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S) == 0) {
+ g_strcmp0(l->data, G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S) == g_assert_cmpint(2, <, path_pos);
--- a/gplugin/tests/test-source.c Sat Sep 17 21:55:18 2022 -0500
+++ b/gplugin/tests/test-source.c Sat Sep 17 23:34:03 2022 -0500
@@ -24,8 +24,12 @@
/******************************************************************************
* TestSource Implementation
*****************************************************************************/
-G_DECLARE_FINAL_TYPE(TestGPluginSource, test_gplugin_source, TEST_GPLUGIN,
struct _TestGPluginSource {
@@ -34,31 +38,40 @@
-test_gplugin_source_scan(GPluginSource *source) {
+test_gplugin_source_scan(GPluginSource *source) TestGPluginSource *test_source = TEST_GPLUGIN_SOURCE(source);
return test_source->scan_result;
-test_gplugin_source_iface_init(GPluginSourceInterface *iface) {
+test_gplugin_source_iface_init(GPluginSourceInterface *iface) iface->scan = test_gplugin_source_scan;
-G_DEFINE_TYPE_WITH_CODE(TestGPluginSource, test_gplugin_source, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_SOURCE, test_gplugin_source_iface_init))
+G_DEFINE_TYPE_WITH_CODE( + G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_SOURCE, test_gplugin_source_iface_init)) -test_gplugin_source_init(G_GNUC_UNUSED TestGPluginSource *source) {
+test_gplugin_source_init(G_GNUC_UNUSED TestGPluginSource *source) -test_gplugin_source_class_init(G_GNUC_UNUSED TestGPluginSourceClass *klass) {
+test_gplugin_source_class_init(G_GNUC_UNUSED TestGPluginSourceClass *klass) -test_gplugin_source_new(gboolean scan_result) {
- TestGPluginSource *source = g_object_new(test_gplugin_source_get_type(), NULL);
+test_gplugin_source_new(gboolean scan_result) + TestGPluginSource *source = + g_object_new(test_gplugin_source_get_type(), NULL); source->scan_result = scan_result;
@@ -69,7 +82,8 @@
*****************************************************************************/
-test_gplugin_source_scan_false(void) {
+test_gplugin_source_scan_false(void) GPluginSource *source = test_gplugin_source_new(FALSE);
g_assert_false(gplugin_source_scan(source));
@@ -78,7 +92,8 @@
-test_gplugin_source_scan_true(void) {
+test_gplugin_source_scan_true(void) GPluginSource *source = test_gplugin_source_new(TRUE);
g_assert_true(gplugin_source_scan(source));