[balsa] Clean up conditional compilations
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] Clean up conditional compilations
- Date: Tue, 14 May 2019 02:26:26 +0000 (UTC)
commit 347683203f9248b7454b22b0dafd86145c71a5ee
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Mon May 13 22:23:56 2019 -0400
Clean up conditional compilations
Clean up conditional compilations after bumping required versions.
* libbalsa/libbalsa.c (libbalsa_dialog_flags):
* libbalsa/libbalsa.h:
* src/ab-main.c (libbalsa_dialog_flags):
* src/ab-window.c (balsa_ab_window_new):
* src/balsa-message.c (balsa_message_init):
* src/balsa-mime-widget-image.c (balsa_mime_widget_image_dispose),
(balsa_mime_widget_new_image):
* src/filter-run-dialog.c (balsa_filter_run_dialog_new):
* src/pref-manager.c (pm_grid_attach):
ChangeLog | 15 +++++++++++++++
libbalsa/libbalsa.c | 2 --
libbalsa/libbalsa.h | 5 -----
src/ab-main.c | 2 --
src/ab-window.c | 2 --
src/balsa-message.c | 4 ----
src/balsa-mime-widget-image.c | 40 +---------------------------------------
src/filter-run-dialog.c | 2 --
src/pref-manager.c | 7 +------
9 files changed, 17 insertions(+), 62 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c9a4b5d13..aff4671be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2019-05-13 Peter Bloomfield <pbloomfield bellsouth net>
+
+ Clean up conditional compilations after bumping required
+ versions.
+
+ * libbalsa/libbalsa.c (libbalsa_dialog_flags):
+ * libbalsa/libbalsa.h:
+ * src/ab-main.c (libbalsa_dialog_flags):
+ * src/ab-window.c (balsa_ab_window_new):
+ * src/balsa-message.c (balsa_message_init):
+ * src/balsa-mime-widget-image.c (balsa_mime_widget_image_dispose),
+ (balsa_mime_widget_new_image):
+ * src/filter-run-dialog.c (balsa_filter_run_dialog_new):
+ * src/pref-manager.c (pm_grid_attach):
+
2019-05-13 Peter Bloomfield <pbloomfield bellsouth net>
Bump required version of GLib to 2.48, and Gtk3 to 3.18
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index a93826658..168c03994 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -946,7 +946,6 @@ libbalsa_image_error_quark(void)
return quark;
}
-#if GTK_CHECK_VERSION(3, 12, 0)
gboolean
libbalsa_use_headerbar(void)
{
@@ -970,4 +969,3 @@ libbalsa_dialog_flags(void)
{
return libbalsa_use_headerbar() ? GTK_DIALOG_USE_HEADER_BAR : (GtkDialogFlags) 0;
}
-#endif
diff --git a/libbalsa/libbalsa.h b/libbalsa/libbalsa.h
index 276759156..04b07c0a7 100644
--- a/libbalsa/libbalsa.h
+++ b/libbalsa/libbalsa.h
@@ -186,13 +186,8 @@ enum LibBalsaImageError {
#endif /* HAVE_COMPFACE */
};
-#if GTK_CHECK_VERSION(3, 12, 0)
gboolean libbalsa_use_headerbar(void);
GtkDialogFlags libbalsa_dialog_flags(void);
-#else
-#define libbalsa_use_headerbar() (FALSE)
-#define libbalsa_dialog_flags() (GtkDialogFlags) (0)
-#endif
#if HAVE_GTKSOURCEVIEW
GtkWidget *libbalsa_source_view_new(gboolean highlight_phrases);
diff --git a/src/ab-main.c b/src/ab-main.c
index 73b495a7e..b8276f7bb 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -1032,7 +1032,6 @@ bab_set_intial_address_book(LibBalsaAddressBook * ab,
g_action_change_state(action, g_variant_new_string(ab->name));
}
-#if GTK_CHECK_VERSION(3, 12, 0)
GtkDialogFlags
libbalsa_dialog_flags(void)
{
@@ -1050,7 +1049,6 @@ libbalsa_dialog_flags(void)
}
return dialog_flags;
}
-#endif
/*
* Set up GNotification for libbalsa
diff --git a/src/ab-window.c b/src/ab-window.c
index 85228e1ca..d3820a022 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -117,7 +117,6 @@ balsa_ab_window_new(gboolean composing, GtkWindow* parent)
GtkWidget *ret;
BalsaAbWindow *ab;
gint use_headerbar = 1;
-#if GTK_CHECK_VERSION(3, 12, 0)
const gchar *dialog_env;
/* header bar configuration */
@@ -125,7 +124,6 @@ balsa_ab_window_new(gboolean composing, GtkWindow* parent)
if ((dialog_env != NULL) && (atoi(dialog_env) == 0)) {
use_headerbar = 0;
}
-#endif
ret = g_object_new(BALSA_TYPE_AB_WINDOW,
"use-header-bar", use_headerbar,
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 3429c7bd1..56d02ead7 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -735,10 +735,6 @@ balsa_message_init(BalsaMessage * bm)
g_signal_connect(scroll, "key_press_event",
G_CALLBACK(balsa_mime_widget_key_press_event), bm);
gtk_box_pack_start(GTK_BOX(vbox), scroll, TRUE, TRUE, 0);
-#if !GTK_CHECK_VERSION(3, 15, 0)
- g_signal_connect_after(bm, "style-updated",
- G_CALLBACK(bm_on_set_style), bm);
-#endif
g_signal_connect(bm->scroll, "size-allocate",
G_CALLBACK(on_content_size_alloc), NULL);
diff --git a/src/balsa-mime-widget-image.c b/src/balsa-mime-widget-image.c
index ff214c211..b46eac8c5 100644
--- a/src/balsa-mime-widget-image.c
+++ b/src/balsa-mime-widget-image.c
@@ -33,11 +33,6 @@
*/
struct _BalsaMimeWidgetImage {
BalsaMimeWidget parent;
-
-#if !GTK_CHECK_VERSION(3, 15, 0)
- GtkStyleContext *context;
- gulong context_changed_handler_id;
-#endif
};
struct _BalsaMimeWidgetImageClass {
@@ -56,18 +51,7 @@ balsa_mime_widget_image_init(BalsaMimeWidgetImage * mwi)
static void
balsa_mime_widget_image_dispose(GObject * obj)
{
-#if !GTK_CHECK_VERSION(3, 15, 0)
- BalsaMimeWidgetImage *mwi = BALSA_MIME_WIDGET_IMAGE(obj);
-
- if (mwi->context_changed_handler_id) {
- g_signal_handler_disconnect(mwi->context,
- mwi->context_changed_handler_id);
- mwi->context_changed_handler_id = 0;
- }
-#endif
-
- (*G_OBJECT_CLASS(balsa_mime_widget_image_parent_class)->
- dispose) (obj);
+ G_OBJECT_CLASS(balsa_mime_widget_image_parent_class)->dispose(obj);
}
static void
@@ -85,19 +69,6 @@ static gboolean balsa_image_button_press_cb(GtkWidget * widget, GdkEventButton *
GtkMenu * menu);
static gboolean img_check_size(GtkImage ** widget_p);
-#if !GTK_CHECK_VERSION(3, 15, 0)
-static void
-bmwi_context_changed_cb(GtkStyleContext * context, BalsaMimeWidget * mw)
-{
- GdkRGBA rgba;
-
- gtk_style_context_get_background_color(context,
- GTK_STATE_FLAG_NORMAL, &rgba);
- gtk_widget_override_background_color(mw->widget,
- GTK_STATE_FLAG_NORMAL, &rgba);
-}
-#endif
-
BalsaMimeWidget *
balsa_mime_widget_new_image(BalsaMessage * bm,
LibBalsaMessageBody * mime_body,
@@ -130,15 +101,6 @@ balsa_mime_widget_new_image(BalsaMessage * bm,
g_signal_connect(G_OBJECT(mw->widget), "button-press-event",
G_CALLBACK(balsa_image_button_press_cb), data);
-#if !GTK_CHECK_VERSION(3, 15, 0)
- mwi->context =
- gtk_widget_get_style_context(GTK_WIDGET(bm->scroll));
- bmwi_context_changed_cb(mwi->context, mw);
- mwi->context_changed_handler_id =
- g_signal_connect(mwi->context, "changed",
- G_CALLBACK(bmwi_context_changed_cb), mw);
-#endif
-
image = gtk_image_new_from_icon_name("image-missing",
GTK_ICON_SIZE_BUTTON);
g_object_set_data(G_OBJECT(image), "orig-width",
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index 4ebf21760..0631a312d 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -183,9 +183,7 @@ balsa_filter_run_dialog_new(LibBalsaMailbox * mbox, GtkWindow * parent)
g_return_val_if_fail(mbox, NULL);
-#if GTK_CHECK_VERSION(3, 12, 0)
use_headerbar = (libbalsa_dialog_flags() & GTK_DIALOG_USE_HEADER_BAR) != 0;
-#endif
p = g_object_new(BALSA_TYPE_FILTER_RUN_DIALOG,
"transient-for", parent,
"use-header-bar", use_headerbar,
diff --git a/src/pref-manager.c b/src/pref-manager.c
index 13e0b63b3..f81944e3d 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -1245,13 +1245,8 @@ pm_grid_attach(GtkGrid * grid,
gtk_widget_set_margin_start(child, INDENT_WIDTH);
gtk_widget_set_hexpand(child, TRUE);
}
- if (GTK_IS_LABEL(child)) {
-#if GTK_CHECK_VERSION(3, 16, 0)
+ if (GTK_IS_LABEL(child))
gtk_label_set_xalign((GtkLabel *) child, 0.0);
-#else
- gtk_widget_set_halign(child, GTK_ALIGN_START);
-#endif
- }
gtk_grid_attach(grid, child, left, top, width, height);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]