[gnome-software: 23/110] Stop overriding GtkWidget.destroy in favor of GObject.dispose
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software: 23/110] Stop overriding GtkWidget.destroy in favor of GObject.dispose
- Date: Tue, 5 Oct 2021 20:32:36 +0000 (UTC)
commit b9d8a1e9a8d6618c4e4f7ff778098332812b1a57
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Aug 21 20:20:49 2021 -0300
Stop overriding GtkWidget.destroy in favor of GObject.dispose
src/gs-app-addon-row.c | 7 +++----
src/gs-app-row.c | 6 +++---
src/gs-origin-popover-row.c | 7 ++++---
src/gs-repo-row.c | 6 +++---
src/gs-screenshot-image.c | 10 ++++++----
src/gs-star-widget.c | 7 -------
src/gs-upgrade-banner.c | 15 ++-------------
7 files changed, 21 insertions(+), 37 deletions(-)
---
diff --git a/src/gs-app-addon-row.c b/src/gs-app-addon-row.c
index d28993ca7..31d5ebaf5 100644
--- a/src/gs-app-addon-row.c
+++ b/src/gs-app-addon-row.c
@@ -207,7 +207,7 @@ gs_app_addon_row_set_addon (GsAppAddonRow *row, GsApp *app)
}
static void
-gs_app_addon_row_destroy (GtkWidget *object)
+gs_app_addon_row_dispose (GObject *object)
{
GsAppAddonRow *row = GS_APP_ADDON_ROW (object);
@@ -216,7 +216,7 @@ gs_app_addon_row_destroy (GtkWidget *object)
g_clear_object (&row->app);
- GTK_WIDGET_CLASS (gs_app_addon_row_parent_class)->destroy (object);
+ G_OBJECT_CLASS (gs_app_addon_row_parent_class)->dispose (object);
}
static void
@@ -256,11 +256,10 @@ gs_app_addon_row_class_init (GsAppAddonRowClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = gs_app_addon_row_dispose;
object_class->set_property = gs_app_addon_row_set_property;
object_class->get_property = gs_app_addon_row_get_property;
- widget_class->destroy = gs_app_addon_row_destroy;
-
pspec = g_param_spec_boolean ("selected", NULL, NULL,
FALSE, G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_SELECTED, pspec);
diff --git a/src/gs-app-row.c b/src/gs-app-row.c
index 8d8eda829..d7dddf245 100644
--- a/src/gs-app-row.c
+++ b/src/gs-app-row.c
@@ -698,7 +698,7 @@ gs_app_row_set_property (GObject *object, guint prop_id, const GValue *value, GP
}
static void
-gs_app_row_destroy (GtkWidget *object)
+gs_app_row_dispose (GObject *object)
{
GsAppRow *app_row = GS_APP_ROW (object);
GsAppRowPrivate *priv = gs_app_row_get_instance_private (app_row);
@@ -712,7 +712,7 @@ gs_app_row_destroy (GtkWidget *object)
priv->pending_refresh_id = 0;
}
- GTK_WIDGET_CLASS (gs_app_row_parent_class)->destroy (object);
+ G_OBJECT_CLASS (gs_app_row_parent_class)->dispose (object);
}
static void
@@ -723,7 +723,7 @@ gs_app_row_class_init (GsAppRowClass *klass)
object_class->get_property = gs_app_row_get_property;
object_class->set_property = gs_app_row_set_property;
- widget_class->destroy = gs_app_row_destroy;
+ object_class->dispose = gs_app_row_dispose;
/**
* GsAppRow:app:
diff --git a/src/gs-origin-popover-row.c b/src/gs-origin-popover-row.c
index a8538e71f..b03d667d1 100644
--- a/src/gs-origin-popover-row.c
+++ b/src/gs-origin-popover-row.c
@@ -136,14 +136,14 @@ gs_origin_popover_row_set_size_group (GsOriginPopoverRow *row, GtkSizeGroup *siz
}
static void
-gs_origin_popover_row_destroy (GtkWidget *object)
+gs_origin_popover_row_dispose (GObject *object)
{
GsOriginPopoverRow *row = GS_ORIGIN_POPOVER_ROW (object);
GsOriginPopoverRowPrivate *priv = gs_origin_popover_row_get_instance_private (row);
g_clear_object (&priv->app);
- GTK_WIDGET_CLASS (gs_origin_popover_row_parent_class)->destroy (object);
+ G_OBJECT_CLASS (gs_origin_popover_row_parent_class)->dispose (object);
}
static void
@@ -155,9 +155,10 @@ gs_origin_popover_row_init (GsOriginPopoverRow *row)
static void
gs_origin_popover_row_class_init (GsOriginPopoverRowClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->destroy = gs_origin_popover_row_destroy;
+ object_class->dispose = gs_origin_popover_row_dispose;
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/Software/gs-origin-popover-row.ui");
diff --git a/src/gs-repo-row.c b/src/gs-repo-row.c
index eced34ffd..8bd45d0c9 100644
--- a/src/gs-repo-row.c
+++ b/src/gs-repo-row.c
@@ -275,7 +275,7 @@ gs_repo_row_remove_button_clicked_cb (GtkWidget *button,
}
static void
-gs_repo_row_destroy (GtkWidget *object)
+gs_repo_row_dispose (GObject *object)
{
GsRepoRow *self = GS_REPO_ROW (object);
GsRepoRowPrivate *priv = gs_repo_row_get_instance_private (self);
@@ -292,7 +292,7 @@ gs_repo_row_destroy (GtkWidget *object)
g_clear_object (&priv->plugin_loader);
- GTK_WIDGET_CLASS (gs_repo_row_parent_class)->destroy (object);
+ G_OBJECT_CLASS (gs_repo_row_parent_class)->dispose (object);
}
static void
@@ -316,7 +316,7 @@ gs_repo_row_class_init (GsRepoRowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- widget_class->destroy = gs_repo_row_destroy;
+ object_class->dispose = gs_repo_row_dispose;
signals [SIGNAL_REMOVE_CLICKED] =
g_signal_new ("remove-clicked",
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index e7a995063..b9a8de9fe 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -651,9 +651,9 @@ gs_screenshot_image_set_description (GsScreenshotImage *ssimg,
}
static void
-gs_screenshot_image_destroy (GtkWidget *widget)
+gs_screenshot_image_dispose (GObject *object)
{
- GsScreenshotImage *ssimg = GS_SCREENSHOT_IMAGE (widget);
+ GsScreenshotImage *ssimg = GS_SCREENSHOT_IMAGE (object);
if (ssimg->load_timeout_id) {
g_source_remove (ssimg->load_timeout_id);
@@ -672,7 +672,7 @@ gs_screenshot_image_destroy (GtkWidget *widget)
g_clear_pointer (&ssimg->filename, g_free);
- GTK_WIDGET_CLASS (gs_screenshot_image_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (gs_screenshot_image_parent_class)->dispose (object);
}
static void
@@ -714,9 +714,11 @@ gs_screenshot_image_draw (GtkWidget *widget, cairo_t *cr)
static void
gs_screenshot_image_class_init (GsScreenshotImageClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->destroy = gs_screenshot_image_destroy;
+ object_class->dispose = gs_screenshot_image_dispose;
+
widget_class->draw = gs_screenshot_image_draw;
gtk_widget_class_set_template_from_resource (widget_class,
diff --git a/src/gs-star-widget.c b/src/gs-star-widget.c
index e617a1685..5c909c2b4 100644
--- a/src/gs-star-widget.c
+++ b/src/gs-star-widget.c
@@ -233,12 +233,6 @@ gs_star_widget_set_property (GObject *object,
}
}
-static void
-gs_star_widget_destroy (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (gs_star_widget_parent_class)->destroy (widget);
-}
-
static void
gs_star_widget_realize (GtkWidget *widget)
{
@@ -260,7 +254,6 @@ gs_star_widget_class_init (GsStarWidgetClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- widget_class->destroy = gs_star_widget_destroy;
widget_class->realize = gs_star_widget_realize;
object_class->get_property = gs_star_widget_get_property;
object_class->set_property = gs_star_widget_set_property;
diff --git a/src/gs-upgrade-banner.c b/src/gs-upgrade-banner.c
index 4e52d9afc..f8b800e4e 100644
--- a/src/gs-upgrade-banner.c
+++ b/src/gs-upgrade-banner.c
@@ -309,17 +309,6 @@ gs_upgrade_banner_dispose (GObject *object)
GsUpgradeBanner *self = GS_UPGRADE_BANNER (object);
GsUpgradeBannerPrivate *priv = gs_upgrade_banner_get_instance_private (self);
- g_clear_object (&priv->banner_provider);
-
- G_OBJECT_CLASS (gs_upgrade_banner_parent_class)->dispose (object);
-}
-
-static void
-gs_upgrade_banner_destroy (GtkWidget *widget)
-{
- GsUpgradeBanner *self = GS_UPGRADE_BANNER (widget);
- GsUpgradeBannerPrivate *priv = gs_upgrade_banner_get_instance_private (self);
-
stop_progress_pulsing (self);
if (priv->app) {
@@ -328,8 +317,9 @@ gs_upgrade_banner_destroy (GtkWidget *widget)
}
g_clear_object (&priv->app);
+ g_clear_object (&priv->banner_provider);
- GTK_WIDGET_CLASS (gs_upgrade_banner_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (gs_upgrade_banner_parent_class)->dispose (object);
}
static void
@@ -361,7 +351,6 @@ gs_upgrade_banner_class_init (GsUpgradeBannerClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->dispose = gs_upgrade_banner_dispose;
- widget_class->destroy = gs_upgrade_banner_destroy;
signals [SIGNAL_DOWNLOAD_CLICKED] =
g_signal_new ("download-clicked",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]