[Commits] [SCM] claws branch, master, updated. 3.16.0-188-g6ad6816

wwp at claws-mail.org wwp at claws-mail.org
Mon May 28 17:45:26 CEST 2018


The branch, master has been updated
       via  6ad681664a23b9268016e779a94f83413127ad98 (commit)
      from  5a6f38fbc4c27229cc2fe8d7d6d878d7354e8d1b (commit)

Summary of changes:
 src/common/utils.c                        |   18 ------------------
 src/common/utils.h                        |   13 -------------
 src/gtk/gtkutils.c                        |    2 +-
 src/gtk/gtkutils.h                        |    2 +-
 src/plugins/libravatar/libravatar.c       |    2 +-
 src/plugins/libravatar/libravatar_prefs.c |   10 +++++-----
 src/plugins/libravatar/libravatar_prefs.h |    2 +-
 src/plugins/vcalendar/vcal_dbus.c         |   13 -------------
 src/prefs_account.c                       |    6 +++---
 src/wizard.c                              |   16 ++++++++--------
 10 files changed, 20 insertions(+), 64 deletions(-)


- Log -----------------------------------------------------------------
commit 6ad681664a23b9268016e779a94f83413127ad98
Author: wwp <wwp at free.fr>
Date:   Mon May 28 17:44:59 2018 +0200

    Code cleanup around glib version check (2.28 minimum).

diff --git a/src/common/utils.c b/src/common/utils.c
index 5172982..0a7f421 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -90,24 +90,6 @@
 
 static gboolean debug_mode = FALSE;
 
-#if !GLIB_CHECK_VERSION(2, 26, 0)
-guchar *g_base64_decode_wa(const gchar *text, gsize *out_len)
-{
-	guchar *ret;
-	gsize input_length;
-	gint state = 0;
-	guint save = 0;
-
-	input_length = strlen(text);
-
-	ret = g_malloc0((input_length / 4) * 3 + 1);
-
-	*out_len = g_base64_decode_step(text, input_length, ret, &state, &save);
-
-	return ret;
-}
-#endif
-
 /* Return true if we are running as root.  This function should beused
    instead of getuid () == 0.  */
 gboolean superuser_p (void)
diff --git a/src/common/utils.h b/src/common/utils.h
index b37495e..a1f356e 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -74,19 +74,6 @@ typedef gint64 goffset;
   #define HAVE_U32_TYPEDEF
 #endif
 
-#if !GLIB_CHECK_VERSION(2, 26, 0)
-#define g_base64_decode(t,l)	g_base64_decode_wa((t),(l))
-guchar *g_base64_decode_wa(const gchar *text, gsize *out_len);
-#endif
-
-#if !GLIB_CHECK_VERSION(2, 25, 0)
-# ifdef G_OS_WIN32
-	typedef _g_stat_struct GStatBuf;
-# else
-	typedef struct stat GStatBuf;
-# endif
-#endif
-
 #ifndef BIG_ENDIAN_HOST
   #if (G_BYTE_ORDER == G_BIG_ENDIAN)
     #define BIG_ENDIAN_HOST 1
diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 5165ff1..89d092c 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -1807,7 +1807,7 @@ GdkPixbuf *claws_load_pixbuf_fitting(GdkPixbuf *src_pixbuf, int box_width,
 	return pixbuf;
 }
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 static void auto_configure_done(const gchar *hostname, gint port, gboolean ssl, AutoConfigureData *data)
 {
 	gboolean smtp = strcmp(data->tls_service, "submission") == 0 ? TRUE : FALSE;
diff --git a/src/gtk/gtkutils.h b/src/gtk/gtkutils.h
index 592e575..b290bb6 100644
--- a/src/gtk/gtkutils.h
+++ b/src/gtk/gtkutils.h
@@ -205,7 +205,7 @@ claws_input_add    (gint	      source,
 	}									\
 }
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 typedef struct _AutoConfigureData {
 	const gchar *ssl_service;
 	const gchar *tls_service;
diff --git a/src/plugins/libravatar/libravatar.c b/src/plugins/libravatar/libravatar.c
index f07c6a2..de5100a 100644
--- a/src/plugins/libravatar/libravatar.c
+++ b/src/plugins/libravatar/libravatar.c
@@ -79,7 +79,7 @@ static gboolean libravatar_header_update_hook(gpointer source, gpointer data)
 
 static gchar *federated_base_url_from_address(const gchar *address)
 {
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	gchar *base_url = NULL;
 
 	if (!libravatarprefs.allow_federated) {
diff --git a/src/plugins/libravatar/libravatar_prefs.c b/src/plugins/libravatar/libravatar_prefs.c
index 84e4fd9..3183def 100644
--- a/src/plugins/libravatar/libravatar_prefs.c
+++ b/src/plugins/libravatar/libravatar_prefs.c
@@ -58,7 +58,7 @@ struct LibravatarPrefsPage
 	GtkWidget *defm_radio[NUM_DEF_BUTTONS];
 	GtkWidget *defm_url_text;
 	GtkWidget *allow_redirects_check;
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	GtkWidget *allow_federated_check;
 #endif
 	GtkWidget *timeout;
@@ -85,7 +85,7 @@ static PrefParam param[] = {
 	{ "allow_redirects", "TRUE",
 	  &libravatarprefs.allow_redirects,
           P_BOOL, NULL, NULL, NULL },
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	{ "allow_federated", "TRUE",
 	  &libravatarprefs.allow_federated,
           P_BOOL, NULL, NULL, NULL },
@@ -373,7 +373,7 @@ static GtkWidget *p_create_frame_network(struct LibravatarPrefsPage *page)
 {
 	GtkWidget *vbox, *chk_redirects, *spinner, *hbox;
 	GtkAdjustment *adj;
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	GtkWidget *chk_federated;
 #endif
 
@@ -388,7 +388,7 @@ static GtkWidget *p_create_frame_network(struct LibravatarPrefsPage *page)
 	page->allow_redirects_check = chk_redirects;
 	gtk_box_pack_start(GTK_BOX(vbox), chk_redirects, FALSE, FALSE, 0);
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	chk_federated = create_checkbox(_("_Enable federated servers"),
 				_("Try to get avatar from sender's domain "
 				  "libravatar server"));
@@ -526,7 +526,7 @@ static void libravatar_prefs_save_func(PrefsPage * _page)
 	libravatarprefs.allow_redirects = gtk_toggle_button_get_active(
 		GTK_TOGGLE_BUTTON(page->allow_redirects_check));
 	/* federation */
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	libravatarprefs.allow_federated = gtk_toggle_button_get_active(
 		GTK_TOGGLE_BUTTON(page->allow_federated_check));
 #endif
diff --git a/src/plugins/libravatar/libravatar_prefs.h b/src/plugins/libravatar/libravatar_prefs.h
index 2e81aff..49be964 100644
--- a/src/plugins/libravatar/libravatar_prefs.h
+++ b/src/plugins/libravatar/libravatar_prefs.h
@@ -44,7 +44,7 @@ struct _LibravatarPrefs
 	guint		default_mode;
 	gchar		*default_mode_url;
 	gboolean	allow_redirects;
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	gboolean	allow_federated;
 #endif
 	guint		timeout;
diff --git a/src/plugins/vcalendar/vcal_dbus.c b/src/plugins/vcalendar/vcal_dbus.c
index c716031..f609872 100644
--- a/src/plugins/vcalendar/vcal_dbus.c
+++ b/src/plugins/vcalendar/vcal_dbus.c
@@ -34,8 +34,6 @@
 #include "vcal_manager.h"
 #include "vcal_folder.h"
 
-#if(GLIB_CHECK_VERSION(2,26,0))
-
 static guint dbus_own_id;
 
 static void add_event_to_builder_if_match(VCalEvent *event, GVariantBuilder *array,
@@ -208,14 +206,3 @@ void disconnect_dbus(void)
 	g_free(interface_vtable);
 	interface_vtable = NULL;
 }
-
-#else
-void connect_dbus(void)
-{
-	debug_print("DBUS calendar export is not supported with Glib < 2.26\n");
-}
-void disconnect_dbus(void)
-{
-	debug_print("DBUS calendar export is not supported with Glib < 2.26\n");
-}
-#endif
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 86bfe81..6701400 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -915,7 +915,7 @@ static void prefs_account_signature_edit_cb	(GtkWidget	*widget,
 static void pop_bfr_smtp_tm_set_sens		(GtkWidget	*widget,
 						 gpointer	 data);
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if (defined USE_GNUTLS)
 static void auto_configure_cb			(GtkWidget	*widget,
 						 gpointer	 data);
 
@@ -1139,7 +1139,7 @@ static void basic_create_widget_func(PrefsPage * _page,
 	auto_configure_lbl = gtk_label_new("");
 	gtk_label_set_justify(GTK_LABEL(auto_configure_lbl), GTK_JUSTIFY_LEFT);
 	gtk_box_pack_start(GTK_BOX (optmenubox), auto_configure_lbl, FALSE, FALSE, 0);
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if (defined USE_GNUTLS)
 	gtk_widget_show(auto_configure_btn);
 	gtk_widget_show(auto_configure_lbl);
 	g_signal_connect (G_OBJECT (auto_configure_btn), "clicked",
@@ -3992,7 +3992,7 @@ static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data)
 	}
 }
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if (defined USE_GNUTLS)
 static void auto_configure_cb (GtkWidget *widget, gpointer data)
 {
 	gchar *address = NULL;
diff --git a/src/wizard.c b/src/wizard.c
index d48fab8..68da688 100644
--- a/src/wizard.c
+++ b/src/wizard.c
@@ -112,7 +112,7 @@ typedef struct
 	GtkWidget *smtp_cert_table;
 	GtkWidget *recv_cert_table;
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	GtkWidget *auto_configure_lbl;
 	GtkWidget *auto_configure_btn;
 	GtkWidget *auto_configure_cancel_btn;
@@ -1248,7 +1248,7 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
 		gtk_widget_show(wizard->recv_use_tls);
 		gtk_widget_show(wizard->recv_cert_table);
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 		gtk_widget_show(wizard->auto_configure_btn);
 		gtk_widget_hide(wizard->auto_configure_cancel_btn);
 		gtk_widget_show(wizard->auto_configure_lbl);
@@ -1280,7 +1280,7 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
 		gtk_widget_show(wizard->recv_use_tls);
 		gtk_widget_show(wizard->recv_cert_table);
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 		gtk_widget_show(wizard->auto_configure_btn);
 		gtk_widget_hide(wizard->auto_configure_cancel_btn);
 		gtk_widget_show(wizard->auto_configure_lbl);
@@ -1329,7 +1329,7 @@ static void wizard_protocol_change(WizardWindow *wizard, RecvProtocol protocol)
 		gtk_widget_hide(wizard->recv_password);
 		gtk_widget_hide(wizard->recv_username_label);
 		gtk_widget_hide(wizard->recv_password_label);
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 		gtk_widget_hide(wizard->auto_configure_btn);
 		gtk_widget_hide(wizard->auto_configure_cancel_btn);
 		gtk_widget_hide(wizard->auto_configure_lbl);
@@ -1355,7 +1355,7 @@ static void wizard_protocol_changed(GtkComboBox *combo, gpointer data)
 	wizard_protocol_change(wizard, protocol);	
 }
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 static void auto_configure_cb (GtkWidget *widget, gpointer data)
 {
 	gchar *address = NULL;
@@ -1464,7 +1464,7 @@ static GtkWidget* recv_page (WizardWindow * wizard)
 	GtkWidget *button;
 	GtkWidget *recv_cert_table;
 #endif
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	GtkWidget *auto_configure_btn;
 	GtkWidget *auto_configure_cancel_btn;
 	GtkWidget *auto_configure_lbl;
@@ -1520,7 +1520,7 @@ static GtkWidget* recv_page (WizardWindow * wizard)
 	gtk_table_attach(GTK_TABLE(recv_table), wizard->recv_type, 1,2,0,1, 
 			 GTK_EXPAND|GTK_FILL, 0, 0, 0);
 
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	auto_configure_btn = gtk_button_new_with_label(_("Auto-configure"));
 	auto_configure_cancel_btn = gtk_button_new_with_label(_("Cancel"));
 	gtk_table_attach(GTK_TABLE(recv_table), auto_configure_btn, 0,1,1,2,
@@ -1926,7 +1926,7 @@ gboolean run_wizard(MainWindow *mainwin, gboolean create_mailbox) {
 	gtk_widget_hide(wizard->recv_imap_label);
 	gtk_widget_hide(wizard->recv_imap_subdir);
 	gtk_widget_hide(wizard->subsonly_checkbtn);
-#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+#if defined USE_GNUTLS
 	gtk_widget_hide(wizard->auto_configure_cancel_btn);
 #endif
 	wizard_protocol_change(wizard, tmpl.recvtype);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list