From 3b56510b67c75377cc394082cced58b5476421bd Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Sun, 15 Dec 2019 23:37:37 +0100 Subject: [PATCH] Add autoptr cleanup support for thunarx (Bug #16257) Co-authored-by: Alexander Schwinn --- configure.ac.in | 8 ++++---- thunarx/thunarx-file-info.h | 2 ++ thunarx/thunarx-menu-provider.h | 2 ++ thunarx/thunarx-menu.h | 4 ++++ thunarx/thunarx-preferences-provider.h | 2 ++ thunarx/thunarx-property-page-provider.h | 2 ++ thunarx/thunarx-property-page.h | 2 ++ thunarx/thunarx-provider-factory.h | 2 ++ thunarx/thunarx-provider-module.h | 2 ++ thunarx/thunarx-provider-plugin.h | 2 ++ thunarx/thunarx-renamer-provider.h | 2 ++ thunarx/thunarx-renamer.h | 2 ++ 12 files changed, 28 insertions(+), 4 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 3b016447..7058c0b3 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -146,10 +146,10 @@ dnl *********************************** dnl *** Check for required packages *** dnl *********************************** XDT_CHECK_PACKAGE([EXO], [exo-2], [0.12.0]) -XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.42.0]) -XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.42.0]) -XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.42.0]) -XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.42.0]) +XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.44.0]) +XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.44.0]) +XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.44.0]) +XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.44.0]) XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.22.0]) XDT_CHECK_PACKAGE([GDK_PIXBUF], [gdk-pixbuf-2.0], [2.14.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.12.0]) diff --git a/thunarx/thunarx-file-info.h b/thunarx/thunarx-file-info.h index 4f1f9116..8ab7deea 100644 --- a/thunarx/thunarx-file-info.h +++ b/thunarx/thunarx-file-info.h @@ -66,6 +66,8 @@ typedef struct _ThunarxFileInfo ThunarxFileInfo; #define THUNARX_IS_FILE_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_FILE_INFO)) #define THUNARX_FILE_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_FILE_INFO, ThunarxFileInfoIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxFileInfo, g_object_unref) + /** * ThunarxFileInfoIface: * @get_name: See thunarx_file_info_get_name(). diff --git a/thunarx/thunarx-menu-provider.h b/thunarx/thunarx-menu-provider.h index 550e5a28..e9e57f09 100644 --- a/thunarx/thunarx-menu-provider.h +++ b/thunarx/thunarx-menu-provider.h @@ -39,6 +39,8 @@ typedef struct _ThunarxMenuProvider ThunarxMenuProvider; #define THUNARX_IS_MENU_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_MENU_PROVIDER)) #define THUNARX_MENU_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_MENU_PROVIDER, ThunarxMenuProviderIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxMenuProvider, g_object_unref) + /** * ThunarxMenuProviderIface: * @get_file_menu_items: See thunarx_menu_provider_get_file_menu_items(). diff --git a/thunarx/thunarx-menu.h b/thunarx/thunarx-menu.h index 6869f5e1..bfbd7882 100644 --- a/thunarx/thunarx-menu.h +++ b/thunarx/thunarx-menu.h @@ -48,6 +48,8 @@ typedef struct _ThunarxMenuItem ThunarxMenuItem; #define THUNARX_IS_MENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), THUNARX_TYPE_MENU)) #define THUNARX_MENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), THUNARX_TYPE_MENU)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxMenu, g_object_unref) + /* ThunarxMenuItem defines */ #define THUNARX_TYPE_MENU_ITEM (thunarx_menu_item_get_type ()) #define THUNARX_MENU_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THUNARX_TYPE_MENU_ITEM, ThunarxMenuItem)) @@ -56,6 +58,8 @@ typedef struct _ThunarxMenuItem ThunarxMenuItem; #define THUNARX_IS_MENU_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), THUNARX_TYPE_MENU_ITEM)) #define THUNARX_MENU_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), THUNARX_TYPE_MENU_ITEM)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxMenuItem, g_object_unref) + /* ThunarxMenu structs */ diff --git a/thunarx/thunarx-preferences-provider.h b/thunarx/thunarx-preferences-provider.h index 50c2b5a8..a2e0c924 100644 --- a/thunarx/thunarx-preferences-provider.h +++ b/thunarx/thunarx-preferences-provider.h @@ -37,6 +37,8 @@ typedef struct _ThunarxPreferencesProvider ThunarxPreferencesProvider; #define THUNARX_IS_PREFERENCES_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_PREFERENCES_PROVIDER)) #define THUNARX_PREFERENCES_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_PREFERENCES_PROVIDER, ThunarxPreferencesProviderIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxPreferencesProvider, g_object_unref) + /** * ThunarxPreferencesProviderIface: * @get_menu_items: See thunarx_preferences_provider_get_menu_items(). diff --git a/thunarx/thunarx-property-page-provider.h b/thunarx/thunarx-property-page-provider.h index 53a13312..6e1d7e00 100644 --- a/thunarx/thunarx-property-page-provider.h +++ b/thunarx/thunarx-property-page-provider.h @@ -37,6 +37,8 @@ typedef struct _ThunarxPropertyPageProvider ThunarxPropertyPageProvider; #define THUNARX_IS_PROPERTY_PAGE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_PROPERTY_PAGE_PROVIDER)) #define THUNARX_PROPERTY_PAGE_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_PROPERTY_PAGE_PROVIDER, ThunarxPropertyPageProviderIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxPropertyPageProvider, g_object_unref) + /** * ThunarxPropertyPageProviderIface: * @get_pages: see thunarx_property_page_provider_get_pages(). diff --git a/thunarx/thunarx-property-page.h b/thunarx/thunarx-property-page.h index 0fb3d815..5e9eecd6 100644 --- a/thunarx/thunarx-property-page.h +++ b/thunarx/thunarx-property-page.h @@ -40,6 +40,8 @@ typedef struct _ThunarxPropertyPage ThunarxPropertyPage; #define THUNARX_IS_PROPERTY_PAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNARX_TYPE_PROPERTY_PAGE)) #define THUNARX_PROPERTY_PAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNARX_TYPE_PROPERTY_PAGE)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxPropertyPage, g_object_unref) + struct _ThunarxPropertyPageClass { GtkBinClass __parent__; diff --git a/thunarx/thunarx-provider-factory.h b/thunarx/thunarx-provider-factory.h index 0d046833..33282f88 100644 --- a/thunarx/thunarx-provider-factory.h +++ b/thunarx/thunarx-provider-factory.h @@ -39,6 +39,8 @@ typedef struct _ThunarxProviderFactory ThunarxProviderFactory; #define THUNARX_IS_PROVIDER_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNARX_TYPE_PROVIDER_FACTORY)) #define THUNARX_PROVIDER_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNARX_TYPE_PROVIDER_FACTORY, ThunarxProviderFactoryClass)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxProviderFactory, g_object_unref) + GType thunarx_provider_factory_get_type (void) G_GNUC_CONST; ThunarxProviderFactory *thunarx_provider_factory_get_default (void); diff --git a/thunarx/thunarx-provider-module.h b/thunarx/thunarx-provider-module.h index ca8c84ca..72b816d4 100644 --- a/thunarx/thunarx-provider-module.h +++ b/thunarx/thunarx-provider-module.h @@ -37,6 +37,8 @@ typedef struct _ThunarxProviderModule ThunarxProviderModule; #define THUNARX_IS_PROVIDER_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNARX_TYPE_PROVIDER_MODULE)) #define THUNARX_PROVIDER_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNARX_TYPE_PROVIDER_MODULE, ThunarxProviderModuleClass)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxProviderModule, g_object_unref) + GType thunarx_provider_module_get_type (void) G_GNUC_CONST; ThunarxProviderModule *thunarx_provider_module_new (const gchar *filename) G_GNUC_MALLOC; diff --git a/thunarx/thunarx-provider-plugin.h b/thunarx/thunarx-provider-plugin.h index 02c06269..4e973aa8 100644 --- a/thunarx/thunarx-provider-plugin.h +++ b/thunarx/thunarx-provider-plugin.h @@ -35,6 +35,8 @@ typedef struct _ThunarxProviderPlugin ThunarxProviderPlugin; #define THUNARX_IS_PROVIDER_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_PROVIDER_PLUGIN)) #define THUNARX_PROVIDER_PLUGIN_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_PROVIDER_PLUGIN, ThunarxProviderPluginIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxProviderPlugin, g_object_unref) + /** * ThunarxProviderPluginIface: * @get_resident: see thunarx_provider_plugin_get_resident(). diff --git a/thunarx/thunarx-renamer-provider.h b/thunarx/thunarx-renamer-provider.h index 48687be7..7565de0f 100644 --- a/thunarx/thunarx-renamer-provider.h +++ b/thunarx/thunarx-renamer-provider.h @@ -37,6 +37,8 @@ typedef struct _ThunarxRenamerProvider ThunarxRenamerProvider; #define THUNARX_IS_RENAMER_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THUNARX_TYPE_RENAMER_PROVIDER)) #define THUNARX_RENAMER_PROVIDER_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), THUNARX_TYPE_RENAMER_PROVIDER, ThunarxRenamerProviderIface)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxRenamerProvider, g_object_unref) + /** * ThunarxRenamerProviderIface: * @get_renamers: see thunarx_renamer_provider_get_renamers(). diff --git a/thunarx/thunarx-renamer.h b/thunarx/thunarx-renamer.h index 2a52d40f..42b20b18 100644 --- a/thunarx/thunarx-renamer.h +++ b/thunarx/thunarx-renamer.h @@ -42,6 +42,8 @@ typedef struct _ThunarxRenamer ThunarxRenamer; #define THUNARX_IS_RENAMER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), THUNARX_TYPE_RENAMER)) #define THUNARX_RENAMER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THUNARX_TYPE_RENAMER, ThunarxRenamerClass)) +G_DEFINE_AUTOPTR_CLEANUP_FUNC (ThunarxRenamer, g_object_unref) + /** * ThunarxRenamerClass: * @process: see thunarx_renamer_process(). -- 2.23.0