# HG changeset patch
# Node ID 409e1bada099
# Parent  b8f1ba3e24fc
diff --git a/HACKING.md b/HACKING.md
--- a/HACKING.md
+++ b/HACKING.md
@@ -24,7 +24,7 @@
 ```
 	/* clang-format off */
 	g_object_get(
-		G_OBJECT(info),
+		info,
 		"name", &name,
 		"summary", &summary,
 		NULL);
diff --git a/gplugin-gtk4/gplugin-gtk-plugin-settings-list.c b/gplugin-gtk4/gplugin-gtk-plugin-settings-list.c
--- a/gplugin-gtk4/gplugin-gtk-plugin-settings-list.c
+++ b/gplugin-gtk4/gplugin-gtk-plugin-settings-list.c
@@ -487,7 +487,7 @@
 		return;
 	}
 
-	g_object_get(G_OBJECT(settings), "settings-schema", &schema, NULL);
+	g_object_get(settings, "settings-schema", &schema, NULL);
 	names = g_settings_schema_list_keys(schema);
 	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
diff --git a/gplugin-query/gplugin-query.c b/gplugin-query/gplugin-query.c
--- a/gplugin-query/gplugin-query.c
+++ b/gplugin-query/gplugin-query.c
@@ -139,7 +139,7 @@
 
 		/* clang-format off */
 		g_object_get(
-			G_OBJECT(info),
+			info,
 			"abi-version", &abi_version,
 			"load-on-query", &loq,
 			"name", &name,
@@ -200,7 +200,7 @@
 			printf(MAIN_FORMAT, "unloadable", (unloadable) ? "yes" : "no");
 			printf(MAIN_FORMAT, "loader", G_OBJECT_TYPE_NAME(loader));
 
-			g_object_unref(G_OBJECT(loader));
+			g_object_unref(loader);
 		}
 		if(verbosity > 0)
 			printf(MAIN_FORMAT, "description", STR_OR_EMPTY(description));
@@ -229,7 +229,7 @@
 		g_strfreev(authors);
 		g_free(website);
 		g_strfreev(dependencies);
-		g_object_unref(G_OBJECT(info));
+		g_object_unref(info);
 
 		if(first)
 			first = FALSE;
diff --git a/gplugin/gplugin-file-source.c b/gplugin/gplugin-file-source.c
--- a/gplugin/gplugin-file-source.c
+++ b/gplugin/gplugin-file-source.c
@@ -295,7 +295,7 @@
 					break;
 				}
 
-				g_object_unref(G_OBJECT(plugin));
+				g_object_unref(plugin);
 
 				loader = NULL;
 			}
@@ -327,7 +327,7 @@
 						real_filename);
 
 					g_free(real_filename);
-					g_object_unref(G_OBJECT(info));
+					g_object_unref(info);
 
 					file_source->error_messages = g_list_prepend(
 						file_source->error_messages,
@@ -340,7 +340,7 @@
 				g_hash_table_replace(
 					file_source->plugin_filenames,
 					real_filename,
-					g_object_ref(G_OBJECT(plugin)));
+					g_object_ref(plugin));
 
 				/* Grab the list of plugins with our id and prepend the new
 				 * plugin to it before updating it.
@@ -395,12 +395,12 @@
 					}
 				}
 
-				g_object_unref(G_OBJECT(info));
+				g_object_unref(info);
 
 				/* Since the plugin is now stored in our hash tables we need to
 				 * remove this function's reference to it.
 				 */
-				g_object_unref(G_OBJECT(plugin));
+				g_object_unref(plugin);
 			}
 
 			g_free(filename);
diff --git a/gplugin/gplugin-loader-tests.c b/gplugin/gplugin-loader-tests.c
--- a/gplugin/gplugin-loader-tests.c
+++ b/gplugin/gplugin-loader-tests.c
@@ -73,7 +73,7 @@
 		"description");
 	g_assert_cmpstr(gplugin_plugin_info_get_website(info), ==, "website");
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 
 	g_assert_cmpint(
 		gplugin_plugin_get_state(plugin),
@@ -106,7 +106,7 @@
 		==,
 		GPLUGIN_PLUGIN_STATE_QUERIED);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 static void
@@ -143,7 +143,7 @@
 	g_assert_error(error, GPLUGIN_DOMAIN, 0);
 	g_clear_error(&error);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 static void
@@ -180,7 +180,7 @@
 	g_assert_error(error, GPLUGIN_DOMAIN, 0);
 	g_clear_error(&error);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 static void
@@ -224,7 +224,7 @@
 		==,
 		GPLUGIN_PLUGIN_STATE_QUERIED);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 static void
@@ -269,7 +269,7 @@
 	g_assert_error(error, GPLUGIN_DOMAIN, 0);
 	g_clear_error(&error);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 static void
@@ -295,7 +295,7 @@
 	for(i = 0; r_deps[i]; i++)
 		g_assert_cmpstr(r_deps[i], ==, deps[i]);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 /******************************************************************************
diff --git a/gplugin/gplugin-loader.c b/gplugin/gplugin-loader.c
--- a/gplugin/gplugin-loader.c
+++ b/gplugin/gplugin-loader.c
@@ -237,7 +237,8 @@
 
 		/* Set a few properties. */
 		/* clang-format off */
-		g_object_set(G_OBJECT(plugin),
+		g_object_set(
+			plugin,
 			"error", NULL,
 			"state", GPLUGIN_PLUGIN_STATE_QUERIED,
 			"desired-state", GPLUGIN_PLUGIN_STATE_QUERIED,
@@ -312,7 +313,7 @@
 		g_clear_error(&real_error);
 
 		/* Likewise, make sure the plugin's error is set to NULL. */
-		g_object_set(G_OBJECT(plugin), "error", NULL, NULL);
+		g_object_set(plugin, "error", NULL, NULL);
 
 		gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOADED);
 	}
@@ -367,7 +368,7 @@
 				"Failed to unload plugin : unknown");
 		}
 
-		g_object_set(G_OBJECT(plugin), "error", real_error, NULL);
+		g_object_set(plugin, "error", real_error, NULL);
 
 		/* Set the state after the error is set, because people might connect
 		 * to the notify signal on the state property.
diff --git a/gplugin/gplugin-manager.c b/gplugin/gplugin-manager.c
--- a/gplugin/gplugin-manager.c
+++ b/gplugin/gplugin-manager.c
@@ -105,7 +105,7 @@
 
 	for(l = (GSList *)v; l; l = l->next) {
 		if(l->data && G_IS_OBJECT(l->data))
-			g_object_unref(G_OBJECT(l->data));
+			g_object_unref(l->data);
 	}
 
 	g_slist_free((GSList *)v);
@@ -165,7 +165,7 @@
 				error ? error->message : "unknown");
 			g_clear_error(&error);
 		}
-		g_object_unref(G_OBJECT(loader));
+		g_object_unref(loader);
 	}
 }
 
@@ -529,7 +529,7 @@
 	 * unload.
 	 */
 	if(default_manager != NULL) {
-		g_object_unref(G_OBJECT(default_manager));
+		g_object_unref(default_manager);
 		default_manager = NULL;
 	}
 }
@@ -990,7 +990,7 @@
 		result = gplugin_version_compare(found_version, version);
 
 		/* we need to keep info around until we're done using found_version */
-		g_object_unref(G_OBJECT(info));
+		g_object_unref(info);
 
 		if(result < 0) {
 			keep = (g_strcmp0(op, "<") == 0 || g_strcmp0(op, "<=") == 0);
@@ -1003,8 +1003,7 @@
 		}
 
 		if(keep) {
-			filtered =
-				g_slist_prepend(filtered, g_object_ref(G_OBJECT(plugin)));
+			filtered = g_slist_prepend(filtered, g_object_ref(plugin));
 		}
 	}
 
@@ -1042,8 +1041,7 @@
 			GPluginPlugin *plugin = GPLUGIN_PLUGIN(l->data);
 
 			if(gplugin_plugin_get_state(plugin) == state) {
-				plugins =
-					g_slist_prepend(plugins, g_object_ref(G_OBJECT(plugin)));
+				plugins = g_slist_prepend(plugins, g_object_ref(plugin));
 			}
 		}
 	}
@@ -1077,7 +1075,7 @@
 		return NULL;
 	}
 
-	plugin = GPLUGIN_PLUGIN(g_object_ref(G_OBJECT(plugins_list->data)));
+	plugin = g_object_ref(plugins_list->data);
 
 	g_slist_free_full(plugins_list, g_object_unref);
 
@@ -1188,7 +1186,7 @@
 
 	info = gplugin_plugin_get_info(plugin);
 	dependencies = gplugin_plugin_info_get_dependencies(info);
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 
 	if(dependencies == NULL) {
 		return NULL;
@@ -1312,14 +1310,14 @@
 	}
 
 	if(!gplugin_manager_load_dependencies(manager, plugin, info, &real_error)) {
-		g_object_unref(G_OBJECT(info));
+		g_object_unref(info);
 
 		g_propagate_error(error, real_error);
 
 		return FALSE;
 	}
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 
 	/* now load the actual plugin */
 	loader = gplugin_plugin_get_loader(plugin);
@@ -1337,7 +1335,7 @@
 		g_free(filename);
 
 		gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
-		g_object_unref(G_OBJECT(loader));
+		g_object_unref(loader);
 
 		return FALSE;
 	}
@@ -1345,12 +1343,12 @@
 	g_signal_emit(manager, signals[SIG_LOADING], 0, plugin, &real_error, &ret);
 	if(!ret) {
 		/* Set the plugin's error. */
-		g_object_set(G_OBJECT(plugin), "error", real_error, NULL);
+		g_object_set(plugin, "error", real_error, NULL);
 
 		g_propagate_error(error, real_error);
 
 		gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
-		g_object_unref(G_OBJECT(loader));
+		g_object_unref(loader);
 
 		return ret;
 	}
@@ -1365,7 +1363,7 @@
 		g_propagate_error(error, real_error);
 	}
 
-	g_object_unref(G_OBJECT(loader));
+	g_object_unref(loader);
 
 	return ret;
 }
@@ -1407,7 +1405,7 @@
 			GPLUGIN_DOMAIN,
 			0,
 			_("Plugin loader is not a loader"));
-		g_object_unref(G_OBJECT(loader));
+		g_object_unref(loader);
 
 		return FALSE;
 	}
@@ -1421,12 +1419,12 @@
 		&ret);
 	if(!ret) {
 		/* Set the plugin's error. */
-		g_object_set(G_OBJECT(plugin), "error", real_error, NULL);
+		g_object_set(plugin, "error", real_error, NULL);
 
 		g_propagate_error(error, real_error);
 
 		gplugin_plugin_set_state(plugin, GPLUGIN_PLUGIN_STATE_LOAD_FAILED);
-		g_object_unref(G_OBJECT(loader));
+		g_object_unref(loader);
 
 		return ret;
 	}
@@ -1446,7 +1444,7 @@
 		g_propagate_error(error, real_error);
 	}
 
-	g_object_unref(G_OBJECT(loader));
+	g_object_unref(loader);
 
 	return ret;
 }
diff --git a/gplugin/gplugin-native-loader.c b/gplugin/gplugin-native-loader.c
--- a/gplugin/gplugin-native-loader.c
+++ b/gplugin/gplugin-native-loader.c
@@ -301,7 +301,7 @@
 	g_return_val_if_fail(GPLUGIN_IS_NATIVE_PLUGIN(plugin), FALSE);
 
 	/* get and call the function */
-	g_object_get(G_OBJECT(plugin), "load-func", &func, NULL);
+	g_object_get(plugin, "load-func", &func, NULL);
 	if(!func(plugin, &local_error)) {
 		if(local_error != NULL) {
 			g_propagate_error(error, local_error);
@@ -329,7 +329,7 @@
 	g_return_val_if_fail(GPLUGIN_IS_NATIVE_PLUGIN(plugin), FALSE);
 
 	/* get the function */
-	g_object_get(G_OBJECT(plugin), "unload-func", &func, NULL);
+	g_object_get(plugin, "unload-func", &func, NULL);
 
 	/* validate the function */
 	if(func == NULL) {
diff --git a/gplugin/gplugin-plugin.c b/gplugin/gplugin-plugin.c
--- a/gplugin/gplugin-plugin.c
+++ b/gplugin/gplugin-plugin.c
@@ -199,7 +199,7 @@
 
 	g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
 
-	g_object_get(G_OBJECT(plugin), "filename", &filename, NULL);
+	g_object_get(plugin, "filename", &filename, NULL);
 
 	return filename;
 }
@@ -219,7 +219,7 @@
 
 	g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
 
-	g_object_get(G_OBJECT(plugin), "loader", &loader, NULL);
+	g_object_get(plugin, "loader", &loader, NULL);
 
 	return loader;
 }
@@ -239,7 +239,7 @@
 
 	g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
 
-	g_object_get(G_OBJECT(plugin), "info", &info, NULL);
+	g_object_get(plugin, "info", &info, NULL);
 
 	return info;
 }
@@ -261,7 +261,7 @@
 		GPLUGIN_IS_PLUGIN(plugin),
 		GPLUGIN_PLUGIN_STATE_UNKNOWN);
 
-	g_object_get(G_OBJECT(plugin), "state", &state, NULL);
+	g_object_get(plugin, "state", &state, NULL);
 
 	return state;
 }
@@ -283,7 +283,7 @@
 
 	oldstate = gplugin_plugin_get_state(plugin);
 
-	g_object_set(G_OBJECT(plugin), "state", state, NULL);
+	g_object_set(plugin, "state", state, NULL);
 
 	if(gplugin_get_flags() & GPLUGIN_CORE_FLAGS_LOG_PLUGIN_STATE_CHANGES) {
 		GPluginPluginInfo *info = gplugin_plugin_get_info(plugin);
@@ -329,7 +329,7 @@
 		GPLUGIN_IS_PLUGIN(plugin),
 		GPLUGIN_PLUGIN_STATE_UNKNOWN);
 
-	g_object_get(G_OBJECT(plugin), "desired-state", &desired_state, NULL);
+	g_object_get(plugin, "desired-state", &desired_state, NULL);
 
 	return desired_state;
 }
@@ -351,7 +351,7 @@
 {
 	g_return_if_fail(GPLUGIN_IS_PLUGIN(plugin));
 
-	g_object_set(G_OBJECT(plugin), "desired-state", state, NULL);
+	g_object_set(plugin, "desired-state", state, NULL);
 }
 
 /**
@@ -371,7 +371,7 @@
 
 	g_return_val_if_fail(GPLUGIN_IS_PLUGIN(plugin), NULL);
 
-	g_object_get(G_OBJECT(plugin), "error", &error, NULL);
+	g_object_get(plugin, "error", &error, NULL);
 
 	return error;
 }
diff --git a/gplugin/tests/test-id-normalize.c b/gplugin/tests/test-id-normalize.c
--- a/gplugin/tests/test-id-normalize.c
+++ b/gplugin/tests/test-id-normalize.c
@@ -30,7 +30,7 @@
 
 	info = gplugin_plugin_info_new(input, 0, NULL);
 	normalized = gplugin_plugin_info_get_id_normalized(info);
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 
 	g_assert_cmpstr(normalized, ==, expected);
 
diff --git a/gplugin/tests/test-loader.c b/gplugin/tests/test-loader.c
--- a/gplugin/tests/test-loader.c
+++ b/gplugin/tests/test-loader.c
@@ -278,7 +278,7 @@
 
 	g_assert_cmpstr("test-loader", ==, gplugin_loader_get_id(loader));
 
-	g_object_get(G_OBJECT(loader), "id", &id, NULL);
+	g_object_get(loader, "id", &id, NULL);
 	g_assert_cmpstr("test-loader", ==, id);
 	g_clear_pointer(&id, g_free);
 
diff --git a/gplugin/tests/test-plugin-info.c b/gplugin/tests/test-plugin-info.c
--- a/gplugin/tests/test-plugin-info.c
+++ b/gplugin/tests/test-plugin-info.c
@@ -139,7 +139,7 @@
 
 	/* clang-format off */
 	g_object_get(
-		G_OBJECT(info),
+		info,
 		"id", &id,
 		"provides", &provides,
 		"priority", &priority,
@@ -192,7 +192,7 @@
 		(TestStringVFunc)gplugin_plugin_info_get_dependencies,
 		info);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -208,7 +208,7 @@
 
 	/* clang-format off */
 	g_object_get(
-		G_OBJECT(info),
+		info,
 		"id", &id,
 		"abi-version", &abi_version,
 		NULL);
@@ -217,7 +217,7 @@
 	test_string(id, "empty");
 	test_uint(abi_version, 1);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -259,7 +259,7 @@
 
 	/* clang-format off */
 	g_object_get(
-		G_OBJECT(info),
+		info,
 		"id", &id,
 		"abi_version", &abi_version,
 		"internal", &internal,
@@ -304,7 +304,7 @@
 		(TestStringVFunc)gplugin_plugin_info_get_dependencies,
 		info);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -328,7 +328,7 @@
 	for(i = 0; authors[i]; i++)
 		g_assert_cmpstr(authors[i], ==, g_authors[i]);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -352,7 +352,7 @@
 	for(i = 0; authors[i]; i++)
 		g_assert_cmpstr(authors[i], ==, g_authors[i]);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -376,7 +376,7 @@
 	for(i = 0; dependencies[i]; i++)
 		g_assert_cmpstr(dependencies[i], ==, g_dependencies[i]);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 static void
@@ -400,7 +400,7 @@
 	for(i = 0; dependencies[i]; i++)
 		g_assert_cmpstr(dependencies[i], ==, g_dependencies[i]);
 
-	g_object_unref(G_OBJECT(info));
+	g_object_unref(info);
 }
 
 /******************************************************************************
diff --git a/gplugin/tests/test-versioned-dependencies.c b/gplugin/tests/test-versioned-dependencies.c
--- a/gplugin/tests/test-versioned-dependencies.c
+++ b/gplugin/tests/test-versioned-dependencies.c
@@ -34,7 +34,7 @@
 		==,
 		GPLUGIN_PLUGIN_STATE_LOADED);
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 }
 
 /******************************************************************************
@@ -80,7 +80,7 @@
 	_test_plugin_loaded(plugin, "gplugin/baz");
 	_test_plugin_loaded(plugin, "gplugin/fez");
 
-	g_object_unref(G_OBJECT(plugin));
+	g_object_unref(plugin);
 
 	gplugin_uninit();
 }
diff --git a/python3/gplugin-python3-loader.c b/python3/gplugin-python3-loader.c
--- a/python3/gplugin-python3-loader.c
+++ b/python3/gplugin-python3-loader.c
@@ -211,7 +211,7 @@
 	PyObject *load = NULL, *pyplugin = NULL, *result = NULL;
 	gboolean ret = FALSE;
 
-	g_object_get(G_OBJECT(plugin), "load-func", &load, NULL);
+	g_object_get(plugin, "load-func", &load, NULL);
 
 	pyplugin = pygobject_new(G_OBJECT(plugin));
 
@@ -253,7 +253,7 @@
 	PyObject *pyplugin = NULL, *pyshutdown = NULL;
 	gboolean ret = FALSE;
 
-	g_object_get(G_OBJECT(plugin), "unload-func", &unload, NULL);
+	g_object_get(plugin, "unload-func", &unload, NULL);
 
 	pyplugin = pygobject_new(G_OBJECT(plugin));
 	pyshutdown = PyBool_FromLong(shutdown);
