[balsa/gtk3] Avoid multiple dynamic casts to BalsaAbWindow
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa/gtk3] Avoid multiple dynamic casts to BalsaAbWindow
- Date: Wed, 25 Mar 2015 03:00:22 +0000 (UTC)
commit 095561dc8052b132957dcf18bbe36ffe42e6f2a7
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Tue Mar 24 22:31:05 2015 -0400
Avoid multiple dynamic casts to BalsaAbWindow
* src/ab-window.c (balsa_ab_window_new): avoid multiple dynamic
casts.
ChangeLog | 5 +++++
src/ab-window.c | 18 ++++++++++--------
2 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 06e664d..8c5dcbd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2015-03-24 Peter Bloomfield <pbloomfield bellsouth net>
+ * src/ab-window.c (balsa_ab_window_new): avoid multiple dynamic
+ casts.
+
+2015-03-24 Peter Bloomfield <pbloomfield bellsouth net>
+
* src/ab-window.c (balsa_ab_window_new): drop redundant dynamic
casts to GtkWidget
diff --git a/src/ab-window.c b/src/ab-window.c
index 78d30ba..55b5de9 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -116,30 +116,32 @@ GtkWidget *
balsa_ab_window_new(gboolean composing, GtkWindow* parent)
{
GtkWidget *ret;
+ BalsaAbWindow *ab;
ret = g_object_new(BALSA_TYPE_AB_WINDOW,
"use-header-bar", TRUE,
"transient-for", parent,
NULL);
- g_return_val_if_fail(ret, NULL);
+ g_return_val_if_fail(ret != NULL, NULL);
+ ab = (BalsaAbWindow *) ret;
- BALSA_AB_WINDOW(ret)->composing = composing;
+ ab->composing = composing;
if ( composing ) {
gtk_dialog_add_buttons(GTK_DIALOG(ret),
_("_OK"), GTK_RESPONSE_OK,
_("_Cancel"), GTK_RESPONSE_CANCEL,
NULL);
- gtk_widget_show(BALSA_AB_WINDOW(ret)->send_to_label);
- gtk_widget_show(BALSA_AB_WINDOW(ret)->send_to_list);
- gtk_widget_show(BALSA_AB_WINDOW(ret)->arrow_box);
+ gtk_widget_show(ab->send_to_label);
+ gtk_widget_show(ab->send_to_list);
+ gtk_widget_show(ab->arrow_box);
} else {
gtk_dialog_add_buttons(GTK_DIALOG(ret),
_("_Close"), GTK_RESPONSE_CLOSE,
NULL);
- gtk_widget_hide(BALSA_AB_WINDOW(ret)->send_to_label);
- gtk_widget_hide(BALSA_AB_WINDOW(ret)->send_to_list);
- gtk_widget_hide(BALSA_AB_WINDOW(ret)->arrow_box);
+ gtk_widget_hide(ab->send_to_label);
+ gtk_widget_hide(ab->send_to_list);
+ gtk_widget_hide(ab->arrow_box);
}
return ret;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]