[eog] Cast GObject pointers to their proper types when reffing
- From: Felix Riemann <friemann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Cast GObject pointers to their proper types when reffing
- Date: Sun, 28 Jan 2018 15:57:36 +0000 (UTC)
commit e716b7a08b723059cd27e004a1f5bb6674aff6ee
Author: Timm Bäder <mail baedert org>
Date: Fri Jan 26 12:08:04 2018 +0100
Cast GObject pointers to their proper types when reffing
glib now propagates the real pointer type that gets reffed. And it
doesn't hurt with older glib versions.
https://bugzilla.gnome.org/show_bug.cgi?id=792924
src/eog-save-as-dialog-helper.c | 2 +-
src/eog-scroll-view.c | 2 +-
src/eog-thumb-view.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/eog-save-as-dialog-helper.c b/src/eog-save-as-dialog-helper.c
index 8c6bf54..451b71a 100644
--- a/src/eog-save-as-dialog-helper.c
+++ b/src/eog-save-as-dialog-helper.c
@@ -235,7 +235,7 @@ eog_save_as_dialog_new (GtkWindow *main, GList *images, GFile *base_file)
data->n_images = g_list_length (images);
data->nth_image = (int) ((float) data->n_images * rand() / (float) (RAND_MAX+1.0));
g_assert (data->nth_image >= 0 && data->nth_image < data->n_images);
- data->image = g_object_ref (G_OBJECT (g_list_nth_data (images, data->nth_image)));
+ data->image = g_object_ref (EOG_IMAGE (g_list_nth_data (images, data->nth_image)));
g_object_set_data_full (G_OBJECT (dlg), "data", data, destroy_data_cb);
g_signal_connect (G_OBJECT (data->format_combobox), "changed",
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 8c1bf00..e053678 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -2816,7 +2816,7 @@ eog_scroll_view_set_popup (EogScrollView *view,
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
g_return_if_fail (view->priv->menu == NULL);
- view->priv->menu = g_object_ref (menu);
+ view->priv->menu = g_object_ref (GTK_WIDGET (menu));
gtk_menu_attach_to_widget (GTK_MENU (view->priv->menu),
GTK_WIDGET (view),
diff --git a/src/eog-thumb-view.c b/src/eog-thumb-view.c
index e528d4d..4bd3b5f 100644
--- a/src/eog-thumb-view.c
+++ b/src/eog-thumb-view.c
@@ -1043,7 +1043,7 @@ eog_thumb_view_set_thumbnail_popup (EogThumbView *thumbview,
g_return_if_fail (EOG_IS_THUMB_VIEW (thumbview));
g_return_if_fail (thumbview->priv->menu == NULL);
- thumbview->priv->menu = g_object_ref (menu);
+ thumbview->priv->menu = g_object_ref (GTK_WIDGET (menu));
gtk_menu_attach_to_widget (GTK_MENU (thumbview->priv->menu),
GTK_WIDGET (thumbview),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]