gplugin/gplugin

Ran clang-format

19 months ago, Gary Kramlich
2c943710bb7f
Parents 058ea80e44b2
Children 3cd071170c03
Ran clang-format

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/1782/
--- 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);
- plugin =
- g_hash_table_lookup(manager->plugins_filename_view, filename);
+ plugin = g_hash_table_lookup(
+ manager->plugins_filename_view,
+ filename);
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 @@
}
static void
-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
*****************************************************************************/
static void
-gplugin_source_default_init(G_GNUC_UNUSED GPluginSourceInterface *iface) {
+gplugin_source_default_init(G_GNUC_UNUSED GPluginSourceInterface *iface)
+{
}
/******************************************************************************
@@ -54,15 +55,16 @@
* Since: 0.39.0
*/
gboolean
-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);
+ }
- return FALSE;
+ return FALSE;
}
--- 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 @@
G_BEGIN_DECLS
#define GPLUGIN_TYPE_SOURCE (gplugin_source_get_type())
-G_DECLARE_INTERFACE(GPluginSource, gplugin_source, GPLUGIN, SOURCE,
- GObject)
+G_DECLARE_INTERFACE(GPluginSource, gplugin_source, GPLUGIN, SOURCE, GObject)
struct _GPluginSourceInterface {
- /*< private >*/
- GTypeInterface parent;
+ /*< private >*/
+ GTypeInterface parent;
- /*< public >*/
- gboolean (*scan)(GPluginSource *source);
+ /*< public >*/
+ gboolean (*scan)(GPluginSource *source);
- /*< private >*/
- gpointer reserved[4];
+ /*< private >*/
+ gpointer reserved[4];
};
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(
+ manager,
+ G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user1" G_DIR_SEPARATOR_S
+ ".plugins");
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(
+ manager,
+ 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(
+ manager,
+ 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(
+ manager,
+ G_DIR_SEPARATOR_S "home" G_DIR_SEPARATOR_S "user2" G_DIR_SEPARATOR_S
+ ".plugins");
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(
+ "%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);
/* put /envfoo and /envbar as paths in an environment variable */
g_setenv(pre_env_var_name, pre_paths, TRUE);
@@ -266,16 +280,23 @@
path_pos = 0;
for(l = paths; l != NULL; l = l->next) {
path_pos += 1;
- 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) ==
+ 0) {
+ g_assert_cmpint(2, >=, path_pos);
+ found_paths += 1;
+ } else if(
+ g_strcmp0(l->data, G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S) ==
+ 0) {
g_assert_cmpint(2, >=, path_pos);
found_paths += 1;
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "prebar" G_DIR_SEPARATOR_S) == 0) {
- g_assert_cmpint(2, >=, path_pos);
- found_paths += 1;
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "postfoo" G_DIR_SEPARATOR_S) == 0) {
+ } else if(
+ g_strcmp0(l->data, G_DIR_SEPARATOR_S "postfoo" G_DIR_SEPARATOR_S) ==
+ 0) {
g_assert_cmpint(2, <, path_pos);
found_paths += 1;
- } else if(g_strcmp0(l->data, G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S) == 0) {
+ } else if(
+ g_strcmp0(l->data, G_DIR_SEPARATOR_S "postbar" G_DIR_SEPARATOR_S) ==
+ 0) {
g_assert_cmpint(2, <, path_pos);
found_paths += 1;
}
--- 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,
- SOURCE, GObject)
+G_DECLARE_FINAL_TYPE(
+ TestGPluginSource,
+ test_gplugin_source,
+ TEST_GPLUGIN,
+ SOURCE,
+ GObject)
struct _TestGPluginSource {
GObject parent;
@@ -34,31 +38,40 @@
};
static gboolean
-test_gplugin_source_scan(GPluginSource *source) {
+test_gplugin_source_scan(GPluginSource *source)
+{
TestGPluginSource *test_source = TEST_GPLUGIN_SOURCE(source);
return test_source->scan_result;
}
static void
-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(
+ TestGPluginSource,
+ test_gplugin_source,
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_SOURCE, test_gplugin_source_iface_init))
static void
-test_gplugin_source_init(G_GNUC_UNUSED TestGPluginSource *source) {
+test_gplugin_source_init(G_GNUC_UNUSED TestGPluginSource *source)
+{
}
static void
-test_gplugin_source_class_init(G_GNUC_UNUSED TestGPluginSourceClass *klass) {
+test_gplugin_source_class_init(G_GNUC_UNUSED TestGPluginSourceClass *klass)
+{
}
static GPluginSource *
-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 @@
* Tests
*****************************************************************************/
static void
-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 @@
}
static void
-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));