[Xfce4-commits] [xfce/thunar] 03/07: Fix g_type_class_add_private is deprecated
noreply at xfce.org
noreply at xfce.org
Sat May 18 22:25:35 CEST 2019
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h x f c e - 4 . 1 4
in repository xfce/thunar.
commit 47e3567a0c4cbbfaa585bda1aa769a3c43c77a16
Author: Andre Miranda <andreldm at xfce.org>
Date: Sun Apr 14 12:43:48 2019 -0300
Fix g_type_class_add_private is deprecated
---
thunar/thunar-abstract-icon-view.c | 7 ++-----
thunar/thunar-image.c | 6 ++----
thunar/thunar-job.c | 7 ++-----
thunar/thunar-standard-view.c | 7 +++----
thunarx/thunarx-menu-item.c | 7 ++-----
thunarx/thunarx-menu.c | 7 ++-----
thunarx/thunarx-property-page.c | 7 ++-----
thunarx/thunarx-renamer.c | 5 +----
8 files changed, 16 insertions(+), 37 deletions(-)
diff --git a/thunar/thunar-abstract-icon-view.c b/thunar/thunar-abstract-icon-view.c
index f53f453..37097a4 100644
--- a/thunar/thunar-abstract-icon-view.c
+++ b/thunar/thunar-abstract-icon-view.c
@@ -133,7 +133,7 @@ static const GtkRadioActionEntry order_action_entries[] =
-G_DEFINE_ABSTRACT_TYPE (ThunarAbstractIconView, thunar_abstract_icon_view, THUNAR_TYPE_STANDARD_VIEW)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ThunarAbstractIconView, thunar_abstract_icon_view, THUNAR_TYPE_STANDARD_VIEW)
@@ -143,9 +143,6 @@ thunar_abstract_icon_view_class_init (ThunarAbstractIconViewClass *klass)
ThunarStandardViewClass *thunarstandard_view_class;
GtkWidgetClass *gtkwidget_class;
- /* add private data to the instance type */
- g_type_class_add_private (klass, sizeof (ThunarAbstractIconViewPrivate));
-
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->style_set = thunar_abstract_icon_view_style_set;
@@ -198,7 +195,7 @@ thunar_abstract_icon_view_init (ThunarAbstractIconView *abstract_icon_view)
GtkWidget *view;
/* connect private instance data */
- abstract_icon_view->priv = THUNAR_ABSTRACT_ICON_VIEW_GET_PRIVATE (abstract_icon_view);
+ abstract_icon_view->priv = thunar_abstract_icon_view_get_instance_private (abstract_icon_view);
/* stay informed about zoom-level changes, so we can force a re-layout on the abstract_icon view */
g_signal_connect (G_OBJECT (abstract_icon_view), "notify::zoom-level", G_CALLBACK (thunar_abstract_icon_view_zoom_level_changed), NULL);
diff --git a/thunar/thunar-image.c b/thunar/thunar-image.c
index cff5205..3a1d701 100644
--- a/thunar/thunar-image.c
+++ b/thunar/thunar-image.c
@@ -81,7 +81,7 @@ struct _ThunarImagePrivate
-G_DEFINE_TYPE (ThunarImage, thunar_image, GTK_TYPE_IMAGE);
+G_DEFINE_TYPE_WITH_PRIVATE (ThunarImage, thunar_image, GTK_TYPE_IMAGE);
@@ -90,8 +90,6 @@ thunar_image_class_init (ThunarImageClass *klass)
{
GObjectClass *gobject_class;
- g_type_class_add_private (klass, sizeof (ThunarImagePrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_image_finalize;
gobject_class->get_property = thunar_image_get_property;
@@ -110,7 +108,7 @@ thunar_image_class_init (ThunarImageClass *klass)
static void
thunar_image_init (ThunarImage *image)
{
- image->priv = THUNAR_IMAGE_GET_PRIVATE (image);
+ image->priv = thunar_image_get_instance_private (image);
image->priv->file = NULL;
image->priv->monitor = thunar_file_monitor_get_default ();
diff --git a/thunar/thunar-job.c b/thunar/thunar-job.c
index 867278e..d8eb9af 100644
--- a/thunar/thunar-job.c
+++ b/thunar/thunar-job.c
@@ -78,7 +78,7 @@ static guint job_signals[LAST_SIGNAL];
-G_DEFINE_ABSTRACT_TYPE (ThunarJob, thunar_job, EXO_TYPE_JOB)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ThunarJob, thunar_job, EXO_TYPE_JOB)
@@ -99,9 +99,6 @@ thunar_job_class_init (ThunarJobClass *klass)
{
GObjectClass *gobject_class;
- /* add our private data for this class */
- g_type_class_add_private (klass, sizeof (ThunarJobPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunar_job_finalize;
@@ -209,7 +206,7 @@ thunar_job_class_init (ThunarJobClass *klass)
static void
thunar_job_init (ThunarJob *job)
{
- job->priv = THUNAR_JOB_GET_PRIVATE (job);
+ job->priv = thunar_job_get_instance_private (job);
job->priv->earlier_ask_create_response = 0;
job->priv->earlier_ask_overwrite_response = 0;
job->priv->earlier_ask_skip_response = 0;
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index e3a0eda..e3f9941 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -444,7 +444,8 @@ static GParamSpec *standard_view_props[N_PROPERTIES] = { NULL, };
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (ThunarStandardView, thunar_standard_view, GTK_TYPE_SCROLLED_WINDOW,
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_NAVIGATOR, thunar_standard_view_navigator_init)
G_IMPLEMENT_INTERFACE (THUNAR_TYPE_COMPONENT, thunar_standard_view_component_init)
- G_IMPLEMENT_INTERFACE (THUNAR_TYPE_VIEW, thunar_standard_view_view_init))
+ G_IMPLEMENT_INTERFACE (THUNAR_TYPE_VIEW, thunar_standard_view_view_init)
+ G_ADD_PRIVATE (ThunarStandardView))
@@ -456,8 +457,6 @@ thunar_standard_view_class_init (ThunarStandardViewClass *klass)
GObjectClass *gobject_class;
gpointer g_iface;
- g_type_class_add_private (klass, sizeof (ThunarStandardViewPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructor = thunar_standard_view_constructor;
gobject_class->dispose = thunar_standard_view_dispose;
@@ -636,7 +635,7 @@ thunar_standard_view_view_init (ThunarViewIface *iface)
static void
thunar_standard_view_init (ThunarStandardView *standard_view)
{
- standard_view->priv = THUNAR_STANDARD_VIEW_GET_PRIVATE (standard_view);
+ standard_view->priv = thunar_standard_view_get_instance_private (standard_view);
/* allocate the scroll_to_files mapping (directory GFile -> first visible child GFile) */
standard_view->priv->scroll_to_files = g_hash_table_new_full (g_file_hash, (GEqualFunc) g_file_equal, g_object_unref, g_object_unref);
diff --git a/thunarx/thunarx-menu-item.c b/thunarx/thunarx-menu-item.c
index 7622b89..98b3938 100644
--- a/thunarx/thunarx-menu-item.c
+++ b/thunarx/thunarx-menu-item.c
@@ -93,7 +93,7 @@ static guint signals[LAST_SIGNAL];
-G_DEFINE_TYPE (ThunarxMenuItem, thunarx_menu_item, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (ThunarxMenuItem, thunarx_menu_item, G_TYPE_OBJECT)
@@ -102,9 +102,6 @@ thunarx_menu_item_class_init (ThunarxMenuItemClass *klass)
{
GObjectClass *gobject_class;
- /* add our private data to the class type */
- g_type_class_add_private (klass, sizeof (ThunarxMenuItemPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunarx_menu_item_finalize;
gobject_class->get_property = thunarx_menu_item_get_property;
@@ -177,7 +174,7 @@ thunarx_menu_item_class_init (ThunarxMenuItemClass *klass)
static void
thunarx_menu_item_init (ThunarxMenuItem *item)
{
- item->priv = THUNARX_MENU_ITEM_GET_PRIVATE (item);
+ item->priv = thunarx_menu_item_get_instance_private (item);
item->priv->sensitive = TRUE;
item->priv->priority = FALSE;
item->priv->menu = NULL;
diff --git a/thunarx/thunarx-menu.c b/thunarx/thunarx-menu.c
index b3fcf20..016a3d4 100644
--- a/thunarx/thunarx-menu.c
+++ b/thunarx/thunarx-menu.c
@@ -53,7 +53,7 @@ struct _ThunarxMenuPrivate
-G_DEFINE_TYPE (ThunarxMenu, thunarx_menu, G_TYPE_OBJECT)
+G_DEFINE_TYPE_WITH_PRIVATE (ThunarxMenu, thunarx_menu, G_TYPE_OBJECT)
@@ -62,9 +62,6 @@ thunarx_menu_class_init (ThunarxMenuClass *klass)
{
GObjectClass *gobject_class;
- /* add our private data to the class type */
- g_type_class_add_private (klass, sizeof (ThunarxMenuPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunarx_menu_finalize;
}
@@ -74,7 +71,7 @@ thunarx_menu_class_init (ThunarxMenuClass *klass)
static void
thunarx_menu_init (ThunarxMenu *menu)
{
- menu->priv = THUNARX_MENU_GET_PRIVATE (menu);
+ menu->priv = thunarx_menu_get_instance_private (menu);
menu->priv->items = NULL;
}
diff --git a/thunarx/thunarx-property-page.c b/thunarx/thunarx-property-page.c
index 97bf5fc..cdb3c3c 100644
--- a/thunarx/thunarx-property-page.c
+++ b/thunarx/thunarx-property-page.c
@@ -85,7 +85,7 @@ struct _ThunarxPropertyPagePrivate
-G_DEFINE_TYPE (ThunarxPropertyPage, thunarx_property_page, GTK_TYPE_BIN)
+G_DEFINE_TYPE_WITH_PRIVATE (ThunarxPropertyPage, thunarx_property_page, GTK_TYPE_BIN)
@@ -95,9 +95,6 @@ thunarx_property_page_class_init (ThunarxPropertyPageClass *klass)
GtkWidgetClass *gtkwidget_class;
GObjectClass *gobject_class;
- /* add our private data to the class type */
- g_type_class_add_private (klass, sizeof (ThunarxPropertyPagePrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->get_property = thunarx_property_page_get_property;
gobject_class->set_property = thunarx_property_page_set_property;
@@ -137,7 +134,7 @@ thunarx_property_page_class_init (ThunarxPropertyPageClass *klass)
static void
thunarx_property_page_init (ThunarxPropertyPage *property_page)
{
- property_page->priv = THUNARX_PROPERTY_PAGE_GET_PRIVATE (property_page);
+ property_page->priv = thunarx_property_page_get_instance_private (property_page);
}
diff --git a/thunarx/thunarx-renamer.c b/thunarx/thunarx-renamer.c
index 715dbd3..f5c38d9 100644
--- a/thunarx/thunarx-renamer.c
+++ b/thunarx/thunarx-renamer.c
@@ -114,7 +114,7 @@ static guint renamer_signals[LAST_SIGNAL];
-G_DEFINE_ABSTRACT_TYPE (ThunarxRenamer, thunarx_renamer, GTK_TYPE_BOX)
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ThunarxRenamer, thunarx_renamer, GTK_TYPE_BOX)
@@ -123,9 +123,6 @@ thunarx_renamer_class_init (ThunarxRenamerClass *klass)
{
GObjectClass *gobject_class;
- /* add private data */
- g_type_class_add_private (klass, sizeof (ThunarxRenamerPrivate));
-
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = thunarx_renamer_finalize;
gobject_class->constructor = thunarx_renamer_constructor;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list