[balsa/gtk4: 240/311] Various: Always get the parent from the src-obj




commit d20246e7dd50a54e495e7e867e4d3c3d4070f53f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Oct 25 12:29:20 2020 -0400

    Various: Always get the parent from the src-obj
    
    When calling gtk_show_uri_full_finish(), the source-object is the
    GtkWindow parent, so just cast it to one.

 libbalsa/identity.c             | 2 +-
 libbalsa/smtp-server.c          | 2 +-
 src/address-book-config.c       | 2 +-
 src/balsa-mime-widget-message.c | 3 ++-
 src/balsa-mime-widget-text.c    | 3 ++-
 src/filter-edit-callbacks.c     | 4 ++--
 src/filter-run-callbacks.c      | 2 +-
 7 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index ef99eba04..55792c1cc 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -1659,7 +1659,7 @@ help_ident_finish(GObject      *source_object,
                   GAsyncResult *result,
                   gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index 5d9dfa80b..d236cd847 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -234,7 +234,7 @@ smtp_server_help_finish(GObject      *source_object,
                         GAsyncResult *result,
                         gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
diff --git a/src/address-book-config.c b/src/address-book-config.c
index f75982e77..b02f24267 100644
--- a/src/address-book-config.c
+++ b/src/address-book-config.c
@@ -625,7 +625,7 @@ help_button_finish(GObject      *source_object,
                    GAsyncResult *result,
                    gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 444f9177d..fedeb7334 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -324,10 +324,11 @@ extbody_call_url_finish(GObject      *source_object,
                         GAsyncResult *res,
                         gpointer      user_data)
 {
+    GtkWindow *parent = GTK_WINDOW(source_object);
     char *url = user_data;
     GError *err = NULL;
 
-    if (!gtk_show_uri_full_finish(GTK_WINDOW(source_object), res, &err)) {
+    if (!gtk_show_uri_full_finish(parent, res, &err)) {
         balsa_information(LIBBALSA_INFORMATION_WARNING,
                           _("Error showing %s: %s\n"), url, err->message);
         g_error_free(err);
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index 5b7cc3ea4..3248050b2 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -895,10 +895,11 @@ handle_url_finish(GObject      *source_object,
                   GAsyncResult *res,
                   gpointer      user_data)
 {
+    GtkWindow *parent = GTK_WINDOW(source_object);
     char *url = user_data;
     GError *err = NULL;
 
-    if (!gtk_show_uri_full_finish(GTK_WINDOW(source_object), res, &err)) {
+    if (!gtk_show_uri_full_finish(parent, res, &err)) {
         balsa_information(LIBBALSA_INFORMATION_WARNING,
                           _("Error showing %s: %s\n"),
                           url, err->message);
diff --git a/src/filter-edit-callbacks.c b/src/filter-edit-callbacks.c
index 6ec4c1782..393e0fa58 100644
--- a/src/filter-edit-callbacks.c
+++ b/src/filter-edit-callbacks.c
@@ -828,7 +828,7 @@ show_condition_help_finish(GObject      *source_object,
                            GAsyncResult *result,
                            gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
@@ -1499,7 +1499,7 @@ show_filter_help_finish(GObject      *source_object,
                         GAsyncResult *result,
                         gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {
diff --git a/src/filter-run-callbacks.c b/src/filter-run-callbacks.c
index 8149b4815..c12f31a4c 100644
--- a/src/filter-run-callbacks.c
+++ b/src/filter-run-callbacks.c
@@ -163,7 +163,7 @@ help_button_finish(GObject      *source_object,
                    GAsyncResult *result,
                    gpointer      user_data)
 {
-    GtkWindow *parent = user_data;
+    GtkWindow *parent = GTK_WINDOW(source_object);
     GError *error = NULL;
 
     if (!gtk_show_uri_full_finish(parent, result, &error)) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]