[libpeas] Bump glib version to 2.28
- From: Garrett Regier <gregier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Bump glib version to 2.28
- Date: Thu, 8 Dec 2011 16:23:25 +0000 (UTC)
commit 974037f20e1d299a4add2e425ee8f7a1bf466b59
Author: Garrett Regier <garrettregier gmail com>
Date: Thu Dec 8 08:09:56 2011 -0800
Bump glib version to 2.28
configure.ac | 5 ++---
libpeas-gtk/peas-gtk-disable-plugins-dialog.c | 3 +--
libpeas-gtk/peas-gtk-plugin-manager-store.c | 10 ++--------
libpeas-gtk/peas-gtk-plugin-manager-view.c | 17 ++++-------------
libpeas-gtk/peas-gtk-plugin-manager.c | 12 +++---------
libpeas/peas-engine.c | 5 ++---
libpeas/peas-extension-set.c | 17 +++++++++--------
libpeas/peas-extension-wrapper.c | 3 +--
libpeas/peas-object-module.c | 2 +-
libpeas/peas-plugin-info.c | 16 ++++------------
peas-demo/peas-demo-window.c | 6 +-----
11 files changed, 30 insertions(+), 66 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4bea3ca..b41e710 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,13 +84,12 @@ dnl ================================================================
PKG_PROG_PKG_CONFIG
-GLIB_REQUIRED=2.18.0
-GOBJECT_REQUIRED=2.23.6
+GLIB_REQUIRED=2.28.0
INTROSPECTION_REQUIRED=0.10.1
PKG_CHECK_MODULES(PEAS, [
glib-2.0 >= $GLIB_REQUIRED
- gobject-2.0 >= $GOBJECT_REQUIRED
+ gobject-2.0 >= $GLIB_REQUIRED
gmodule-2.0 >= $GLIB_REQUIRED
gobject-introspection-1.0 >= $INTROSPECTION_REQUIRED
])
diff --git a/libpeas-gtk/peas-gtk-disable-plugins-dialog.c b/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
index 525bdff..27aed38 100644
--- a/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
+++ b/libpeas-gtk/peas-gtk-disable-plugins-dialog.c
@@ -234,8 +234,7 @@ peas_gtk_disable_plugins_dialog_constructed (GObject *object)
else
build_multiple_dependant_plugins (dialog);
- if (G_OBJECT_CLASS (peas_gtk_disable_plugins_dialog_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (peas_gtk_disable_plugins_dialog_parent_class)->constructed (object);
+ G_OBJECT_CLASS (peas_gtk_disable_plugins_dialog_parent_class)->constructed (object);
}
static void
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-store.c b/libpeas-gtk/peas-gtk-plugin-manager-store.c
index 8a8d731..cd28c91 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-store.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-store.c
@@ -42,10 +42,7 @@ static const GType ColumnTypes[] = {
G_TYPE_POINTER /* PeasPluginInfo */
};
-/* G_STATIC_ASSERT is in glib >= 2.20 and we only depend on 2.18.0 */
-#ifdef G_STATIC_ASSERT
G_STATIC_ASSERT (G_N_ELEMENTS (ColumnTypes) == PEAS_GTK_PLUGIN_MANAGER_STORE_N_COLUMNS);
-#endif
struct _PeasGtkPluginManagerStorePrivate {
PeasEngine *engine;
@@ -259,8 +256,7 @@ peas_gtk_plugin_manager_store_constructed (GObject *object)
peas_gtk_plugin_manager_store_reload (store);
- if (G_OBJECT_CLASS (peas_gtk_plugin_manager_store_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (peas_gtk_plugin_manager_store_parent_class)->constructed (object);
+ G_OBJECT_CLASS (peas_gtk_plugin_manager_store_parent_class)->constructed (object);
}
static void
@@ -273,9 +269,7 @@ peas_gtk_plugin_manager_store_dispose (GObject *object)
g_signal_handlers_disconnect_by_func (store->priv->engine,
plugin_loaded_toggled_cb,
store);
-
- g_object_unref (store->priv->engine);
- store->priv->engine = NULL;
+ g_clear_object (&store->priv->engine);
}
G_OBJECT_CLASS (peas_gtk_plugin_manager_store_parent_class)->dispose (object);
diff --git a/libpeas-gtk/peas-gtk-plugin-manager-view.c b/libpeas-gtk/peas-gtk-plugin-manager-view.c
index ce393a4..f1e8794 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager-view.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager-view.c
@@ -713,8 +713,7 @@ peas_gtk_plugin_manager_view_constructed (GObject *object)
G_CALLBACK (plugin_list_changed_cb),
view);
- if (G_OBJECT_CLASS (peas_gtk_plugin_manager_view_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (peas_gtk_plugin_manager_view_parent_class)->constructed (object);
+ G_OBJECT_CLASS (peas_gtk_plugin_manager_view_parent_class)->constructed (object);
}
static void
@@ -728,22 +727,16 @@ peas_gtk_plugin_manager_view_dispose (GObject *object)
view->priv->popup_menu = NULL;
}
- if (view->priv->store != NULL)
- {
- g_object_unref (view->priv->store);
- view->priv->store = NULL;
- }
-
if (view->priv->engine != NULL)
{
g_signal_handlers_disconnect_by_func (view->priv->engine,
plugin_list_changed_cb,
view);
-
- g_object_unref (view->priv->engine);
- view->priv->engine = NULL;
+ g_clear_object (&view->priv->engine);
}
+ g_clear_object (&view->priv->store);
+
G_OBJECT_CLASS (peas_gtk_plugin_manager_view_parent_class)->dispose (object);
}
@@ -794,9 +787,7 @@ peas_gtk_plugin_manager_view_class_init (PeasGtkPluginManagerViewClass *klass)
"show-builtin",
"If builtin plugins should be shown",
FALSE,
-#if GLIB_CHECK_VERSION (2, 26, 0)
G_PARAM_DEPRECATED |
-#endif
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
diff --git a/libpeas-gtk/peas-gtk-plugin-manager.c b/libpeas-gtk/peas-gtk-plugin-manager.c
index 97f5b7f..4a3709b 100644
--- a/libpeas-gtk/peas-gtk-plugin-manager.c
+++ b/libpeas-gtk/peas-gtk-plugin-manager.c
@@ -457,10 +457,7 @@ peas_gtk_plugin_manager_constructed (GObject *object)
g_warn_if_fail (engine == pm->priv->engine);
if (engine != pm->priv->engine)
- {
- g_object_unref (pm->priv->view);
- pm->priv->view = NULL;
- }
+ g_clear_object (&pm->priv->view);
g_object_unref (engine);
}
@@ -498,8 +495,7 @@ peas_gtk_plugin_manager_constructed (GObject *object)
/* Update the button sensitivity */
selection_changed_cb (pm);
- if (G_OBJECT_CLASS (peas_gtk_plugin_manager_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (peas_gtk_plugin_manager_parent_class)->constructed (object);
+ G_OBJECT_CLASS (peas_gtk_plugin_manager_parent_class)->constructed (object);
}
static void
@@ -512,9 +508,7 @@ peas_gtk_plugin_manager_dispose (GObject *object)
g_signal_handlers_disconnect_by_func (pm->priv->engine,
plugin_loaded_toggled_cb,
pm);
-
- g_object_unref (pm->priv->engine);
- pm->priv->engine = NULL;
+ g_clear_object (&pm->priv->engine);
}
G_OBJECT_CLASS (peas_gtk_plugin_manager_parent_class)->dispose (object);
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index 7b57d56..8125d9c 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -431,8 +431,8 @@ peas_engine_finalize (GObject *object)
GList *item;
/* free the infos */
- for (item = engine->priv->plugin_list; item; item = item->next)
- _peas_plugin_info_unref (PEAS_PLUGIN_INFO (item->data));
+ g_list_free_full (engine->priv->plugin_list,
+ (GDestroyNotify) _peas_plugin_info_unref);
/* free the search path list */
for (item = engine->priv->search_paths; item; item = item->next)
@@ -444,7 +444,6 @@ peas_engine_finalize (GObject *object)
g_slice_free (SearchPath, sp);
}
- g_list_free (engine->priv->plugin_list);
g_list_free (engine->priv->search_paths);
G_OBJECT_CLASS (peas_engine_parent_class)->finalize (object);
diff --git a/libpeas/peas-extension-set.c b/libpeas/peas-extension-set.c
index 8f3f9fb..be4da89 100644
--- a/libpeas/peas-extension-set.c
+++ b/libpeas/peas-extension-set.c
@@ -276,6 +276,8 @@ peas_extension_set_constructed (GObject *object)
g_signal_connect_data (set->priv->engine, "unload-plugin",
G_CALLBACK (remove_extension), set,
NULL, G_CONNECT_SWAPPED);
+
+ G_OBJECT_CLASS (peas_extension_set_parent_class)->constructed (object);
}
static void
@@ -296,10 +298,13 @@ peas_extension_set_dispose (GObject *object)
set->priv->unload_handler_id = 0;
}
- for (l = set->priv->extensions; l;)
+ if (set->priv->extensions != NULL)
{
- remove_extension_item (set, (ExtensionItem *) l->data);
- l = g_list_delete_link (l, l);
+ for (l = set->priv->extensions; l != NULL; l = l->next)
+ remove_extension_item (set, (ExtensionItem *) l->data);
+
+ g_list_free (set->priv->extensions);
+ set->priv->extensions = NULL;
}
if (set->priv->parameters != NULL)
@@ -311,11 +316,7 @@ peas_extension_set_dispose (GObject *object)
set->priv->parameters = NULL;
}
- if (set->priv->engine != NULL)
- {
- g_object_unref (set->priv->engine);
- set->priv->engine = NULL;
- }
+ g_clear_object (&set->priv->engine);
}
static gboolean
diff --git a/libpeas/peas-extension-wrapper.c b/libpeas/peas-extension-wrapper.c
index 6021a85..5f607e2 100644
--- a/libpeas/peas-extension-wrapper.c
+++ b/libpeas/peas-extension-wrapper.c
@@ -40,8 +40,7 @@ peas_extension_wrapper_constructed (GObject *object)
exten->constructed = TRUE;
- if (G_OBJECT_CLASS (peas_extension_wrapper_parent_class)->constructed != NULL)
- G_OBJECT_CLASS (peas_extension_wrapper_parent_class)->constructed (object);
+ G_OBJECT_CLASS (peas_extension_wrapper_parent_class)->constructed (object);
}
static void
diff --git a/libpeas/peas-object-module.c b/libpeas/peas-object-module.c
index a294b9d..c24f75b 100644
--- a/libpeas/peas-object-module.c
+++ b/libpeas/peas-object-module.c
@@ -168,7 +168,7 @@ peas_object_module_finalize (GObject *object)
if (impls[i].destroy_func != NULL)
impls[i].destroy_func (impls[i].user_data);
- g_array_free (module->priv->implementations, TRUE);
+ g_array_unref (module->priv->implementations);
G_OBJECT_CLASS (peas_object_module_parent_class)->finalize (object);
}
diff --git a/libpeas/peas-plugin-info.c b/libpeas/peas-plugin-info.c
index 0dcff4e..1eef90a 100644
--- a/libpeas/peas-plugin-info.c
+++ b/libpeas/peas-plugin-info.c
@@ -60,6 +60,10 @@
* ]|
**/
+G_DEFINE_BOXED_TYPE (PeasPluginInfo, peas_plugin_info,
+ _peas_plugin_info_ref,
+ _peas_plugin_info_unref)
+
PeasPluginInfo *
_peas_plugin_info_ref (PeasPluginInfo *info)
{
@@ -92,18 +96,6 @@ _peas_plugin_info_unref (PeasPluginInfo *info)
g_free (info);
}
-GType
-peas_plugin_info_get_type (void)
-{
- static GType the_type = 0;
-
- if (G_UNLIKELY (!the_type))
- the_type = g_boxed_type_register_static (g_intern_static_string ("PeasPluginInfo"),
- (GBoxedCopyFunc) _peas_plugin_info_ref,
- (GBoxedFreeFunc) _peas_plugin_info_unref);
-
- return the_type;
-}
GQuark
peas_plugin_info_error_quark (void)
diff --git a/peas-demo/peas-demo-window.c b/peas-demo/peas-demo-window.c
index 30d72c9..27777d3 100644
--- a/peas-demo/peas-demo-window.c
+++ b/peas-demo/peas-demo-window.c
@@ -77,11 +77,7 @@ demo_window_dispose (GObject *object)
{
DemoWindow *dw = DEMO_WINDOW (object);
- if (dw->exten_set != NULL)
- {
- g_object_unref (dw->exten_set);
- dw->exten_set = NULL;
- }
+ g_clear_object (&dw->exten_set);
G_OBJECT_CLASS (demo_window_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]