[balsa/gtk3] Clean up dead code and trailing white space



commit fe488346faf6f1b357a550fe14d45d508efc2c7d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Dec 28 21:28:25 2010 -0500

    Clean up dead code and trailing white space

 ChangeLog                        |   19 ++
 libbalsa/address.c               |   42 ++---
 libbalsa/identity.c              |  209 ++++++++++-----------
 libinit_balsa/assistant_helper.c |   19 +--
 src/ab-window.c                  |   65 +++----
 src/balsa-index.c                |   70 +++----
 src/balsa-mblist.c               |   67 +++----
 src/balsa-message.c              |  223 ++++++++++-------------
 src/main-window.c                |  234 ++++++++++--------------
 src/sendmsg-window.c             |  377 +++++++++++++++++---------------------
 src/toolbar-factory.c            |   27 +--
 11 files changed, 614 insertions(+), 738 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 682f591..1dfb83f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2010-12-28  Peter Bloomfield
 
+	Clean up dead code and trailing white space
+
+	* libbalsa/address.c (addrlist_drag_drop_cb):
+	* libbalsa/identity.c (ident_dialog_get_path):
+	* libinit_balsa/assistant_helper.c (entry_changed_cb):
+	* src/ab-window.c (balsa_ab_window_init):
+	* src/balsa-index.c (bndx_string_width),
+	(bndx_popup_position_func):
+	* src/balsa-mblist.c (bmbl_drag_motion), (bmbl_drag_cb):
+	* src/balsa-message.c (bm_find_pass_to_entry),
+	(balsa_get_parent_window), (balsa_message_grab_focus):
+	* src/main-window.c:
+	* src/sendmsg-window.c (drag_data_quote), (subject_not_empty),
+	(check_suggest_encryption):
+	* src/toolbar-factory.c (tm_popup_position_func),
+	(tm_do_popup_menu):
+
+2010-12-28  Peter Bloomfield
+
 	Do not support BonoboActivation
 
 	* src/balsa-bonobo.c: deleted.
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 6dcf138..ed7a254 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -6,17 +6,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -578,7 +578,7 @@ rfc2822_group(const gchar *full_name, GList *addr_list)
     return res;
 }
 
-/* 
+/*
    Get a string version of this address.
 
    If n == -1 then return all addresses, else return the n'th one.
@@ -617,7 +617,7 @@ lba_get_name_or_mailbox(InternetAddressList * address_list,
     const gchar *retval = NULL;
     InternetAddress *ia;
     gint i, len;
-    
+
     if (address_list == NULL)
 	return NULL;
 
@@ -730,7 +730,7 @@ libbalsa_address_set_edit_entries(const LibBalsaAddress * address,
 		;
 
 	    /* get first name */
-	    first_name = g_strdup(address->first_name 
+	    first_name = g_strdup(address->first_name
                                   ? address->first_name : names[0]);
 
 	    /* get last name */
@@ -794,7 +794,7 @@ libbalsa_address_set_edit_entries(const LibBalsaAddress * address,
 
 /** libbalsa_address_get_edit_widget() returns an widget adapted
     for a LibBalsaAddress edition, with initial values set if address
-    is provided. The edit entries are set in entries array 
+    is provided. The edit entries are set in entries array
     and enumerated with LibBalsaAddressField constants
 */
 static void
@@ -900,10 +900,10 @@ addrlist_drag_received_cb(GtkWidget * widget, GdkDragContext * context,
         default: g_print ("nothing good");
         }
     }
-    
+
     if (!dnd_success)
         g_print ("DnD data transfer failed!\n");
-        
+
     gtk_drag_finish(context, dnd_success, FALSE, time);
 }
 
@@ -914,24 +914,20 @@ addrlist_drag_drop_cb(GtkWidget *widget, GdkDragContext *context,
   gboolean        is_valid_drop_site;
   GdkAtom         target_type;
   GList          *targets;
-        
+
   /* Check to see if (x,y) is a valid drop site within widget */
   is_valid_drop_site = TRUE;
-        
+
   /* If the source offers a target */
-#if GTK_CHECK_VERSION(2,22,0)
   targets = gdk_drag_context_list_targets(context);
-#else
-  targets = context->targets;
-#endif
   if (targets) {
       /* Choose the best target type */
-      target_type = GDK_POINTER_TO_ATOM 
+      target_type = GDK_POINTER_TO_ATOM
         (g_list_nth_data (targets, LIBBALSA_ADDRESS_TRG_ADDRESS));
-                
+
       /* Request the data from the source. */
       printf("drag_drop requests target=%p\n", target_type);
-      gtk_drag_get_data 
+      gtk_drag_get_data
         (
          widget,         /* will receive 'drag-data-received' signal */
          context,        /* represents the current state of the DnD */
@@ -941,7 +937,7 @@ addrlist_drag_drop_cb(GtkWidget *widget, GdkDragContext *context,
   } else {
       is_valid_drop_site = FALSE;
   }
-     
+
   return  is_valid_drop_site;
 }
 
@@ -987,7 +983,7 @@ libbalsa_address_get_edit_widget(const LibBalsaAddress *address,
              gtk_drag_dest_set(entries[cnt],
                                GTK_DEST_DEFAULT_MOTION |
                                GTK_DEST_DEFAULT_HIGHLIGHT,
-                               libbalsa_address_target_list,            
+                               libbalsa_address_target_list,
                                2,              /* size of list */
                                GDK_ACTION_COPY);
             g_signal_connect(G_OBJECT(entries[cnt]), "drag-data-received",
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 59c9c18..11af7df 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -74,7 +74,7 @@ libbalsa_identity_get_type()
                                    "LibBalsaIdentity",
                                    &libbalsa_identity_info, 0);
     }
-    
+
     return libbalsa_identity_type;
 }
 
@@ -89,7 +89,7 @@ libbalsa_identity_class_init(LibBalsaIdentityClass* klass)
     object_class->finalize = libbalsa_identity_finalize;
 }
 
-/* 
+/*
  * Instance inititialization function: set defaults for new objects.
  */
 static void
@@ -123,7 +123,7 @@ libbalsa_identity_init(LibBalsaIdentity* ident)
     */
 }
 
-/* 
+/*
  * Destroy the object, freeing all the values in the process.
  */
 static void
@@ -155,12 +155,12 @@ libbalsa_identity_finalize(GObject * object)
  * Public methods.
  */
 
-/* 
+/*
  * Create a new object with the default identity name.  Does not add
  * it to the list of identities for the application.
  */
-GObject* 
-libbalsa_identity_new(void) 
+GObject*
+libbalsa_identity_new(void)
 {
     return libbalsa_identity_new_with_name(_("New Identity"));
 }
@@ -174,7 +174,7 @@ GObject*
 libbalsa_identity_new_with_name(const gchar* ident_name)
 {
     LibBalsaIdentity* ident;
-    
+
     ident = g_object_new(LIBBALSA_TYPE_IDENTITY, NULL);
     libbalsa_identity_set_identity_name(ident, ident_name);
 
@@ -186,7 +186,7 @@ void
 libbalsa_identity_set_identity_name(LibBalsaIdentity* ident, const gchar* name)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->identity_name);
     ident->identity_name = g_strdup(name);
 }
@@ -208,7 +208,7 @@ void
 libbalsa_identity_set_replyto(LibBalsaIdentity* ident, const gchar* address)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->replyto);
     ident->replyto = g_strdup(address);
 }
@@ -218,23 +218,23 @@ void
 libbalsa_identity_set_domain(LibBalsaIdentity* ident, const gchar* dom)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->domain);
     ident->domain = g_strdup(dom);
 }
 
 
-void 
+void
 libbalsa_identity_set_bcc(LibBalsaIdentity* ident, const gchar* bcc)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->bcc);
     ident->bcc = g_strdup(bcc);
 }
 
 
-void 
+void
 libbalsa_identity_set_reply_string(LibBalsaIdentity* ident, const gchar* reply)
 {
     g_return_if_fail(ident != NULL);
@@ -244,11 +244,11 @@ libbalsa_identity_set_reply_string(LibBalsaIdentity* ident, const gchar* reply)
 }
 
 
-void 
+void
 libbalsa_identity_set_forward_string(LibBalsaIdentity* ident, const gchar* forward)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->forward_string);
     ident->forward_string = g_strdup(forward);
 }
@@ -266,7 +266,7 @@ void
 libbalsa_identity_set_signature_path(LibBalsaIdentity* ident, const gchar* path)
 {
     g_return_if_fail(ident != NULL);
-    
+
     g_free(ident->signature_path);
     ident->signature_path = g_strdup(path);
 }
@@ -296,7 +296,7 @@ libbalsa_identity_set_sig_whenforward(LibBalsaIdentity* ident, gboolean forward)
 }
 
 
-void 
+void
 libbalsa_identity_set_sig_whenreply(LibBalsaIdentity* ident, gboolean reply)
 {
     g_return_if_fail(ident != NULL);
@@ -312,7 +312,7 @@ libbalsa_identity_set_sig_separator(LibBalsaIdentity* ident, gboolean separator)
 }
 
 
-void 
+void
 libbalsa_identity_set_sig_prepend(LibBalsaIdentity* ident, gboolean prepend)
 {
     g_return_if_fail(ident != NULL);
@@ -445,7 +445,7 @@ enum {
     N_COLUMNS
 };
 
-/* 
+/*
  * Public method: create and show the dialog.
  */
 #define LIBBALSA_IDENTITY_SELECT_DIALOG_KEY "libbalsa-identity-select-dialog"
@@ -487,7 +487,7 @@ libbalsa_identity_select_dialog(GtkWindow * parent,
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, parent);
 #endif
- 
+
     g_signal_connect(dialog, "response",
                      G_CALLBACK(sd_response_cb), sdi);
     gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
@@ -622,9 +622,9 @@ static void config_dialog_select(GtkTreeSelection * selection,
                                  GtkDialog * dialog);
 
 static void display_frame_update(GObject * dialog, LibBalsaIdentity* ident);
-static void display_frame_set_field(GObject * dialog, const gchar* key, 
+static void display_frame_set_field(GObject * dialog, const gchar* key,
                                     const gchar* value);
-static void display_frame_set_boolean(GObject * dialog, const gchar* key, 
+static void display_frame_set_boolean(GObject * dialog, const gchar* key,
                                       gboolean value);
 static void display_frame_set_path(GObject * dialog, const gchar * key,
                                    const gchar * value, gboolean use_chooser);
@@ -737,7 +737,7 @@ libbalsa_identity_tree(GCallback toggled_cb, gpointer toggled_data,
  * the application and a number of buttons to edit, create, and delete
  * identities.  Also provides a way to set the default identity.
  */
-static GtkWidget* 
+static GtkWidget*
 libbalsa_identity_config_frame(GList** identities,
 			       LibBalsaIdentity** defid, GtkWidget * dialog,
                                void (*cb)(gpointer), gpointer data)
@@ -746,7 +746,7 @@ libbalsa_identity_config_frame(GList** identities,
     GtkWidget *tree;
 
     gtk_container_set_border_width(GTK_CONTAINER(config_frame), 0);
-    
+
     tree = libbalsa_identity_tree(G_CALLBACK(toggle_cb), dialog,
                                   _("Default"));
     g_signal_connect(tree, "row-activated",
@@ -797,7 +797,7 @@ identity_list_update_real(GtkTreeView * tree,
     current = get_selected_identity(tree);
 
     gtk_list_store_clear(store);
-    
+
     sorted = g_list_sort(g_list_copy(identities),
                          (GCompareFunc) compare_identities);
     for (list = sorted; list; list = g_list_next(list)) {
@@ -821,12 +821,12 @@ select_identity(GtkTreeView * tree, LibBalsaIdentity * identity)
     GtkTreeModel *model = gtk_tree_view_get_model(tree);
     GtkTreeIter iter;
     gboolean valid;
-    
+
     for (valid = gtk_tree_model_get_iter_first(model, &iter);
          valid;
          valid = gtk_tree_model_iter_next(model, &iter)) {
         LibBalsaIdentity *tmp;
-        
+
         gtk_tree_model_get(model, &iter, IDENT_COLUMN, &tmp, -1);
         if (identity == tmp) {
             GtkTreePath *path = gtk_tree_model_get_path(model, &iter);
@@ -860,7 +860,7 @@ enum {
     IDENTITY_RESPONSE_NEW,
     IDENTITY_RESPONSE_REMOVE
 };
-    
+
 /* callback for the "changed" signal */
 static void
 config_frame_button_select_cb(GtkTreeSelection * selection,
@@ -930,7 +930,7 @@ append_ident_notebook_page(GtkNotebook *notebook, guint rows,
         gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new(footnote),
                            FALSE, FALSE, 0);
     gtk_notebook_append_page(notebook, vbox, gtk_label_new(tab_label));
-    
+
     return table;
 }
 
@@ -983,30 +983,30 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree)
     /* create the "General" tab */
     table = append_ident_notebook_page(notebook, 5, _("General"), NULL);
     row = 0;
-    ident_dialog_add_entry(table, row++, dialog, _("_Identity name:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("_Identity name:"),
 		           "identity-name");
-    ident_dialog_add_entry(table, row++, dialog, _("_Full name:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("_Full name:"),
                            "identity-fullname");
-    ident_dialog_add_entry(table, row++, dialog, _("_Mailing address:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("_Mailing address:"),
                            "identity-address");
-    ident_dialog_add_entry(table, row++, dialog, _("Reply _to:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("Reply _to:"),
                            "identity-replyto");
-    ident_dialog_add_entry(table, row++, dialog, _("_Domain:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("_Domain:"),
                            "identity-domain");
 
     /* create the "Messages" tab */
     table = append_ident_notebook_page(notebook, 9, _("Messages"), NULL);
     row = 0;
-    ident_dialog_add_entry(table, row++, dialog, _("_Bcc:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("_Bcc:"),
                            "identity-bcc");
-    ident_dialog_add_entry(table, row++, dialog, _("Reply _string:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("Reply _string:"),
                            "identity-replystring");
-    ident_dialog_add_entry(table, row++, dialog, _("F_orward string:"), 
+    ident_dialog_add_entry(table, row++, dialog, _("F_orward string:"),
                            "identity-forwardstring");
-    ident_dialog_add_checkbutton(table, row++, dialog, 
+    ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("send messages in both plain text and _HTML format"),
                                  "identity-sendmpalternative", TRUE);
-    ident_dialog_add_checkbutton(table, row++, dialog, 
+    ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("request _Message Disposition Notification by default"),
                                  "identity-requestmdn", TRUE);
     ident_dialog_add_file_chooser_button(table, row++, dialog,
@@ -1031,15 +1031,15 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree)
                                 _("_Execute signature"),
 				 "identity-sigexecutable", FALSE);
     ident_dialog_add_checkbutton(table, row++, dialog,
-                                 _("Incl_ude signature"), 
+                                 _("Incl_ude signature"),
                                  "identity-sigappend", FALSE);
-    ident_dialog_add_checkbutton(table, row++, dialog, 
+    ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("Include signature when for_warding"),
                                  "identity-whenforward", FALSE);
     ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("Include signature when rep_lying"),
                                  "identity-whenreply", FALSE);
-    ident_dialog_add_checkbutton(table, row++, dialog, 
+    ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("_Add signature separator"),
                                  "identity-sigseparator", FALSE);
     ident_dialog_add_checkbutton(table, row++, dialog,
@@ -1056,7 +1056,7 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree)
     table =
         append_ident_notebook_page(notebook, 5, _("Security"), footnote);
     row = 0;
-    ident_dialog_add_checkbutton(table, row++, dialog, 
+    ident_dialog_add_checkbutton(table, row++, dialog,
                                  _("sign messages by default"),
                                  "identity-gpgsign", TRUE);
     ident_dialog_add_checkbutton(table, row++, dialog,
@@ -1072,7 +1072,7 @@ setup_ident_frame(GtkDialog * dialog, gboolean createp, gpointer tree)
                                  _("remind me if messages can be encrypted"),
                                  "identity-warn-send-plain", TRUE);
     ident_dialog_add_entry(table, row++, dialog,
-                           _("use secret key with this id for signing\n(leave empty for automatic selection)"), 
+                           _("use secret key with this id for signing\n(leave empty for automatic selection)"),
                            "identity-keyid");
 #ifndef HAVE_GPGME
     gtk_widget_set_sensitive(table, FALSE);
@@ -1398,7 +1398,7 @@ set_identity_name_in_tree(GtkTreeView * tree, LibBalsaIdentity * identity,
     }
 }
 
-/* 
+/*
  * Update the identity object associated with the edit/new dialog,
  * validating along the way.  Correct validation results in a true
  * return value, otherwise it returns false.
@@ -1413,7 +1413,7 @@ ident_dialog_update(GObject * dlg)
     GtkWidget *tree;
     GList **identities, *list;
     gchar* text;
-    
+
     id = g_object_get_data(dlg, "identity");
     if (!id)
         return TRUE;
@@ -1431,7 +1431,7 @@ ident_dialog_update(GObject * dlg)
 
     for (list = *identities; list; list = g_list_next(list)) {
         exist_ident = list->data;
-        
+
         if (g_ascii_strcasecmp(exist_ident->identity_name, text) == 0
             && id != exist_ident) {
             libbalsa_information(LIBBALSA_INFORMATION_ERROR,
@@ -1457,7 +1457,7 @@ ident_dialog_update(GObject * dlg)
     g_free(id->replyto);
     id->replyto         = ident_dialog_get_text(dlg, "identity-replyto");
     g_free(id->domain);
-    id->domain          = ident_dialog_get_text(dlg, "identity-domain");    
+    id->domain          = ident_dialog_get_text(dlg, "identity-domain");
     g_free(id->bcc);
     id->bcc             = ident_dialog_get_text(dlg, "identity-bcc");
     g_free(id->reply_string);
@@ -1473,14 +1473,14 @@ ident_dialog_update(GObject * dlg)
 
     g_free(id->signature_path);
     id->signature_path  = ident_dialog_get_text(dlg, "identity-sigpath");
-    
+
     id->sig_executable  = ident_dialog_get_bool(dlg, "identity-sigexecutable");
     id->sig_sending     = ident_dialog_get_bool(dlg, "identity-sigappend");
     id->sig_whenforward = ident_dialog_get_bool(dlg, "identity-whenforward");
     id->sig_whenreply   = ident_dialog_get_bool(dlg, "identity-whenreply");
     id->sig_separator   = ident_dialog_get_bool(dlg, "identity-sigseparator");
     id->sig_prepend     = ident_dialog_get_bool(dlg, "identity-sigprepend");
-   
+
     g_free(id->face);
     id->face            = ident_dialog_get_path(dlg, "identity-facepath");
     g_free(id->x_face);
@@ -1495,12 +1495,12 @@ ident_dialog_update(GObject * dlg)
                                           (dlg, "identity-crypt-protocol"));
     g_free(id->force_key_id);
     id->force_key_id    = g_strstrip(ident_dialog_get_text(dlg, "identity-keyid"));
-   
+
     return TRUE;
 }
 
 
-/* 
+/*
  * Get the text from an entry in the editing/creation dialog.  The
  * given key accesses the entry using object data.
  */
@@ -1509,7 +1509,7 @@ ident_dialog_get_text(GObject * dialog, const gchar * key)
 {
     GtkEditable *entry;
     GtkToggleButton *check;
-    
+
     entry = g_object_get_data(dialog, key);
     check = g_object_get_data(G_OBJECT(entry), LIBBALSA_IDENTITY_CHECK);
     if (check && !gtk_toggle_button_get_active(check))
@@ -1527,13 +1527,13 @@ static gboolean
 ident_dialog_get_bool(GObject* dialog, const gchar* key)
 {
     GtkToggleButton *button;
-    
+
     button = g_object_get_data(dialog, key);
     return gtk_toggle_button_get_active(button);
 }
 
 
-/* 
+/*
  * Get the path from a file chooser in the editing/creation dialog.  The
  * given key accesses the file chooser using object data.
  */
@@ -1543,19 +1543,14 @@ ident_dialog_get_path(GObject * dialog, const gchar * key)
     GtkWidget *chooser;
 
     chooser = g_object_get_data(dialog, key);
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (!gtk_widget_get_sensitive(chooser))
         return NULL;
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    if (!GTK_WIDGET_SENSITIVE(chooser))
-        return NULL;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     return gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
 }
 
 
-/* 
+/*
  * Set the default identity to the currently selected.
  */
 static void
@@ -1613,8 +1608,8 @@ identity_delete_selected(GtkTreeView * tree, GtkWidget * dialog)
     cb(data);
 }
 
-/* 
- * Delete the currently selected identity after confirming. 
+/*
+ * Delete the currently selected identity after confirming.
  */
 struct _IdentityDeleteInfo {
     GtkTreeView *tree;
@@ -1626,7 +1621,7 @@ delete_ident_cb(GtkTreeView * tree, GtkWidget * dialog)
     LibBalsaIdentity* ident, **default_id;
     GtkWidget* confirm;
     IdentityDeleteInfo *di;
-    
+
     ident = get_selected_identity(tree);
     default_id = g_object_get_data(G_OBJECT(tree), "default-id");
     g_return_if_fail(ident != *default_id);
@@ -1649,7 +1644,7 @@ delete_ident_cb(GtkTreeView * tree, GtkWidget * dialog)
     gtk_widget_show_all(confirm);
 }
 
-static void 
+static void
 delete_ident_response(GtkWidget * confirm, gint response,
                       IdentityDeleteInfo * di)
 {
@@ -1815,7 +1810,7 @@ config_dialog_select(GtkTreeSelection * selection, GtkDialog * dialog)
     g_object_set_data(G_OBJECT(dialog), "identity", ident);
 }
 
-static void 
+static void
 display_frame_update(GObject * dialog, LibBalsaIdentity* ident)
 {
     GtkWidget *face_box;
@@ -1827,17 +1822,17 @@ display_frame_update(GObject * dialog, LibBalsaIdentity* ident)
     display_frame_set_field(dialog, "identity-name", ident->identity_name);
     display_frame_set_field(dialog, "identity-fullname", ident->ia ? ident->ia->name : NULL);
     if (ident->ia && INTERNET_ADDRESS_IS_MAILBOX (ident->ia))
-        display_frame_set_field(dialog, "identity-address", 
+        display_frame_set_field(dialog, "identity-address",
                                 INTERNET_ADDRESS_MAILBOX(ident->ia)->addr);
     else
         display_frame_set_field(dialog, "identity-address", NULL);
-    
+
     display_frame_set_field(dialog, "identity-replyto", ident->replyto);
     display_frame_set_field(dialog, "identity-domain", ident->domain);
     display_frame_set_field(dialog, "identity-bcc", ident->bcc);
-    display_frame_set_field(dialog, "identity-replystring", 
+    display_frame_set_field(dialog, "identity-replystring",
                             ident->reply_string);
-    display_frame_set_field(dialog, "identity-forwardstring", 
+    display_frame_set_field(dialog, "identity-forwardstring",
                             ident->forward_string);
     display_frame_set_boolean(dialog, "identity-sendmpalternative",
                               ident->send_mp_alternative);
@@ -1846,19 +1841,19 @@ display_frame_update(GObject * dialog, LibBalsaIdentity* ident)
                              ident->smtp_server);
 #endif /* ENABLE_ESMTP */
 
-    display_frame_set_path(dialog, "identity-sigpath", 
+    display_frame_set_path(dialog, "identity-sigpath",
                            ident->signature_path, FALSE);
     display_frame_set_boolean(dialog, "identity-sigexecutable", ident->sig_executable);
 
     display_frame_set_boolean(dialog, "identity-sigappend", ident->sig_sending);
-    display_frame_set_boolean(dialog, "identity-whenforward", 
+    display_frame_set_boolean(dialog, "identity-whenforward",
                               ident->sig_whenforward);
-    display_frame_set_boolean(dialog, "identity-whenreply", 
+    display_frame_set_boolean(dialog, "identity-whenreply",
                               ident->sig_whenreply);
-    display_frame_set_boolean(dialog, "identity-sigseparator", 
-                              ident->sig_separator);    
-    display_frame_set_boolean(dialog, "identity-sigprepend", 
-                              ident->sig_prepend);    
+    display_frame_set_boolean(dialog, "identity-sigseparator",
+                              ident->sig_separator);
+    display_frame_set_boolean(dialog, "identity-sigprepend",
+                              ident->sig_prepend);
 
     face_box = g_object_get_data(G_OBJECT(dialog),
                                  path_info[LBI_PATH_TYPE_FACE].box_key);
@@ -1871,17 +1866,17 @@ display_frame_update(GObject * dialog, LibBalsaIdentity* ident)
     gtk_widget_hide(face_box);
     display_frame_set_path(dialog, path_info[LBI_PATH_TYPE_XFACE].path_key,
                            ident->x_face, TRUE);
-    display_frame_set_boolean(dialog, "identity-requestmdn", 
-                              ident->request_mdn);    
-
-    display_frame_set_boolean(dialog, "identity-gpgsign", 
-                              ident->gpg_sign);    
-    display_frame_set_boolean(dialog, "identity-gpgencrypt", 
-                              ident->gpg_encrypt);    
-    display_frame_set_boolean(dialog, "identity-trust-always", 
-                              ident->always_trust);    
-    display_frame_set_boolean(dialog, "identity-warn-send-plain", 
-                              ident->warn_send_plain);    
+    display_frame_set_boolean(dialog, "identity-requestmdn",
+                              ident->request_mdn);
+
+    display_frame_set_boolean(dialog, "identity-gpgsign",
+                              ident->gpg_sign);
+    display_frame_set_boolean(dialog, "identity-gpgencrypt",
+                              ident->gpg_encrypt);
+    display_frame_set_boolean(dialog, "identity-trust-always",
+                              ident->always_trust);
+    display_frame_set_boolean(dialog, "identity-warn-send-plain",
+                              ident->warn_send_plain);
     display_frame_set_gpg_mode(dialog, "identity-crypt-protocol",
 			   &ident->crypt_protocol);
     display_frame_set_field(dialog, "identity-keyid", ident->force_key_id);
@@ -1894,7 +1889,7 @@ display_frame_set_field(GObject * dialog,
                         const gchar* value)
 {
     GtkEntry *entry = g_object_get_data(dialog, key);
-    
+
     gtk_entry_set_text(entry, value ? value : "");
 }
 
@@ -1904,7 +1899,7 @@ display_frame_set_boolean(GObject * dialog,
                           gboolean value)
 {
     GtkToggleButton *check = g_object_get_data(dialog, key);
-    
+
     gtk_toggle_button_set_active(check, value);
 }
 
@@ -1917,7 +1912,7 @@ display_frame_set_path(GObject * dialog,
     GtkWidget *chooser = g_object_get_data(dialog, key);
     GtkToggleButton *check =
         g_object_get_data(G_OBJECT(chooser), LIBBALSA_IDENTITY_CHECK);
-    
+
     if (set) {
         if(use_chooser)
             gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(chooser), value);
@@ -1939,10 +1934,10 @@ libbalsa_identity_new_config(const gchar* name)
     LibBalsaIdentity* ident;
     gchar *fname, *email;
     gchar* tmpstr;
-    
+
     fname = libbalsa_conf_get_string("FullName");
     email = libbalsa_conf_get_string("Address");
-    
+
     ident = LIBBALSA_IDENTITY(libbalsa_identity_new_with_name(name));
     ident->ia = internet_address_mailbox_new (fname, email);
     g_free(fname);
@@ -1952,22 +1947,22 @@ libbalsa_identity_new_config(const gchar* name)
     ident->domain = libbalsa_conf_get_string("Domain");
     ident->bcc = libbalsa_conf_get_string("Bcc");
 
-    /* 
+    /*
      * these two have defaults, so we need to use the appropriate
-     * functions to manage the memory. 
+     * functions to manage the memory.
      */
     if ((tmpstr = libbalsa_conf_get_string("ReplyString"))) {
         g_free(ident->reply_string);
         ident->reply_string = tmpstr;
     }
-    
+
     if ((tmpstr = libbalsa_conf_get_string("ForwardString"))) {
         g_free(ident->forward_string);
         ident->forward_string = tmpstr;
     }
     ident->send_mp_alternative =
         libbalsa_conf_get_bool("SendMultipartAlternative");
-    
+
     ident->signature_path = libbalsa_conf_get_string("SignaturePath");
     ident->sig_executable = libbalsa_conf_get_bool("SigExecutable");
     ident->sig_sending = libbalsa_conf_get_bool("SigSending");
@@ -1989,14 +1984,14 @@ libbalsa_identity_new_config(const gchar* name)
     return ident;
 }
 
-void 
+void
 libbalsa_identity_save(LibBalsaIdentity* ident, const gchar* group)
 {
     g_return_if_fail(ident);
 
     libbalsa_conf_push_group(group);
     libbalsa_conf_set_string("FullName", ident->ia ? ident->ia->name : NULL);
-    
+
     if (ident->ia && INTERNET_ADDRESS_IS_MAILBOX (ident->ia))
         libbalsa_conf_set_string("Address", INTERNET_ADDRESS_MAILBOX(ident->ia)->addr);
 
@@ -2067,7 +2062,7 @@ static void
 display_frame_set_gpg_mode(GObject * dialog, const gchar* key, gint * value)
 {
     GtkComboBox *opt_menu = g_object_get_data(G_OBJECT(dialog), key);
- 
+
     switch (*value)
         {
         case LIBBALSA_PROTECT_OPENPGP:
@@ -2200,6 +2195,6 @@ ident_dialog_get_value(GObject * dialog, const gchar * key)
     menu = g_object_get_data(dialog, key);
     value = gtk_combo_box_get_active(GTK_COMBO_BOX(menu));
     values = g_object_get_data(G_OBJECT(menu), "identity-value");
-    
+
     return g_ptr_array_index(values, value);
 }
diff --git a/libinit_balsa/assistant_helper.c b/libinit_balsa/assistant_helper.c
index 51e5a0b..4ed199c 100644
--- a/libinit_balsa/assistant_helper.c
+++ b/libinit_balsa/assistant_helper.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -100,7 +100,7 @@ balsa_init_add_table_entry(GtkTable * table, guint num, const gchar * ltext,
         ed->page = page;
         if (etext && etext[0] != '\0')
             ed->master->setbits |= (1 << num);
-        
+
         ed->master->donemask = (ed->master->donemask << 1) | 1;
     }
     gtk_entry_set_text(GTK_ENTRY(e), etext);
@@ -120,13 +120,8 @@ entry_changed_cb(GtkEntry * entry, EntryData * ed)
     /* The stuff below is only when we are displayed... which is not
      * always the case.
      */
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (!gtk_widget_get_visible(GTK_WIDGET(entry)))
         return;
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    if (!GTK_WIDGET_VISIBLE(GTK_WIDGET(entry)))
-        return;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     if (GTK_IS_ASSISTANT(ed->druid)) {
         /* Don't let them continue unless all entries have something. */
diff --git a/src/ab-window.c b/src/ab-window.c
index 5c25141..2e702ef 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -44,8 +44,8 @@ static void balsa_ab_window_init(BalsaAbWindow *ab);
 static void balsa_ab_window_class_init(BalsaAbWindowClass *klass);
 
 /* Loading ... */
-static void balsa_ab_window_load_cb(LibBalsaAddressBook *libbalsa_ab, 
-				       LibBalsaAddress *address, 
+static void balsa_ab_window_load_cb(LibBalsaAddressBook *libbalsa_ab,
+				       LibBalsaAddress *address,
 				       BalsaAbWindow *ab);
 static void balsa_ab_window_load(BalsaAbWindow *ab);
 static void balsa_ab_window_reload(GtkWidget *w, BalsaAbWindow *av);
@@ -53,7 +53,7 @@ static void balsa_ab_window_reload(GtkWidget *w, BalsaAbWindow *av);
 /* Callbacks ... */
 static void balsa_ab_window_dist_mode_toggled(GtkWidget * w,
 						 BalsaAbWindow *ab);
-static void balsa_ab_window_menu_changed(GtkWidget * widget, 
+static void balsa_ab_window_menu_changed(GtkWidget * widget,
 					    BalsaAbWindow *ab);
 static void balsa_ab_window_run_editor(GtkWidget * widget, gpointer data);
 static void balsa_ab_window_response_cb(BalsaAbWindow *ab, gint resp);
@@ -73,7 +73,7 @@ static void balsa_ab_window_select_recipient(GtkTreeView * view,
                                                 gpointer data);
 static void balsa_ab_window_move_to_recipient_list(GtkWidget *widget,
 						      BalsaAbWindow *ab);
-static void balsa_ab_window_remove_from_recipient_list(GtkWidget *widget, 
+static void balsa_ab_window_remove_from_recipient_list(GtkWidget *widget,
 							  BalsaAbWindow *ab);
 
 /* Utility ... */
@@ -122,8 +122,8 @@ balsa_ab_window_new(gboolean composing, GtkWindow* parent)
 
     BALSA_AB_WINDOW(ret)->composing = composing;
 
-    if ( composing ) { 
-	gtk_dialog_add_buttons(GTK_DIALOG(ret), 
+    if ( composing ) {
+	gtk_dialog_add_buttons(GTK_DIALOG(ret),
                                GTK_STOCK_OK,     GTK_RESPONSE_OK,
                                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                NULL);
@@ -239,18 +239,15 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     /* hig defaults */
     gtk_container_set_border_width(GTK_CONTAINER(ab), 6);
-#if !GTK_CHECK_VERSION(2,22,0)
-    gtk_dialog_set_has_separator(GTK_DIALOG(ab), FALSE);
-#endif
     gtk_box_set_spacing(GTK_BOX(vbox), 12);
-    
+
 
     /* The main address list */
     ab->address_list =
         balsa_ab_window_list(ab,
                                 G_CALLBACK
                                 (balsa_ab_window_activate_address));
-    
+
     /* The clist for selected addresses in compose mode */
     ab->recipient_list =
         balsa_ab_window_list(ab,
@@ -277,7 +274,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_table_set_row_spacings(GTK_TABLE(table), 6);
     gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
     gtk_widget_show(table);
-    
+
     /* -- table column 1 -- */
     /* Entry widget for finding an address */
     find_label = gtk_label_new_with_mnemonic(_("_Search for Name:"));
@@ -321,7 +318,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_container_add(GTK_CONTAINER(hbox), w);
     gtk_widget_show(GTK_WIDGET(w));
 
-    w = balsa_stock_button_with_label(GTK_STOCK_ADD, 
+    w = balsa_stock_button_with_label(GTK_STOCK_ADD,
                                       _("_Re-Import"));
     g_signal_connect(G_OBJECT(w), "clicked",
                      G_CALLBACK(balsa_ab_window_reload),
@@ -337,28 +334,28 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_table_attach(GTK_TABLE(table), ab->arrow_box, 1, 2, 1, 2,
 		     GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 0);
     gtk_widget_show(ab->arrow_box);
-    
+
     w = balsa_stock_button_with_label(GTK_STOCK_GO_FORWARD, "");
     gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, TRUE, FALSE, 0);
     gtk_widget_show(w);
     g_signal_connect(G_OBJECT(w), "clicked",
 		     G_CALLBACK(balsa_ab_window_move_to_recipient_list),
 		       ab);
-    
+
     w = balsa_stock_button_with_label(GTK_STOCK_GO_BACK, "");
     gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, TRUE, FALSE, 0);
     gtk_widget_show(w);
     g_signal_connect(G_OBJECT(w), "clicked",
 		     G_CALLBACK(balsa_ab_window_remove_from_recipient_list),
 		       ab);
-    
+
     /* -- table column 3 -- */
     /* label for selected addresses in compose mode */
     ab->send_to_label = gtk_label_new(_("Send-To"));
     gtk_widget_show(ab->send_to_label);
     gtk_table_attach(GTK_TABLE(table), ab->send_to_label, 2, 3, 0, 1,
 		     GTK_FILL, GTK_FILL, 0, 0);
-    
+
     /* list for selected addresses in compose mode */
     ab->send_to_list = gtk_scrolled_window_new(NULL, NULL);
     gtk_widget_show(ab->send_to_list);
@@ -394,13 +391,13 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     /* Pack them into a box  */
     box2 = gtk_vbox_new(TRUE, 1);
     gtk_container_add(GTK_CONTAINER(frame), box2);
-    gtk_box_pack_start(GTK_BOX(box2), ab->single_address_mode_radio, 
+    gtk_box_pack_start(GTK_BOX(box2), ab->single_address_mode_radio,
 		       FALSE, FALSE, 1);
-    gtk_box_pack_start(GTK_BOX(box2), ab->dist_address_mode_radio, 
+    gtk_box_pack_start(GTK_BOX(box2), ab->dist_address_mode_radio,
 		       FALSE, FALSE, 1);
     gtk_widget_show(box2);
     gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 1);
-    
+
     gtk_widget_grab_focus(ab->filter_entry);
 }
 
@@ -468,11 +465,11 @@ balsa_ab_window_get_recipients(BalsaAbWindow * ab)
   Moves an entry between two CLists.
 */
 /*
-  FIXME: Need to only move it back if it belongs in current address book?? 
+  FIXME: Need to only move it back if it belongs in current address book??
 */
 /*
  * balsa_ab_window_swap_list_entry is the method.
- * 
+ *
  * balsa_ab_window_swap_make_gslist, balsa_ab_window_swap_real,
  * and balsa_ab_window_swap_do_swap are callbacks/helpers.
  */
@@ -532,7 +529,7 @@ balsa_ab_window_swap_do_swap(gpointer data, gpointer user_data)
     GtkTreePath *path = gtk_tree_row_reference_get_path(reference);
 
     if (path) {
-        GtkTreeView *tree_view = 
+        GtkTreeView *tree_view =
             g_object_get_data(G_OBJECT(user_data), BALSA_TREE_VIEW);
         GtkTreeModel *model = gtk_tree_view_get_model(tree_view);
         GtkTreeModel *dst_model = gtk_tree_view_get_model(user_data);
@@ -634,7 +631,7 @@ balsa_ab_window_move_to_recipient_list(GtkWidget *widget, BalsaAbWindow *ab)
     g_return_if_fail( BALSA_IS_AB_WINDOW(ab) );
     g_return_if_fail( ab->composing );
 
-    balsa_ab_window_swap_list_entry(GTK_TREE_VIEW(ab->address_list), 
+    balsa_ab_window_swap_list_entry(GTK_TREE_VIEW(ab->address_list),
 				       GTK_TREE_VIEW(ab->recipient_list));
 }
 
@@ -647,7 +644,7 @@ balsa_ab_window_remove_from_recipient_list(GtkWidget *widget, BalsaAbWindow *ab)
     g_return_if_fail( BALSA_IS_AB_WINDOW(ab) );
     g_return_if_fail( ab->composing );
 
-    balsa_ab_window_swap_list_entry(GTK_TREE_VIEW(ab->recipient_list), 
+    balsa_ab_window_swap_list_entry(GTK_TREE_VIEW(ab->recipient_list),
 				       GTK_TREE_VIEW(ab->address_list));
 }
 
@@ -866,15 +863,15 @@ balsa_ab_window_menu_changed(GtkWidget * widget, BalsaAbWindow *ab)
 
     ab->current_address_book = addr;
 
-    g_signal_handler_block(G_OBJECT(ab->single_address_mode_radio), 
+    g_signal_handler_block(G_OBJECT(ab->single_address_mode_radio),
 			   ab->toggle_handler_id);
     if ( ab->current_address_book->dist_list_mode )
 	gtk_toggle_button_set_active(
 	    GTK_TOGGLE_BUTTON(ab->dist_address_mode_radio), TRUE);
-    else 
+    else
 	gtk_toggle_button_set_active(
 	    GTK_TOGGLE_BUTTON(ab->single_address_mode_radio), TRUE);
-    g_signal_handler_unblock(G_OBJECT(ab->single_address_mode_radio), 
+    g_signal_handler_unblock(G_OBJECT(ab->single_address_mode_radio),
 			     ab->toggle_handler_id);
 
     balsa_ab_window_load(ab);
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 0618d2c..196d368 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -5,29 +5,29 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
 /* SORTING METHOD discussion:
-   auto_sort() is NOT used to sort the messages since the compare methods 
+   auto_sort() is NOT used to sort the messages since the compare methods
    (numeric_compare, date_compare) use information from attached mailbox
    which is unavailable at the insertion time. We have to sort after every
-   insertion which is not a big lost: NlnN process against sorted 
+   insertion which is not a big lost: NlnN process against sorted
    insersion N (though the prefactor is much bigger in the former case).
 
    The alternative is to create a hidden column containing the sorting
-   key and replace the key on every change of the sort method.  
+   key and replace the key on every change of the sort method.
 */
 
 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
@@ -185,11 +185,11 @@ bndx_class_init(BalsaIndexClass * klass)
 
     parent_class = g_type_class_peek_parent(klass);
 
-    balsa_index_signals[INDEX_CHANGED] = 
+    balsa_index_signals[INDEX_CHANGED] =
         g_signal_new("index-changed",
-                     G_TYPE_FROM_CLASS(object_class),   
+                     G_TYPE_FROM_CLASS(object_class),
 		     G_SIGNAL_RUN_FIRST,
-                     G_STRUCT_OFFSET(BalsaIndexClass, 
+                     G_STRUCT_OFFSET(BalsaIndexClass,
                                      index_changed),
                      NULL, NULL,
 		     g_cclosure_marshal_VOID__VOID,
@@ -219,7 +219,7 @@ bndx_destroy(GObject * obj)
 
     if (index->mailbox_node) {
 	LibBalsaMailbox* mailbox;
-	
+
 	if ((mailbox = index->mailbox_node->mailbox)) {
 	    g_signal_handlers_disconnect_matched(mailbox,
 						 G_SIGNAL_MATCH_DATA,
@@ -279,7 +279,6 @@ bi_apply_other_column_settings(GtkTreeViewColumn *column,
 }
 
 /* Width of a string in pixels for the default font. */
-#if GTK_CHECK_VERSION(2, 20, 0)
 static gint
 bndx_string_width(const gchar * text)
 {
@@ -299,9 +298,6 @@ bndx_string_width(const gchar * text)
 
     return allocation.width;
 }
-#else
-#define bndx_string_width(text) 50
-#endif
 
 /* BalsaIndex instance init method; no tree store is set on the tree
  * view--that's handled later, when the view is populated. */
@@ -429,7 +425,7 @@ bndx_instance_init(BalsaIndex * index)
     index->mailbox_node = NULL;
     index->popup_menu = bndx_popup_menu_create(index);
     g_object_ref_sink(index->popup_menu);
-    
+
     gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
 
     /* handle select row signals to display message in the window
@@ -461,10 +457,10 @@ bndx_instance_init(BalsaIndex * index)
                            NULL);
     gtk_tree_view_set_enable_search(tree_view, FALSE);
 
-    gtk_drag_source_set(GTK_WIDGET (index), 
+    gtk_drag_source_set(GTK_WIDGET (index),
                         GDK_BUTTON1_MASK | GDK_SHIFT_MASK | GDK_CONTROL_MASK,
                         index_drag_types, ELEMENTS(index_drag_types),
-                        GDK_ACTION_DEFAULT | GDK_ACTION_COPY | 
+                        GDK_ACTION_DEFAULT | GDK_ACTION_COPY |
                         GDK_ACTION_MOVE);
     g_signal_connect(index, "drag-data-get",
                      G_CALLBACK(bndx_drag_cb), NULL);
@@ -815,8 +811,8 @@ bndx_column_resize(GtkWidget * widget, GtkAllocation * allocation,
                                        (tree_view, LB_MBOX_SIZE_COL));
 }
 
-/* bndx_drag_cb 
- * 
+/* bndx_drag_cb
+ *
  * This is the drag_data_get callback for the index widgets.
  * Currently supports DND only within the application.
  */
@@ -1132,7 +1128,7 @@ balsa_index_set_width_preference(BalsaIndex *bindex,
  * - balsa_index_select_next_unread:
  *   - selects first unread unselected message after first selected
  *     message, expanding thread if necessary
- *   - if none, wraps around to the first unread message anywhere 
+ *   - if none, wraps around to the first unread message anywhere
  *   - no-op if there are no unread messages
  *   callback for `next unread message' menu item and `open next unread
  *   message' toolbar button
@@ -1399,7 +1395,7 @@ balsa_index_set_column_widths(BalsaIndex * index)
     gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &icon_w, NULL);
     gtk_tree_view_column_set_fixed_width(gtk_tree_view_get_column
                                          (tree_view, LB_MBOX_MARKED_COL),
-                                         icon_w + 5); 
+                                         icon_w + 5);
     gtk_tree_view_column_set_fixed_width(gtk_tree_view_get_column
                                          (tree_view, LB_MBOX_ATTACH_COL),
                                          icon_w + 5);
@@ -1592,7 +1588,7 @@ balsa_index_selected_list(BalsaIndex * index)
     gtk_tree_selection_selected_foreach(selection,
                                         balsa_index_selected_list_func,
                                         &list);
- 
+
     return list;
 }
 
@@ -1842,7 +1838,7 @@ bi_toggle_flagged_cb(gpointer user_data)
 {
     g_return_if_fail(user_data != NULL);
 
-    balsa_index_toggle_flag(BALSA_INDEX(user_data), 
+    balsa_index_toggle_flag(BALSA_INDEX(user_data),
                             LIBBALSA_MESSAGE_FLAG_FLAGGED);
 }
 
@@ -1851,7 +1847,7 @@ bi_toggle_new_cb(gpointer user_data)
 {
     g_return_if_fail(user_data != NULL);
 
-    balsa_index_toggle_flag(BALSA_INDEX(user_data), 
+    balsa_index_toggle_flag(BALSA_INDEX(user_data),
                             LIBBALSA_MESSAGE_FLAG_NEW);
 }
 
@@ -1904,7 +1900,7 @@ bndx_popup_menu_create(BalsaIndex * index)
         create_stock_menu_item(menu, entries[i].icon, _(entries[i].label),
                                entries[i].func, index);
 
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), 
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu),
                           gtk_separator_menu_item_new());
     index->delete_item =
         create_stock_menu_item(menu, GTK_STOCK_DELETE,
@@ -1941,8 +1937,8 @@ bndx_popup_menu_create(BalsaIndex * index)
     index->move_to_item = menuitem;
     gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
 
-    
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), 
+
+    gtk_menu_shell_append(GTK_MENU_SHELL(menu),
                           gtk_separator_menu_item_new());
     create_stock_menu_item(menu, BALSA_PIXMAP_BOOK_OPEN,
                            _("_View Source"),
@@ -1969,9 +1965,7 @@ bndx_popup_position_func(GtkMenu * menu, gint * x, gint * y,
     GtkRequisition req;
     gint monitor_num;
     GdkRectangle monitor;
-#if GTK_CHECK_VERSION(2, 18, 0)
     GtkAllocation allocation;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     g_return_if_fail(gtk_widget_get_window(bindex));
 
@@ -1980,12 +1974,8 @@ bndx_popup_position_func(GtkMenu * menu, gint * x, gint * y,
 
     gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req);
 
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_get_allocation(bindex, &allocation);
     *x += (allocation.width - req.width) / 2;
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    *x += (bindex->allocation.width - req.width) / 2;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     monitor_num = gdk_screen_get_monitor_at_point(screen, *x, *y);
     gtk_menu_set_monitor(menu, monitor_num);
@@ -2202,7 +2192,7 @@ balsa_index_transfer(BalsaIndex *index, GArray * msgnos,
     else if (to_mailbox == balsa_app.trash)
         enable_empty_trash(balsa_app.main_window, TRASH_FULL);
     balsa_information(LIBBALSA_INFORMATION_MESSAGE,
-                      copy ? _("Copied to \"%s\".") 
+                      copy ? _("Copied to \"%s\".")
                       : _("Moved to \"%s\"."), to_mailbox->name);
     if (!copy)
 	/* Note when message was flagged as deleted, for use in
@@ -2391,7 +2381,7 @@ pipe_in_watch(GIOChannel *channel, GIOCondition condition, gpointer data)
     GError *error = NULL;
     gsize chars_written;
     gboolean rc;
-    
+
     if( (condition & G_IO_OUT) == G_IO_OUT) {
 	status =
 	    g_io_channel_write_chars(channel,
@@ -2559,7 +2549,7 @@ bndx_pipe_queue_last(struct BndxPipeQueue *queue)
 	bndx_pipe_queue_last(queue);
 	return;
     }
-    
+
     argv = g_new(gchar *, 4);
     argv[0] = g_strdup("/bin/sh");
     argv[1] = g_strdup("-c");
@@ -2597,7 +2587,7 @@ bndx_pipe_queue_last(struct BndxPipeQueue *queue)
 	printf("Could not spawn pipe %s : %s\n", queue->pipe_cmd,
 	       error ? error->message : "unknown");
 	g_clear_error(&error);
-    }    
+    }
 }
 
 /** Initiates the asynchronous process of sending specified messages
diff --git a/src/balsa-mblist.c b/src/balsa-mblist.c
index 541eedc..cfde605 100644
--- a/src/balsa-mblist.c
+++ b/src/balsa-mblist.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -327,17 +327,10 @@ bmbl_drag_motion(GtkWidget * mblist, GdkDragContext * context, gint x,
                                     GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
     gtk_tree_path_free(path);
 
-#if GTK_CHECK_VERSION(2,22,0)
     gdk_drag_status(context,
                     (gdk_drag_context_get_actions(context) ==
                      GDK_ACTION_COPY) ? GDK_ACTION_COPY :
                     GDK_ACTION_MOVE, time);
-#else
-    gdk_drag_status(context,
-                    (context->actions ==
-                     GDK_ACTION_COPY) ? GDK_ACTION_COPY :
-                    GDK_ACTION_MOVE, time);
-#endif
 
     return (ret_val && can_drop);
 }
@@ -503,7 +496,7 @@ balsa_mblist_get_store(void)
     return balsa_app.mblist_tree_store;
 }
 
-/* 
+/*
  * bmbl_selection_func
  *
  * Used to filter whether or not a row may be selected.
@@ -534,7 +527,7 @@ balsa_mblist_new()
     BalsaMBList *new;
 
     new = g_object_new(balsa_mblist_get_type(), NULL);
-    
+
     return GTK_WIDGET(new);
 }
 
@@ -627,7 +620,7 @@ bmbl_tree_collapse(GtkTreeView * tree_view, GtkTreeIter * iter,
 
     if (!mbnode->mailbox)
         gtk_tree_store_set(GTK_TREE_STORE(model), iter,
-                           ICON_COLUMN, 
+                           ICON_COLUMN,
                            balsa_icon_id(BALSA_PIXMAP_MBOX_DIR_CLOSED),
                            -1);
     g_object_unref(mbnode);
@@ -636,7 +629,7 @@ bmbl_tree_collapse(GtkTreeView * tree_view, GtkTreeIter * iter,
 }
 
 /* bmbl_row_compare
- * 
+ *
  * This function determines the sorting order of the list, depending
  * on what column is selected.  The first column sorts by name, with
  * exception given to the five "core" mailboxes (Inbox, Draftbox,
@@ -804,7 +797,7 @@ bmbl_column_resize(GtkWidget * widget,
 }
 
 /* bmbl_drag_cb
- * 
+ *
  * Description: This is the drag_data_recieved signal handler for the
  * BalsaMBList.  It retrieves the source BalsaIndex and transfers the
  * index's selected messages to the target
@@ -838,7 +831,7 @@ bmbl_drag_cb(GtkWidget * widget, GdkDragContext * context,
 	/* it is actually possible to drag from GtkTreeView when no rows
 	 * are selected: Disable preview for that. */
         balsa_index_selected_msgnos_free(orig_index, selected);
-        return; 
+        return;
     }
 
     orig_mailbox = orig_index->mailbox_node->mailbox;
@@ -860,13 +853,9 @@ bmbl_drag_cb(GtkWidget * widget, GdkDragContext * context,
 
         /* cannot transfer to the originating mailbox */
         if (mailbox != NULL && mailbox != orig_mailbox)
-#if GTK_CHECK_VERSION(2,22,0)
-            balsa_index_transfer(orig_index, selected, mailbox,
-                                 gdk_drag_context_get_selected_action(context) != GDK_ACTION_MOVE);
-#else
             balsa_index_transfer(orig_index, selected, mailbox,
-                                 context->action != GDK_ACTION_MOVE);
-#endif
+                                 gdk_drag_context_get_selected_action
+                                 (context) != GDK_ACTION_MOVE);
         gtk_tree_path_free(path);
     }
     balsa_index_selected_msgnos_free(orig_index, selected);
@@ -936,7 +925,7 @@ bmbl_select_mailbox(GtkTreeSelection * selection, gpointer data)
         gdk_event_free(event);
         return;
     }
-    
+
     if (gtk_tree_selection_path_is_selected(selection, path)) {
         BalsaMailboxNode *mbnode;
 
@@ -1125,7 +1114,7 @@ balsa_mblist_find_all_unread_mboxes(LibBalsaMailbox * mailbox)
 }
 
 /* mblist_open_mailbox
- * 
+ *
  * Description: This checks to see if the mailbox is already on a different
  * mailbox page, or if a new page needs to be created and the mailbox
  * parsed.
@@ -1149,7 +1138,7 @@ bmbl_open_mailbox(LibBalsaMailbox * mailbox, gboolean set_current)
     if (index) {
 	time(&BALSA_INDEX(index)->mailbox_node->last_use);
     }
-    
+
     i = balsa_find_notebook_page_num(mailbox);
     if (i != -1) {
         if (set_current) {
@@ -1186,7 +1175,7 @@ void
 balsa_mblist_close_mailbox(LibBalsaMailbox * mailbox)
 {
     BalsaMailboxNode *mbnode;
-    
+
     mbnode = balsa_find_mailbox(mailbox);
     if (!mbnode)  {
         g_warning(_("Failed to find mailbox"));
@@ -1220,7 +1209,7 @@ get_lru_descendant(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
     {
         if (dt->mbnode)
             g_object_unref(dt->mbnode);
-        dt->mbnode = mbnode; 
+        dt->mbnode = mbnode;
     }
 
     else g_object_unref(mbnode);
@@ -1300,7 +1289,7 @@ bmbl_real_disconnect_mbnode_signals(BalsaMailboxNode * mbnode,
 }
 
 /* bmbl_store_redraw_mbnode
- * 
+ *
  * adds BalsaMailboxNodes to the mailbox list, choosing proper icon for them.
  * returns FALSE on failure (wrong parameters passed).
  * */
@@ -1409,10 +1398,10 @@ bmbl_store_redraw_mbnode(GtkTreeIter * iter, BalsaMailboxNode * mbnode)
 }
 
 /* balsa_mblist_update_mailbox [MBG]
- * 
+ *
  * mblist: the mailbox list that contains the mailbox
  * mbnode:  the mailbox node that you wish to update
- * 
+ *
  * Description: the function looks for the mailbox in the mblist, if
  * it's there it changes the style (and fills the info columns)
  * depending on the mailbox variables unread_messages and
@@ -1447,7 +1436,7 @@ balsa_mblist_update_mailbox(GtkTreeStore * store,
 }
 
 /* bmbl_node_style [MBG]
- * 
+ *
  * model:  The model containing the mailbox
  * iter : the iterator pointing on the mailbox node
  * Description: A function to actually do the changing of the style,
@@ -1567,11 +1556,11 @@ bmbl_node_style(GtkTreeModel * model, GtkTreeIter * iter)
 }
 
 /* bmbl_core_mailbox
- * 
+ *
  * Simple function, if the mailbox is one of the five "core" mailboxes
  * (i.e. Inbox, Sentbox...) it returns an integer representing it's
  * place in the desired heirarchy in the mblist.  If the mailbox is
- * not a core mailbox it returns zero. 
+ * not a core mailbox it returns zero.
  * */
 static gint
 bmbl_core_mailbox(LibBalsaMailbox* mailbox)
@@ -1593,14 +1582,14 @@ bmbl_core_mailbox(LibBalsaMailbox* mailbox)
 #endif /* defined(ENABLE_TOUCH_UI) */
     };
     gint i = 0;
-    
+
     for (i = 0; i < num_core_mailboxes; ++i) {
         if (mailbox == core_mailbox[i]) {
             /* we want to return as if from a base-1 array */
             return num_core_mailboxes - i + 1;
         }
     }
-    
+
     /* if we couldn't find the mailbox, return 0 */
     return 0;
 }
@@ -2233,7 +2222,7 @@ bmbl_sort_idle(gpointer data)
     return FALSE;
 }
 
-void 
+void
 balsa_mblist_mailbox_node_append(BalsaMailboxNode * root,
 				 BalsaMailboxNode * mbnode)
 {
diff --git a/src/balsa-message.c b/src/balsa-message.c
index 71bedb8..c54e728 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -7,15 +7,15 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -170,7 +170,7 @@ static void
 balsa_part_info_class_init(BalsaPartInfoClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    
+
     object_class->finalize = balsa_part_info_free;
 }
 
@@ -192,7 +192,7 @@ balsa_part_info_get_type()
                 0,
                 (GInstanceInitFunc) balsa_part_info_init
             };
-        balsa_part_info_type = 
+        balsa_part_info_type =
            g_type_register_static (G_TYPE_OBJECT, "BalsaPartInfo",
                                    &balsa_part_info_info, 0);
     }
@@ -297,8 +297,8 @@ bm_header_tl_buttons(BalsaMessage * bm)
 		     G_CALLBACK(balsa_mime_widget_unlimit_focus),
 		     (gpointer) bm);
     gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
-    gtk_container_add(GTK_CONTAINER(button), 
-		      gtk_image_new_from_stock(BALSA_PIXMAP_GPG_RECHECK, 
+    gtk_container_add(GTK_CONTAINER(button),
+		      gtk_image_new_from_stock(BALSA_PIXMAP_GPG_RECHECK,
 					       GTK_ICON_SIZE_LARGE_TOOLBAR));
     gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
     g_signal_connect(button, "clicked",
@@ -318,8 +318,8 @@ bm_header_tl_buttons(BalsaMessage * bm)
 		     G_CALLBACK(balsa_mime_widget_unlimit_focus),
 		     (gpointer) bm);
     gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
-    gtk_container_add(GTK_CONTAINER(button), 
-		      gtk_image_new_from_stock(BALSA_PIXMAP_ATTACHMENT, 
+    gtk_container_add(GTK_CONTAINER(button),
+		      gtk_image_new_from_stock(BALSA_PIXMAP_ATTACHMENT,
 					       GTK_ICON_SIZE_LARGE_TOOLBAR));
     gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
     g_signal_connect(button, "clicked",
@@ -643,33 +643,19 @@ bm_find_pass_to_entry(BalsaMessage * bm, GdkEventKey * event)
         bm_disable_find_entry(bm);
         return res;
     case GDK_KEY_g:
-#if GTK_CHECK_VERSION(2, 18, 0)
         if ((event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) ==
             GDK_CONTROL_MASK && gtk_widget_get_sensitive(bm->find_next)) {
             bm_find_again(bm, bm->find_forward);
             return res;
         }
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-        if ((event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) ==
-            GDK_CONTROL_MASK && GTK_WIDGET_IS_SENSITIVE(bm->find_next)) {
-            bm_find_again(bm, bm->find_forward);
-            return res;
-        }
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
     default:
         break;
     }
 
     res = FALSE;
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_has_focus(bm->find_entry))
         g_signal_emit_by_name(bm->find_entry, "key-press-event", event,
                               &res, NULL);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    if (GTK_WIDGET_HAS_FOCUS(bm->find_entry))
-        g_signal_emit_by_name(bm->find_entry, "key-press-event", event,
-                              &res, NULL);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     return res;
 }
@@ -745,7 +731,7 @@ balsa_message_init(BalsaMessage * bm)
     bm->treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(model));
     selection = gtk_tree_view_get_selection(GTK_TREE_VIEW (bm->treeview));
     g_signal_connect(bm->treeview, "row-activated",
-                     G_CALLBACK(tree_activate_row_cb), bm);    
+                     G_CALLBACK(tree_activate_row_cb), bm);
     g_signal_connect(bm->treeview, "button_press_event",
                      G_CALLBACK(tree_button_press_cb), bm);
     g_signal_connect(bm->treeview, "popup-menu",
@@ -754,7 +740,7 @@ balsa_message_init(BalsaMessage * bm)
     gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (bm->treeview), TRUE);
     gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
     gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (bm->treeview), FALSE);
-    
+
     /* column for the part number */
     renderer = gtk_cell_renderer_text_new ();
     g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
@@ -789,9 +775,9 @@ balsa_message_init(BalsaMessage * bm)
                                    GTK_POLICY_AUTOMATIC);
 
     gtk_tree_view_set_expander_column
-	(GTK_TREE_VIEW (bm->treeview), gtk_tree_view_get_column 
+	(GTK_TREE_VIEW (bm->treeview), gtk_tree_view_get_column
 	 (GTK_TREE_VIEW (bm->treeview), MIME_ICON_COLUMN - 1));
-    
+
     label = gtk_label_new(_("Message parts"));
     gtk_notebook_append_page(GTK_NOTEBOOK(bm), scroll, label);
     gtk_container_add(GTK_CONTAINER(scroll), bm->treeview);
@@ -883,7 +869,7 @@ tree_next_valid_part_info(GtkTreeModel * model, GtkTreeIter * iter)
     return NULL;
 }
 
-static void 
+static void
 tree_activate_row_cb(GtkTreeView *treeview, GtkTreePath *arg1,
                      GtkTreeViewColumn *arg2, gpointer user_data)
 {
@@ -893,16 +879,16 @@ tree_activate_row_cb(GtkTreeView *treeview, GtkTreePath *arg1,
     BalsaPartInfo *info = NULL;
 
     g_return_if_fail(bm);
-    
+
     /* get the info of the activated part */
     if (!gtk_tree_model_get_iter(model, &sel_iter, arg1))
         return;
     gtk_tree_model_get(model, &sel_iter, PART_INFO_COLUMN, &info, -1);
-    
+
     /* if it's not displayable (== no info), get the next one... */
     if (!info) {
         info = tree_next_valid_part_info(model, &sel_iter);
-        
+
         if (!info) {
             gtk_tree_model_get_iter_first(model, &sel_iter);
             gtk_tree_model_get(model, &sel_iter, PART_INFO_COLUMN, &info, -1);
@@ -949,7 +935,7 @@ tree_mult_selection_popup(BalsaMessage * bm, GdkEventButton * event,
     gtk_tree_selection_selected_foreach(selection,
                                         collect_selected_info,
                                         &bm->save_all_list);
-    
+
     /* For a single part, display it's popup, for multiple parts a "save all"
      * popup. If nothing with an info block is selected, do nothing */
     selected = g_list_length(bm->save_all_list);
@@ -967,17 +953,17 @@ tree_mult_selection_popup(BalsaMessage * bm, GdkEventButton * event,
         bm->save_all_list = NULL;
     } else if (selected > 1) {
         GtkWidget *menu_item;
-        
+
         bm->save_all_popup = gtk_menu_new ();
         g_object_ref_sink(bm->save_all_popup);
-        menu_item = 
+        menu_item =
             gtk_menu_item_new_with_label (_("Save selected as..."));
         gtk_widget_show(menu_item);
         g_signal_connect (G_OBJECT (menu_item), "activate",
                           G_CALLBACK (part_context_save_all_cb),
                           (gpointer) bm->save_all_list);
         gtk_menu_shell_append (GTK_MENU_SHELL (bm->save_all_popup), menu_item);
-        menu_item = 
+        menu_item =
             gtk_menu_item_new_with_label (_("Save selected to folder..."));
         gtk_widget_show(menu_item);
         g_signal_connect (G_OBJECT (menu_item), "activate",
@@ -1004,7 +990,7 @@ tree_menu_popup_key_cb(GtkWidget *widget, gpointer user_data)
     return TRUE;
 }
 
-static gboolean 
+static gboolean
 tree_button_press_cb(GtkWidget * widget, GdkEventButton * event,
                      gpointer data)
 {
@@ -1022,7 +1008,7 @@ tree_button_press_cb(GtkWidget * widget, GdkEventButton * event,
      * the selection and check if more than on part is selected. Pop up the
      * "save all" menu in this case and the "normal" popup otherwise.
      * If the receiving part is not selected, select (only) this part and pop
-     * up its menu. 
+     * up its menu.
      */
     if (gtk_tree_view_get_path_at_pos(tree_view, event->x, event->y,
                                       &path, NULL, NULL, NULL)) {
@@ -1069,7 +1055,7 @@ gchar *
 balsa_message_sender_to_gchar(InternetAddressList * list, gint which)
 {
     InternetAddress *ia;
-    
+
     if (!list)
 	return g_strdup(_("(No sender)"));
     if (which < 0)
@@ -1144,7 +1130,7 @@ balsa_message_set(BalsaMessage * bm, LibBalsaMailbox * mailbox, guint msgno)
     }
 
 #ifdef HAVE_GPGME
-    balsa_message_perform_crypto(message, 
+    balsa_message_perform_crypto(message,
 				 libbalsa_mailbox_get_crypto_mode(mailbox),
 				 FALSE, 1);
     /* calculate the signature summary state if not set earlier */
@@ -1157,7 +1143,7 @@ balsa_message_set(BalsaMessage * bm, LibBalsaMailbox * mailbox, guint msgno)
     }
 #endif
 
-    /* may update the icon */           
+    /* may update the icon */
     libbalsa_mailbox_msgno_update_attach(mailbox, message->msgno, message);
 
     display_headers(bm);
@@ -1186,8 +1172,8 @@ balsa_message_set(BalsaMessage * bm, LibBalsaMailbox * mailbox, guint msgno)
                                         &iter))
         /* Not possible? */
         return TRUE;
-    
-    info = 
+
+    info =
         tree_next_valid_part_info(gtk_tree_view_get_model(GTK_TREE_VIEW(bm->treeview)),
                                   &iter);
     select_part(bm, info);
@@ -1232,7 +1218,7 @@ balsa_message_set_embedded_hdr(GtkTreeModel * model, GtkTreePath * path,
                                                     info->body->embhdrs->subject);
 	g_object_unref(G_OBJECT(info));
     }
-    
+
     return FALSE;
 }
 
@@ -1242,15 +1228,15 @@ balsa_message_set_displayed_headers(BalsaMessage * bmessage,
 {
     g_return_if_fail(bmessage != NULL);
     g_return_if_fail(sh >= HEADERS_NONE && sh <= HEADERS_ALL);
-    
+
     if (bmessage->shown_headers == sh)
         return;
 
     bmessage->shown_headers = sh;
-    
+
     if (bmessage->message) {
         if(sh == HEADERS_ALL)
-            libbalsa_mailbox_set_msg_headers(bmessage->message->mailbox, 
+            libbalsa_mailbox_set_msg_headers(bmessage->message->mailbox,
                                              bmessage->message);
         display_headers(bmessage);
         gtk_tree_model_foreach
@@ -1271,9 +1257,9 @@ void
 balsa_message_set_wrap(BalsaMessage * bm, gboolean wrap)
 {
     g_return_if_fail(bm != NULL);
-    
+
     bm->wrap_text = wrap;
-    
+
     /* This is easier than reformating all the widgets... */
     if (bm->message) {
         LibBalsaMessage *msg = bm->message;
@@ -1281,11 +1267,11 @@ balsa_message_set_wrap(BalsaMessage * bm, gboolean wrap)
     }
 }
 
-  
+
 static void
 display_headers(BalsaMessage * bm)
 {
-    balsa_mime_widget_message_set_headers_d(bm, bm->bm_widget, 
+    balsa_mime_widget_message_set_headers_d(bm, bm->bm_widget,
                                             bm->message->headers,
                                             bm->message->body_list,
                                             LIBBALSA_MESSAGE_GET_SUBJECT(bm->message));
@@ -1321,7 +1307,7 @@ mpart_content_name(const gchar *content_type)
     else if (g_ascii_strcasecmp(content_type, "message/rfc822") == 0)
         return g_strdup(_("rfc822 message"));
     else
-        return g_strdup_printf(_("\"%s\" parts"), 
+        return g_strdup_printf(_("\"%s\" parts"),
                                strchr(content_type, '/') + 1);
 }
 
@@ -1332,7 +1318,7 @@ atattchments_menu_cb(GtkWidget * widget, BalsaPartInfo *info)
 
     g_return_if_fail(bm);
     g_return_if_fail(info);
-    
+
     gtk_notebook_set_current_page(GTK_NOTEBOOK(bm), 0);
     select_part(bm, info);
 }
@@ -1342,7 +1328,7 @@ add_to_attachments_popup(GtkMenuShell * menu, const gchar * item,
 			 BalsaMessage * bm, BalsaPartInfo *info)
 {
     GtkWidget * menuitem = gtk_menu_item_new_with_label (item);
-    
+
     g_object_set_data(G_OBJECT(menuitem), "balsa-message", bm);
     g_signal_connect(G_OBJECT (menuitem), "activate",
 		     G_CALLBACK (atattchments_menu_cb),
@@ -1357,9 +1343,9 @@ toggle_all_inline_cb(GtkCheckMenuItem * item, BalsaPartInfo *info)
 
     g_return_if_fail(bm);
     g_return_if_fail(info);
-    
+
     bm->force_inline = gtk_check_menu_item_get_active(item);
-    
+
     gtk_notebook_set_current_page(GTK_NOTEBOOK(bm), 0);
     select_part(bm, info);
 }
@@ -1370,7 +1356,7 @@ add_toggle_inline_menu_item(GtkMenuShell * menu, BalsaMessage * bm,
 {
     GtkWidget * menuitem =
 	gtk_check_menu_item_new_with_label (_("force inline for all parts"));
-    
+
     g_object_set_data(G_OBJECT(menuitem), "balsa-message", bm);
     g_signal_connect(G_OBJECT (menuitem), "activate",
 		     G_CALLBACK (toggle_all_inline_cb),
@@ -1411,7 +1397,7 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
             gchar *subj = g_strdup(body->embhdrs->subject);
             libbalsa_utf8_sanitize(&from, balsa_app.convert_unknown_8bit, NULL);
             libbalsa_utf8_sanitize(&subj, balsa_app.convert_unknown_8bit, NULL);
-            icon_title = 
+            icon_title =
                 g_strdup_printf(_("rfc822 message (from %s, subject \"%s\")"),
                                 from, subj);
             g_free(from);
@@ -1421,23 +1407,23 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
 	    if (!strcmp(part_id, "1")) {
 		add_toggle_inline_menu_item(GTK_MENU_SHELL(bm->parts_popup),
 					    bm, info);
-		gtk_menu_shell_append(GTK_MENU_SHELL(bm->parts_popup), 
+		gtk_menu_shell_append(GTK_MENU_SHELL(bm->parts_popup),
 				      gtk_separator_menu_item_new ());
-		add_to_attachments_popup(GTK_MENU_SHELL(bm->parts_popup), 
+		add_to_attachments_popup(GTK_MENU_SHELL(bm->parts_popup),
 					 _("complete message"),
 					 bm, info);
-		gtk_menu_shell_append(GTK_MENU_SHELL(bm->parts_popup), 
+		gtk_menu_shell_append(GTK_MENU_SHELL(bm->parts_popup),
 				      gtk_separator_menu_item_new ());
 	    }
         } else if (body->filename) {
             gchar * filename = g_strdup(body->filename);
 	    gchar * menu_label;
 
-            libbalsa_utf8_sanitize(&filename, balsa_app.convert_unknown_8bit, 
+            libbalsa_utf8_sanitize(&filename, balsa_app.convert_unknown_8bit,
                                    NULL);
             icon_title =
                 g_strdup_printf("%s (%s)", filename, content_desc);
-	    
+
 	    /* this should neither be a message nor multipart, so add it to the
 	       attachments popup */
 	    menu_label =
@@ -1457,13 +1443,13 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
 				     menu_label, bm, info);
 	    g_free(menu_label);
 	}
-        
+
         part_create_menu (info);
         info->path = gtk_tree_model_get_path(model, iter);
 
         /* add to the tree view */
 #ifdef HAVE_GPGME
-        content_icon = 
+        content_icon =
 	    get_crypto_content_icon(body, content_type, &icon_title);
 	if (info->body->was_encrypted) {
 	    gchar * new_title =
@@ -1475,28 +1461,28 @@ display_part(BalsaMessage * bm, LibBalsaMessageBody * body,
 	content_icon = NULL;
 #endif
         if (!content_icon)
-	    content_icon = 
+	    content_icon =
 		libbalsa_icon_finder(content_type, NULL, NULL,
 				     GTK_ICON_SIZE_LARGE_TOOLBAR);
-        gtk_tree_store_set (GTK_TREE_STORE(model), iter, 
+        gtk_tree_store_set (GTK_TREE_STORE(model), iter,
                             PART_INFO_COLUMN, info,
 			    PART_NUM_COLUMN, part_id,
                             MIME_ICON_COLUMN, content_icon,
                             MIME_TYPE_COLUMN, icon_title, -1);
-        
+
         g_object_unref(info);
         g_free(icon_title);
     } else {
 	content_icon =
 	    libbalsa_icon_finder(content_type, NULL, NULL,
 				 GTK_ICON_SIZE_LARGE_TOOLBAR);
-        gtk_tree_store_set (GTK_TREE_STORE(model), iter, 
+        gtk_tree_store_set (GTK_TREE_STORE(model), iter,
                             PART_INFO_COLUMN, NULL,
 			    PART_NUM_COLUMN, part_id,
                             MIME_ICON_COLUMN, content_icon,
                             MIME_TYPE_COLUMN, content_desc, -1);
     }
-        
+
     if (content_icon)
 	g_object_unref(G_OBJECT(content_icon));
     g_free(content_desc);
@@ -1621,20 +1607,20 @@ balsa_message_copy_part(const gchar *url, LibBalsaMessageBody *part)
 }
 
 static void
-part_create_menu (BalsaPartInfo* info) 
+part_create_menu (BalsaPartInfo* info)
 /* Remarks: Will add items in the following order:
             1) Default application according to GnomeVFS.
             2) GNOME MIME/GnomeVFS key values that don't match default
                application or anything on the shortlist.
             3) GnomeVFS shortlist applications, with the default one (sometimes
-               included on shortlist, sometimes not) excluded. */ 
+               included on shortlist, sometimes not) excluded. */
 {
     GtkWidget* menu_item;
     gchar* content_type;
-    
+
     info->popup_menu = gtk_menu_new ();
     g_object_ref_sink(info->popup_menu);
-    
+
     content_type = libbalsa_message_body_get_mime_type (info->body);
     libbalsa_vfs_fill_menu_by_content_type(GTK_MENU(info->popup_menu),
 					   content_type,
@@ -1670,7 +1656,7 @@ static void
 balsa_part_info_init(GObject *object, gpointer data)
 {
     BalsaPartInfo * info = BALSA_PART_INFO(object);
-    
+
     info->body = NULL;
     info->mime_widget = NULL;
     info->popup_menu = NULL;
@@ -1678,7 +1664,7 @@ balsa_part_info_init(GObject *object, gpointer data)
 }
 
 static BalsaPartInfo*
-balsa_part_info_new(LibBalsaMessageBody* body) 
+balsa_part_info_new(LibBalsaMessageBody* body)
 {
     BalsaPartInfo * info = g_object_new(TYPE_BALSA_PART_INFO, NULL);
     info->body = body;
@@ -1705,7 +1691,7 @@ balsa_part_info_free(GObject * object)
     gtk_tree_path_free(info->path);
 
     parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLASS(object));
-    parent_class->finalize(object);    
+    parent_class->finalize(object);
 }
 
 static void
@@ -1817,7 +1803,7 @@ part_context_dump_all_cb(GtkWidget * menu_item, GList * info_list)
 		balsa_information(LIBBALSA_INFORMATION_ERROR,
 				  _("Could not save %s: %s"),
 				  libbalsa_vfs_get_uri_utf8(save_uri),
-                                  err && err->message ? 
+                                  err && err->message ?
                                   err->message : "Unknown error");
             g_clear_error(&err);
 	    g_object_unref(save_uri);
@@ -1855,7 +1841,7 @@ bm_next_part_info(BalsaMessage * bmessage)
 
     g_return_val_if_fail(bmessage != NULL, NULL);
     g_return_val_if_fail(bmessage->treeview != NULL, NULL);
-    
+
     gtv = GTK_TREE_VIEW(bmessage->treeview);
     model = gtk_tree_view_get_model(gtv);
 
@@ -1928,7 +1914,7 @@ bm_previous_part_info(BalsaMessage * bmessage)
 
     g_return_val_if_fail(bmessage != NULL, NULL);
     g_return_val_if_fail(bmessage->treeview != NULL, NULL);
-    
+
     gtv = GTK_TREE_VIEW(bmessage->treeview);
     model = gtk_tree_view_get_model(gtv);
 
@@ -1959,7 +1945,7 @@ bm_previous_part_info(BalsaMessage * bmessage)
         } while (!info);
         gtk_tree_path_free(path);
     }
-            
+
     return info;
 }
 
@@ -2051,7 +2037,7 @@ typedef struct _treeSearchT {
     BalsaPartInfo *info;
 } treeSearchT;
 
-static gboolean 
+static gboolean
 treeSearch_Func(GtkTreeModel * model, GtkTreePath *path,
                 GtkTreeIter * iter, gpointer data)
 {
@@ -2067,7 +2053,7 @@ treeSearch_Func(GtkTreeModel * model, GtkTreePath *path,
             g_object_unref(info);
     }
 
-    return FALSE;    
+    return FALSE;
 }
 
 static BalsaPartInfo *
@@ -2091,7 +2077,7 @@ add_body(BalsaMessage * bm, LibBalsaMessageBody * body,
 {
     if(body) {
         BalsaPartInfo *info = part_info_from_body(bm, body);
-        
+
         if (info) {
 	    body = add_part(bm, info, container);
             g_object_unref(info);
@@ -2120,7 +2106,7 @@ add_multipart_mixed(BalsaMessage * bm, LibBalsaMessageBody * body,
                     GtkWidget * container)
 {
     LibBalsaMessageBody * retval = NULL;
-    /* Add first (main) part + anything else with 
+    /* Add first (main) part + anything else with
        Content-Disposition: inline */
     if (body) {
         retval = add_body(bm, body, container);
@@ -2133,7 +2119,7 @@ add_multipart_mixed(BalsaMessage * bm, LibBalsaMessageBody * body,
 		bm->force_inline ||
                 libbalsa_message_body_is_multipart(body) ||
 		g_mime_content_type_is_type(type, "application", "pgp-signature") ||
-		(balsa_app.has_smime && 
+		(balsa_app.has_smime &&
 		 (g_mime_content_type_is_type(type, "application", "pkcs7-signature") ||
 		  g_mime_content_type_is_type(type, "application", "x-pkcs7-signature"))))
                 add_body(bm, body, container);
@@ -2141,7 +2127,7 @@ add_multipart_mixed(BalsaMessage * bm, LibBalsaMessageBody * body,
 #else
             if (libbalsa_message_body_is_inline(body) ||
 		bm->force_inline ||
-		libbalsa_message_body_is_multipart(body)) 
+		libbalsa_message_body_is_multipart(body))
                 add_body(bm, body, container);
 #endif
         }
@@ -2256,7 +2242,7 @@ hide_all_parts(BalsaMessage * bm)
 			  bm_hide_all_helper, NULL);
 }
 
-/* 
+/*
  * If part == -1 then change to no part
  * must release selection before hiding a text widget.
  */
@@ -2298,13 +2284,8 @@ balsa_get_parent_window(GtkWidget * widget)
     if (widget) {
         GtkWidget *toplevel = gtk_widget_get_toplevel(widget);
 
-#if GTK_CHECK_VERSION(2, 18, 0)
         if (gtk_widget_is_toplevel(toplevel) && GTK_IS_WINDOW(toplevel))
             return GTK_WINDOW(toplevel);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-        if (GTK_WIDGET_TOPLEVEL(toplevel) && GTK_IS_WINDOW(toplevel))
-            return GTK_WINDOW(toplevel);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
     }
 
     return GTK_WINDOW(balsa_app.main_window);
@@ -2312,7 +2293,7 @@ balsa_get_parent_window(GtkWidget * widget)
 
 
 /*
- * This function informs the caller if the currently selected part 
+ * This function informs the caller if the currently selected part
  * supports selection/copying etc.
  */
 gboolean
@@ -2344,11 +2325,7 @@ balsa_message_grab_focus(BalsaMessage * bmessage)
     widget = bmessage->current_part->mime_widget->widget;
     g_return_val_if_fail(widget != NULL, FALSE);
 
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_set_can_focus(widget, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    GTK_WIDGET_FLAGS(widget) |= GTK_CAN_FOCUS;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
     gtk_widget_grab_focus(widget);
 
     return TRUE;
@@ -2401,7 +2378,7 @@ handle_mdn_request(GtkWindow *parent, LibBalsaMessage *message)
     from = use_from ? internet_address_list_get_address (use_from, 0) : NULL;
     dn = internet_address_list_get_address (message->headers->dispnotify_to, 0);
     suspicious = !libbalsa_ia_rfc2821_equal(dn, from);
-    
+
     /* Try to find "my" identity first in the to, then in the cc list */
     list = message->headers->to_list;
     len = list ? internet_address_list_length(list) : 0;
@@ -2430,7 +2407,7 @@ handle_mdn_request(GtkWindow *parent, LibBalsaMessage *message)
         }
     }
 
-    
+
     /* Now we decide from the settings of balsa_app.mdn_reply_[not]clean what
        to do...
     */
@@ -2444,7 +2421,7 @@ handle_mdn_request(GtkWindow *parent, LibBalsaMessage *message)
     /* fall back to the current identity if the requested one is empty */
     if (!mdn_ident)
         mdn_ident = balsa_app.current_ident;
-    
+
     /* We *may* send a reply, so let's create a message for that... */
     mdn = create_mdn_reply (mdn_ident, message, action == BALSA_MDN_REPLY_ASKME);
 
@@ -2453,7 +2430,7 @@ handle_mdn_request(GtkWindow *parent, LibBalsaMessage *message)
         gchar *sender;
         gchar *reply_to;
         sender = from ? internet_address_to_string (from, FALSE) : NULL;
-        reply_to = 
+        reply_to =
             internet_address_list_to_string (message->headers->dispnotify_to,
 		                             FALSE);
         gtk_widget_show_all (create_mdn_dialog (parent, sender, reply_to, mdn,
@@ -2484,7 +2461,7 @@ handle_mdn_request(GtkWindow *parent, LibBalsaMessage *message)
 }
 
 static LibBalsaMessage *create_mdn_reply (const LibBalsaIdentity *mdn_ident,
-                                          LibBalsaMessage *for_msg, 
+                                          LibBalsaMessage *for_msg,
                                           gboolean manual)
 {
     LibBalsaMessage *message;
@@ -2513,7 +2490,7 @@ static LibBalsaMessage *create_mdn_reply (const LibBalsaIdentity *mdn_ident,
     params[1] = g_strdup("disposition-notification");
     params[2] = NULL;
     message->parameters = g_list_prepend(message->parameters, params);
-    
+
     /* the first part of the body is an informational note */
     body = libbalsa_message_body_new(message);
     date = libbalsa_message_date_to_utf8(for_msg, balsa_app.date_string);
@@ -2530,7 +2507,7 @@ static LibBalsaMessage *create_mdn_reply (const LibBalsaIdentity *mdn_ident,
     dummy = (gchar *)g_mime_charset_best(body->buffer, strlen(body->buffer));
     body->charset = g_strdup(dummy ? dummy : "us-ascii");
     libbalsa_message_append_part(message, body);
-    
+
     /* the second part is a rfc3798 compliant
        message/disposition-notification */
     body = libbalsa_message_body_new(message);
@@ -2542,7 +2519,7 @@ static LibBalsaMessage *create_mdn_reply (const LibBalsaIdentity *mdn_ident,
     if ((original_rcpt =
 	 libbalsa_message_get_user_header(for_msg, "original-recipient")))
 	g_string_append_printf(report, "Original-Recipient: %s\n",
-			       original_rcpt);	
+			       original_rcpt);
     g_string_append_printf(report, "Final-Recipient: rfc822; %s\n",
                            INTERNET_ADDRESS_MAILBOX(balsa_app.
                                                     current_ident->ia)->
@@ -2685,7 +2662,7 @@ balsa_message_scan_signatures(LibBalsaMessageBody *body,
     while (body) {
 	LibBalsaMsgProtectState this_part_state =
 	    libbalsa_message_body_protect_state(body);
-	
+
 	/* remember: greater means worse... */
 	if (this_part_state > result)
 	    result = this_part_state;
@@ -2732,7 +2709,7 @@ get_crypto_content_icon(LibBalsaMessageBody * body, const gchar * content_type,
     if (!icon_title)
         return icon;
 
-    if (*icon_title && 
+    if (*icon_title &&
 	g_ascii_strcasecmp(content_type, "application/pgp-signature") &&
 	g_ascii_strcasecmp(content_type, "application/pkcs7-signature") &&
 	g_ascii_strcasecmp(content_type, "application/x-pkcs7-signature"))
@@ -2861,7 +2838,7 @@ libbalsa_msg_try_decrypt(LibBalsaMessage * message, LibBalsaMessageBody * body,
 					      NULL);
             }
         }
-    
+
 	/* has been decrypted? - eject if not, otherwise... */
 	if (!this_body->was_encrypted)
 	    return this_body;
@@ -2871,7 +2848,7 @@ libbalsa_msg_try_decrypt(LibBalsaMessage * message, LibBalsaMessageBody * body,
 	mime_type = libbalsa_message_body_get_mime_type(this_body);
     }
     g_free(mime_type);
-    
+
     return this_body;
 }
 
@@ -2907,7 +2884,7 @@ libbalsa_msg_try_mp_signed(LibBalsaMessage * message, LibBalsaMessageBody *body,
             return;
         }
     }
-	
+
     /* check which type of protection we've got */
     signres = libbalsa_message_body_protection(body);
     if (!(signres & LIBBALSA_PROTECT_SIGN))
@@ -2943,11 +2920,11 @@ libbalsa_msg_try_mp_signed(LibBalsaMessage * message, LibBalsaMessageBody *body,
 	g_object_unref(body->parts->next->sig_info);
 	body->parts->next->sig_info = NULL;
     }
-    if (!libbalsa_body_check_signature(body, 
+    if (!libbalsa_body_check_signature(body,
 				       signres & LIBBALSA_PROTECT_RFC3156 ?
 				       GPGME_PROTOCOL_OpenPGP : GPGME_PROTOCOL_CMS))
 	return;
-                
+
     /* evaluate the result */
     if (g_object_get_data(G_OBJECT(message), BALSA_MESSAGE_SIGNED_NOTIFIED))
         return;
@@ -3035,7 +3012,7 @@ libbalsa_msg_part_2440(LibBalsaMessage * message, LibBalsaMessageBody * body,
     libbalsa_mailbox_lock_store(body->message->mailbox);
     rfc2440mode = g_mime_part_check_rfc2440(GMIME_PART(body->mime_part));
     libbalsa_mailbox_unlock_store(body->message->mailbox);
-       
+
     /* if not, or if we have more than one instance of this message open, eject
        (see remark for libbalsa_msg_try_decrypt above) - remember that
        libbalsa_rfc2440_verify would also replace the stream by the "decrypted"
@@ -3063,8 +3040,8 @@ libbalsa_msg_part_2440(LibBalsaMessage * message, LibBalsaMessageBody * body,
     /* do the rfc2440 stuff */
     libbalsa_mailbox_lock_store(body->message->mailbox);
     if (rfc2440mode == GMIME_PART_RFC2440_SIGNED)
-        sig_res = 
-            libbalsa_rfc2440_verify(GMIME_PART(body->mime_part), 
+        sig_res =
+            libbalsa_rfc2440_verify(GMIME_PART(body->mime_part),
 				    &body->sig_info);
     else {
         sig_res =
@@ -3080,7 +3057,7 @@ libbalsa_msg_part_2440(LibBalsaMessage * message, LibBalsaMessageBody * body,
 	}
     }
     libbalsa_mailbox_unlock_store(body->message->mailbox);
-        
+
     if (sig_res == GPG_ERR_NO_ERROR) {
         if (body->sig_info->validity >= GPGME_VALIDITY_MARGINAL &&
             body->sig_info->trust >= GPGME_VALIDITY_MARGINAL)
@@ -3170,7 +3147,7 @@ balsa_message_perform_crypto(LibBalsaMessage * message,
     /* check if the user requested to ignore any crypto stuff */
     if (chk_mode == LB_MAILBOX_CHK_CRYPT_NEVER)
 	return;
-    
+
     /* set up... */
     chk_crypto.chk_mode = chk_mode;
     chk_crypto.no_mp_signed = no_mp_signed;
@@ -3179,7 +3156,7 @@ balsa_message_perform_crypto(LibBalsaMessage * message,
     chk_crypto.subject = g_strdup(LIBBALSA_MESSAGE_GET_SUBJECT(message));
     libbalsa_utf8_sanitize(&chk_crypto.subject, balsa_app.convert_unknown_8bit,
 			   NULL);
-           
+
     /* do the real work */
     message->body_list =
 	libbalsa_msg_perform_crypto_real(message, message->body_list,
@@ -3193,7 +3170,7 @@ balsa_message_perform_crypto(LibBalsaMessage * message,
 
 /*
  * Callback for the "Check Crypto" button in the message's top-level headers.
- * It works roughly like balsa_message_set, but with less overhead and with 
+ * It works roughly like balsa_message_set, but with less overhead and with
  * "check always" mode. Note that this routine adds a temporary reference to
  * the message.
  */
@@ -3224,7 +3201,7 @@ message_recheck_crypto_cb(GtkWidget * button, BalsaMessage * bm)
     balsa_message_perform_crypto(message, LB_MAILBOX_CHK_CRYPT_ALWAYS, FALSE, 2);
 
     /* calculate the signature summary state */
-    prot_state = 
+    prot_state =
         balsa_message_scan_signatures(message->body_list, message);
 
     /* update the icon if necessary */
@@ -3254,7 +3231,7 @@ message_recheck_crypto_cb(GtkWidget * button, BalsaMessage * bm)
         return;
     }
 
-    info = 
+    info =
         tree_next_valid_part_info(gtk_tree_view_get_model(GTK_TREE_VIEW(bm->treeview)),
                                   &iter);
     select_part(bm, info);
diff --git a/src/main-window.c b/src/main-window.c
index 3f29d7d..f45c588 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -40,7 +40,7 @@
 #include "misc.h"
 #include "html.h"
 #include <glib/gi18n.h>
- 
+
 #if HAVE_MACOSX_DESKTOP
 #  include <ige-mac-integration.h>
 #  include "macosx-helpers.h"
@@ -291,11 +291,11 @@ static void bw_send_msg_window_destroy_cb(GtkWidget * widget, gpointer data);
 #endif /*ENABLE_TOUCH_UI */
 static BalsaIndex *bw_notebook_find_page(GtkNotebook * notebook,
                                          gint x, gint y);
-static void bw_notebook_drag_received_cb(GtkWidget* widget, 
-                                         GdkDragContext* context, 
-                                         gint x, gint y, 
-                                         GtkSelectionData* selection_data, 
-                                         guint info, guint32 time, 
+static void bw_notebook_drag_received_cb(GtkWidget* widget,
+                                         GdkDragContext* context,
+                                         gint x, gint y,
+                                         GtkSelectionData* selection_data,
+                                         guint info, guint32 time,
                                          gpointer data);
 static gboolean bw_notebook_drag_motion_cb(GtkWidget* widget,
                                            GdkDragContext* context,
@@ -456,7 +456,7 @@ static const GtkActionEntry entries[] = {
 };
 
 /* Actions that are sensitive only when a mailbox is selected: */
-static const GtkActionEntry mailbox_entries[] = { 
+static const GtkActionEntry mailbox_entries[] = {
     /* Edit menu items */
     {"SelectAll", NULL, N_("Select _All"), "<control>A", NULL,
      G_CALLBACK(bw_select_all_cb)},
@@ -505,7 +505,7 @@ static const GtkActionEntry mailbox_entries[] = {
 
 /* Actions that are sensitive only when one or more messages are
  * selected: */
-static const GtkActionEntry message_entries[] = { 
+static const GtkActionEntry message_entries[] = {
     /* Message menu items */
     {"Reply", BALSA_PIXMAP_REPLY, N_("_Reply..."), MAC_MODIFIER "R",
      N_("Reply to the current message"), G_CALLBACK(bw_replyto_message_cb)},
@@ -569,7 +569,7 @@ static const GtkActionEntry current_message_entries[] = {
 
 /* Actions that are sensitive only when a message is selected and
  * can be modified: */
-static const GtkActionEntry modify_message_entries[] = { 
+static const GtkActionEntry modify_message_entries[] = {
     /* Message menu items */
 #if !defined(ENABLE_TOUCH_UI)
     {"MoveToTrash", GTK_STOCK_DELETE, N_("_Move to Trash"), MAC_MODIFIER "D",
@@ -1020,7 +1020,7 @@ bw_delete_cb(GtkWidget* main_window)
      * (for example) could refuse to get deleted and we would be left
      * with disabled main window. */
     if(libbalsa_is_sending_mail()) {
-        GtkWidget* d = 
+        GtkWidget* d =
             gtk_message_dialog_new(GTK_WINDOW(main_window),
                                    GTK_DIALOG_MODAL,
                                    GTK_MESSAGE_QUESTION,
@@ -1032,7 +1032,7 @@ bw_delete_cb(GtkWidget* main_window)
          * but we must know their ids. */
         gtk_widget_destroy(d);
         return retval != GTK_RESPONSE_YES; /* keep running unless OK */
-    }                                          
+    }
 #endif
     return FALSE; /* allow delete */
 }
@@ -1679,15 +1679,15 @@ balsa_window_new()
 #if HAVE_MACOSX_DESKTOP
     ige_mac_menu_set_menu_bar(GTK_MENU_SHELL(menubar));
     ige_mac_menu_set_quit_menu_item(GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/FileMenu/Quit")));
- 
+
     group = ige_mac_menu_add_app_menu_group();
     ige_mac_menu_add_app_menu_item(group,
-                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")), 
+                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/HelpMenu/About")),
                                    NULL);
-				   
+
     group = ige_mac_menu_add_app_menu_group();
     ige_mac_menu_add_app_menu_item(group,
-                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/EditMenu/Preferences")), 
+                                  GTK_MENU_ITEM(gtk_ui_manager_get_widget(ui_manager, "/MainMenu/EditMenu/Preferences")),
                                    NULL);
     libbalsa_macosx_menu(GTK_WIDGET(window), GTK_MENU_SHELL(menubar));
 #else
@@ -1764,7 +1764,7 @@ balsa_window_new()
                  "vadjustment", &vadj, NULL);
     window->mblist = gtk_scrolled_window_new(hadj, vadj);
 
-    gtk_container_add(GTK_CONTAINER(window->mblist), 
+    gtk_container_add(GTK_CONTAINER(window->mblist),
                       GTK_WIDGET(balsa_app.mblist));
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(window->mblist),
                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
@@ -1782,8 +1782,8 @@ balsa_window_new()
     bw_set_active(window, "ShowMailboxTree", balsa_app.show_mblist, FALSE);
 #endif                          /* !defined(ENABLE_TOUCH_UI) */
 
-    gtk_paned_set_position(GTK_PANED(window->paned_master), 
-                           balsa_app.show_mblist 
+    gtk_paned_set_position(GTK_PANED(window->paned_master),
+                           balsa_app.show_mblist
                            ? balsa_app.mblist_width
                            : 0);
 
@@ -1806,14 +1806,14 @@ balsa_window_new()
         GtkAction *action = bw_get_action(window, header_options[i]);
         if (i == balsa_app.shown_headers)
             gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(action), TRUE);
-        g_signal_connect(action, "activate", 
+        g_signal_connect(action, "activate",
                          G_CALLBACK(bw_header_activate_cb), window);
     }
 
 #if !defined(ENABLE_TOUCH_UI)
     for (i = 0; i < G_N_ELEMENTS(threading_options); i++) {
         GtkAction *action = bw_get_action(window, threading_options[i]);
-        g_signal_connect(action, "activate", 
+        g_signal_connect(action, "activate",
                          G_CALLBACK(bw_threading_activate_cb), window);
     }
 
@@ -1872,8 +1872,8 @@ balsa_window_new()
 }
 
 /*
- * Enable or disable menu items/toolbar buttons which depend 
- * on whether there is a mailbox open. 
+ * Enable or disable menu items/toolbar buttons which depend
+ * on whether there is a mailbox open.
  */
 static void
 bw_enable_expand_collapse(BalsaWindow * window, LibBalsaMailbox * mailbox)
@@ -1987,8 +1987,8 @@ balsa_window_update_book_menus(BalsaWindow * window)
 }
 
 /*
- * Enable or disable menu items/toolbar buttons which depend 
- * on if there is a message selected. 
+ * Enable or disable menu items/toolbar buttons which depend
+ * on if there is a message selected.
  */
 static void
 bw_enable_message_menus(BalsaWindow * window, guint msgno)
@@ -2068,7 +2068,7 @@ enable_empty_trash(BalsaWindow * window, TrashState status)
     } else {
         switch(status) {
         case TRASH_CHECK:
-            /* Check msg count in trash; this may be expensive... 
+            /* Check msg count in trash; this may be expensive...
              * lets just enable empty trash to be on the safe side */
 #if CAN_DO_MAILBOX_OPENING_VERY_VERY_FAST
             if (balsa_app.trash) {
@@ -2106,7 +2106,7 @@ balsa_window_enable_continue(BalsaWindow * window)
         /* This is commented out because it causes long delays and
          * flickering of the mailbox list if large numbers of messages
          * are selected.  Checking the has_unread_messages flag works
-         * almost as well. 
+         * almost as well.
          * */
 /*      libbalsa_mailbox_open(balsa_app.draftbox, FALSE); */
 /*      if (libbalsa_mailbox_total_messages(balsa_app.draftbox) > 0) { */
@@ -2197,7 +2197,7 @@ bw_set_filter_menu(BalsaWindow * window, int mask)
     }
 }
 
-/* balsa_window_open_mbnode: 
+/* balsa_window_open_mbnode:
    opens mailbox, creates message index. mblist_open_mailbox() is what
    you want most of the time because it can switch between pages if a
    mailbox is already on one of them.
@@ -2333,7 +2333,7 @@ bw_real_open_mbnode(BalsaWindow *window, BalsaMailboxNode * mbnode,
     if (!window || failurep) {
         libbalsa_information(
             LIBBALSA_INFORMATION_ERROR,
-            _("Unable to Open Mailbox!\n%s."), 
+            _("Unable to Open Mailbox!\n%s."),
 	    err ? err->message : _("Unknown error"));
 	g_clear_error(&err);
         g_object_unref(g_object_ref_sink(index));
@@ -2627,7 +2627,7 @@ static pthread_mutex_t open_list_lock = PTHREAD_MUTEX_INITIALIZER;
 #define LOCK_OPEN_LIST pthread_mutex_lock(&open_list_lock)
 #define UNLOCK_OPEN_LIST pthread_mutex_unlock(&open_list_lock)
 #else
-#define LOCK_OPEN_LIST 
+#define LOCK_OPEN_LIST
 #define UNLOCK_OPEN_LIST
 #endif
 static void
@@ -2693,7 +2693,7 @@ bw_show_about_box(GtkAction * action, gpointer user_data)
 
     const gchar *translator_credits = _("translator-credits");
     /* FIXME: do we need error handling for this? */
-    GdkPixbuf *balsa_logo = 
+    GdkPixbuf *balsa_logo =
         gdk_pixbuf_new_from_file(BALSA_DATA_PREFIX
                                  "/pixmaps/balsa_logo.png", NULL);
 
@@ -2802,7 +2802,7 @@ ensure_check_mail_dialog(BalsaWindow * window)
 
     if (progress_dialog && GTK_IS_WIDGET(progress_dialog))
 	gtk_widget_destroy(GTK_WIDGET(progress_dialog));
-    
+
     progress_dialog =
 	gtk_dialog_new_with_buttons(_("Checking Mail..."),
                                     GTK_WINDOW(window),
@@ -2812,24 +2812,24 @@ ensure_check_mail_dialog(BalsaWindow * window)
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(progress_dialog, GTK_WINDOW(window));
 #endif
-    gtk_window_set_wmclass(GTK_WINDOW(progress_dialog), 
+    gtk_window_set_wmclass(GTK_WINDOW(progress_dialog),
 			   "progress_dialog", "Balsa");
-        
+
     g_signal_connect(G_OBJECT(progress_dialog), "destroy",
 		     G_CALLBACK(bw_progress_dialog_destroy_cb), NULL);
     g_signal_connect(G_OBJECT(progress_dialog), "response",
 		     G_CALLBACK(bw_progress_dialog_response_cb), NULL);
-    
+
     content_box =
         GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(progress_dialog)));
     progress_dialog_source = gtk_label_new(_("Checking Mail..."));
     gtk_box_pack_start(content_box, progress_dialog_source,
                        FALSE, FALSE, 0);
-    
+
     progress_dialog_message = gtk_label_new("");
     gtk_box_pack_start(content_box, progress_dialog_message,
                        FALSE, FALSE, 0);
-    
+
     progress_dialog_bar = gtk_progress_bar_new();
     gtk_box_pack_start(content_box, progress_dialog_bar,
                        FALSE, FALSE, 0);
@@ -2862,10 +2862,10 @@ check_new_messages_real(BalsaWindow * window, int type)
     if (window)
         bw_set_sensitive(window, "GetNewMail", FALSE);
 
-    quiet_check = (type == TYPE_CALLBACK) 
+    quiet_check = (type == TYPE_CALLBACK)
         ? 0 : balsa_app.quiet_background_check;
 
-    if (type == TYPE_CALLBACK && 
+    if (type == TYPE_CALLBACK &&
         (balsa_app.pwindow_option == WHILERETR ||
          (balsa_app.pwindow_option == UNTILCLOSED && progress_dialog)))
 	ensure_check_mail_dialog(window);
@@ -2880,7 +2880,7 @@ check_new_messages_real(BalsaWindow * window, int type)
     info->window = window ? g_object_ref(window) : window;
     pthread_create(&get_mail_thread,
                    NULL, (void *) &bw_check_messages_thread, info);
-    
+
     /* Detach so we don't need to pthread_join
      * This means that all resources will be
      * reclaimed as soon as the thread exits
@@ -2982,7 +2982,7 @@ bw_page_setup_cb(GtkAction * action, gpointer data)
     message_print_page_setup(GTK_WINDOW(data));
 }
 
-/* Callback for `Print current message' item on the `File' menu, 
+/* Callback for `Print current message' item on the `File' menu,
  * and the toolbar button. */
 static void
 bw_message_print_cb(GtkAction * action, gpointer data)
@@ -3034,13 +3034,13 @@ bw_mailbox_check(LibBalsaMailbox * mailbox)
 static void
 bw_check_messages_thread(struct check_messages_thread_info *info)
 {
-    /*  
+    /*
      *  It is assumed that this will always be called as a pthread,
      *  and that the calling procedure will check for an existing lock
      */
     MailThreadMessage *threadmessage;
     GSList *list = info->list;
-    
+
     pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
 
     MSGMAILTHREAD(threadmessage, LIBBALSA_NTFY_SOURCE, NULL, "POP3", 0, 0);
@@ -3052,7 +3052,7 @@ bw_check_messages_thread(struct check_messages_thread_info *info)
 
     MSGMAILTHREAD(threadmessage, LIBBALSA_NTFY_FINISHED, NULL, "Finished",
                   0, 0);
-    
+
     pthread_mutex_unlock(&checking_mail_lock);
 
     if (info->window) {
@@ -3061,7 +3061,7 @@ bw_check_messages_thread(struct check_messages_thread_info *info)
         g_object_unref(info->window);
         gdk_threads_leave();
     }
-    
+
     g_free(info);
     pthread_exit(0);
 }
@@ -3105,7 +3105,7 @@ mail_progress_notify_cb(GIOChannel * source, GIOCondition condition,
         g_free(msgbuffer);
         return TRUE;
     }
-    
+
     gdk_threads_enter();
 
     statusbar = GTK_STATUSBAR((*window)->statusbar);
@@ -3293,7 +3293,7 @@ send_progress_notify_cb(GIOChannel * source, GIOCondition condition,
 
     return TRUE;
 }
- 
+
 #endif
 
 /** Returns properly formatted string informing the user about the
@@ -3358,13 +3358,8 @@ bw_display_new_mail_notification(int num_new, int has_new)
                       num_new + num_total), num_new + num_total);
             else
                 msg = g_strdup(_("Balsa: you have new mail."));
-#if GTK_CHECK_VERSION(2, 15, 0)
             gtk_status_icon_set_tooltip_text(balsa_app.main_window->
                                              new_mail_tray, msg);
-#else                           /* GTK_CHECK_VERSION(2, 16, 0) */
-            gtk_status_icon_set_tooltip(balsa_app.main_window->
-                                        new_mail_tray, msg);
-#endif                          /* GTK_CHECK_VERSION(2, 16, 0) */
             gtk_status_icon_set_visible(balsa_app.main_window->
                                         new_mail_tray, TRUE);
             g_free(msg);
@@ -3675,7 +3670,7 @@ bw_next_message_cb(GtkAction * action, gpointer data)
         BALSA_INDEX(balsa_window_find_current_index(BALSA_WINDOW(data))));
 }
 
-/* Select next unread message, changing mailboxes if necessary; 
+/* Select next unread message, changing mailboxes if necessary;
  * returns TRUE if mailbox was changed. */
 gboolean
 balsa_window_next_unread(BalsaWindow * window)
@@ -3852,7 +3847,7 @@ bw_trash_message_cb(GtkAction * action, gpointer data)
 static void
 bw_toggle_deleted_message_cb(GtkAction * action, gpointer data)
 {
-    LibBalsaMessageFlag f = LIBBALSA_MESSAGE_FLAG_DELETED; 
+    LibBalsaMessageFlag f = LIBBALSA_MESSAGE_FLAG_DELETED;
     balsa_index_toggle_flag
         (BALSA_INDEX(balsa_window_find_current_index(BALSA_WINDOW(data))),
          f);
@@ -3943,7 +3938,7 @@ bw_set_sort_menu(BalsaWindow *window,
 }
 
 static void
-bw_sort_change_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data) 
+bw_sort_change_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data)
 {
     BalsaWindow *window = BALSA_WINDOW(data);
     LibBalsaMailboxSortFields key;
@@ -3980,7 +3975,7 @@ bw_sort_change_cb(GtkRadioAction *action, GtkRadioAction *current, gpointer data
                                        LB_MAILBOX_THREADING_FLAT);
     order = libbalsa_mailbox_get_sort_type(mailbox);
     gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(mailbox),
-                                         col, 
+                                         col,
                                          order == LB_MAILBOX_SORT_TYPE_ASC
                                          ? GTK_SORT_ASCENDING
                                          : GTK_SORT_DESCENDING);
@@ -4012,7 +4007,7 @@ bw_toggle_order_cb(GtkToggleAction * action, gpointer data)
         g_warning("This should not be possible"); return;
     }
     gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(mailbox),
-                                         col, 
+                                         col,
                                          order == LB_MAILBOX_SORT_TYPE_ASC
                                          ? GTK_SORT_ASCENDING
                                          : GTK_SORT_DESCENDING);
@@ -4031,7 +4026,7 @@ bw_wrap_message_cb(GtkToggleAction * action, gpointer data)
     refresh_preferences_manager();
 }
 
-#if !defined(ENABLE_TOUCH_UI) 
+#if !defined(ENABLE_TOUCH_UI)
 static void
 bw_show_helper(GtkToggleAction * action, gboolean * active,
                GtkWidget * widget)
@@ -4226,7 +4221,7 @@ bw_find_button_clicked(GtkWidget * widget, gpointer data)
     gtk_dialog_response(GTK_DIALOG(dialog), GPOINTER_TO_INT(data));
 }
 
-static void 
+static void
 bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 {
     /* Condition set up for the search, it will be of type
@@ -4258,7 +4253,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 	GtkToggleButton *matching_body, *matching_from;
         GtkToggleButton *matching_to, *matching_cc, *matching_subject;
 	gint ok;
-	
+
 #if HAVE_MACOSX_DESKTOP
 	libbalsa_macosx_menu_for_parent(dia, GTK_WINDOW(window));
 #endif
@@ -4278,14 +4273,14 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
 	/* builds the toggle buttons to specify fields concerned by
          * the search. */
-    
+
 	frame = gtk_frame_new(_("In:"));
 	gtk_frame_set_label_align(GTK_FRAME(frame),
 				  GTK_POS_LEFT, GTK_POS_TOP);
 	gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
 	gtk_container_set_border_width(GTK_CONTAINER(frame), 6);
 	gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 2);
-    
+
 	table = gtk_table_new(2, 3, TRUE);
 	matching_body    = bw_add_check_button(table, _("_Body"),    0, 0);
 	matching_to      = bw_add_check_button(table, _("_To:"),     1, 0);
@@ -4305,12 +4300,12 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 	gtk_container_set_border_width(GTK_CONTAINER(box), 6);
 	button = gtk_button_new_from_stock(GTK_STOCK_APPLY);
 	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(bw_find_button_clicked), 
+			 G_CALLBACK(bw_find_button_clicked),
 			 GINT_TO_POINTER(FIND_RESPONSE_FILTER));
 	gtk_container_add(GTK_CONTAINER(box), button);
 	button = gtk_button_new_from_stock(GTK_STOCK_CLEAR);
 	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(bw_find_button_clicked), 
+			 G_CALLBACK(bw_find_button_clicked),
 			 GINT_TO_POINTER(FIND_RESPONSE_RESET));
 	gtk_container_add(GTK_CONTAINER(box), button);
 	gtk_container_add(GTK_CONTAINER(frame), box);
@@ -4326,12 +4321,12 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 	gtk_container_add(GTK_CONTAINER(frame), box);
 	w = gtk_vbox_new(TRUE, 2);
 	gtk_container_set_border_width(GTK_CONTAINER(w), 6);
-	reverse_button = 
+	reverse_button =
             gtk_check_button_new_with_mnemonic(_("_Reverse search"));
 	gtk_box_pack_start(GTK_BOX(w), reverse_button, TRUE, TRUE, 0);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(reverse_button),
                                      reverse);
-	wrap_button = 
+	wrap_button =
             gtk_check_button_new_with_mnemonic(_("_Wrap around"));
 	gtk_box_pack_start(GTK_BOX(w), wrap_button, TRUE, TRUE, 0);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(wrap_button),
@@ -4343,7 +4338,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 	gtk_container_set_border_width(GTK_CONTAINER(w), 6);
 	button = gtk_button_new_from_stock(GTK_STOCK_OK);
 	g_signal_connect(G_OBJECT(button), "clicked",
-			 G_CALLBACK(bw_find_button_clicked), 
+			 G_CALLBACK(bw_find_button_clicked),
 			 GINT_TO_POINTER(GTK_RESPONSE_OK));
 	gtk_container_add(GTK_CONTAINER(w), button);
 	gtk_box_pack_start(GTK_BOX(box), w, TRUE, TRUE, 0);
@@ -4384,7 +4379,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 		cnd->match.string.string =
                     g_strdup(gtk_entry_get_text(GTK_ENTRY(search_entry)));
 		cnd->match.string.fields=CONDITION_EMPTY;
-                
+
 		if (gtk_toggle_button_get_active(matching_body))
 		    CONDITION_SETMATCH(cnd,CONDITION_MATCH_BODY);
 		if (gtk_toggle_button_get_active(matching_to))
@@ -4397,14 +4392,14 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 		    CONDITION_SETMATCH(cnd,CONDITION_MATCH_CC);
 		if (!(cnd->match.string.fields!=CONDITION_EMPTY &&
                     cnd->match.string.string[0]))
-                    
+
 		    /* FIXME : We should print error messages, but for
 		     * that we should first make find dialog non-modal
 		     * balsa_information(LIBBALSA_INFORMATION_ERROR,_("You
 		     * must specify at least one field to look in"));
 		     * *balsa_information(LIBBALSA_INFORMATION_ERROR,_("You
 		     * must provide a non-empty string")); */
-                    ok = GTK_RESPONSE_CANCEL; 
+                    ok = GTK_RESPONSE_CANCEL;
                 break;
 	    case GTK_RESPONSE_HELP:
                 gtk_show_uri(NULL, "ghelp:balsa?win-search",
@@ -4420,7 +4415,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 		bw_reset_filter_cb(NULL, window);
 		/* fall through */
             default:
-		ok = GTK_RESPONSE_CANCEL; 
+		ok = GTK_RESPONSE_CANCEL;
 		break;/* cancel or just close */
             } /* end of switch */
 	} while (ok==GTK_RESPONSE_HELP);
@@ -4433,7 +4428,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 	search_iter = NULL;
 
         if(ok == FIND_RESPONSE_FILTER) {
-            LibBalsaMailbox *mailbox = 
+            LibBalsaMailbox *mailbox =
                 BALSA_INDEX(bindex)->mailbox_node->mailbox;
             LibBalsaCondition *filter, *res;
             filter = bw_get_view_filter(window);
@@ -4506,7 +4501,7 @@ bw_filter_run_cb(GtkAction * action, gpointer data)
 	/* FIXME : Perhaps should we be able to apply filters on folders (ie recurse on all mailboxes in it),
 	   but there are problems of infinite recursion (when one mailbox being filtered is also the destination
 	   of the filter action (eg a copy)). So let's see that later :) */
-	balsa_information(LIBBALSA_INFORMATION_WARNING, 
+	balsa_information(LIBBALSA_INFORMATION_WARNING,
                           _("You can apply filters only on mailbox\n"));
 }
 
@@ -4581,7 +4576,7 @@ bw_get_flag_filter(BalsaWindow *window)
     };
     unsigned i, j;
     LibBalsaCondition *filter;
-    
+
     for(i=0; i<ELEMENTS(match_flags); i++)
         match_flags[i].setby = -1;
 
@@ -4602,7 +4597,7 @@ bw_get_flag_filter(BalsaWindow *window)
                 break;
             }
     }
-    
+
     /* match_flags contains collected information, time to create a
      * LibBalsaCondition data structure.
      */
@@ -4672,7 +4667,7 @@ bw_hide_changed_cb(GtkToggleAction * toggle_action, gpointer data)
     BalsaWindow *bw = BALSA_WINDOW(data);
     GtkWidget *index = balsa_window_find_current_index(bw);
     LibBalsaCondition *filter;
-    
+
     /* PART 1: assure menu consistency */
     if (gtk_toggle_action_get_active(toggle_action)) {
         /* we may need to deactivate coupled negated flag. */
@@ -4827,7 +4822,7 @@ balsa_change_window_layout(BalsaWindow *window)
     g_object_ref(window->notebook);
     g_object_ref(window->mblist);
     g_object_ref(window->preview);
- 
+
     gtk_container_remove(GTK_CONTAINER
                          (gtk_widget_get_parent(window->notebook)),
                          window->notebook);
@@ -4843,8 +4838,8 @@ balsa_change_window_layout(BalsaWindow *window)
     g_object_unref(window->notebook);
     g_object_unref(window->mblist);
     g_object_unref(window->preview);
- 
-    gtk_paned_set_position(GTK_PANED(window->paned_master), 
+
+    gtk_paned_set_position(GTK_PANED(window->paned_master),
                            balsa_app.show_mblist ?
                            balsa_app.mblist_width : 0);
     gtk_widget_show(window->paned_slave);
@@ -4871,7 +4866,7 @@ bw_size_allocate_cb(GtkWidget * window, GtkAllocation * alloc)
     }
 }
 
-/* When page is switched we change the preview window and the selected 
+/* When page is switched we change the preview window and the selected
    mailbox in the mailbox tree.
  */
 static void
@@ -5051,7 +5046,7 @@ bw_send_msg_window_destroy_cb(GtkWidget * widget, gpointer data)
 
 
 /* notebook_find_page
- * 
+ *
  * Description: Finds the page from which notebook page tab the
  * coordinates are over.
  **/
@@ -5065,25 +5060,17 @@ bw_notebook_find_page (GtkNotebook* notebook, gint x, gint y)
     gint label_y;
     gint label_width;
     gint label_height;
-#if GTK_CHECK_VERSION(2, 18, 0)
     GtkAllocation allocation;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
-    
+
     /* x and y are relative to the notebook, but the label allocations
      * are relative to the main window. */
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_get_allocation(GTK_WIDGET(notebook), &allocation);
     x += allocation.x;
     y += allocation.y;
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    x += GTK_WIDGET(notebook)->allocation.x;
-    y += GTK_WIDGET(notebook)->allocation.y;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     while ((page = gtk_notebook_get_nth_page (notebook, page_num)) != NULL) {
         label = gtk_notebook_get_tab_label (notebook, page);
-        
-#if GTK_CHECK_VERSION(2, 18, 0)
+
         gtk_widget_get_allocation(label, &allocation);
         label_x     = allocation.x;
         label_width = allocation.width;
@@ -5096,19 +5083,6 @@ bw_notebook_find_page (GtkNotebook* notebook, gint x, gint y)
                 return BALSA_INDEX(gtk_bin_get_child(GTK_BIN(page)));
             }
         }
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-        label_x = label->allocation.x;
-        label_width = label->allocation.width;
-        
-        if (x > label_x && x < label_x + label_width) {
-            label_y = label->allocation.y;
-            label_height = label->allocation.height;
-            
-            if (y > label_y && y < label_y + label_height) {
-                return BALSA_INDEX(gtk_bin_get_child(GTK_BIN(page)));
-            }
-        }
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
         ++page_num;
     }
 
@@ -5117,7 +5091,7 @@ bw_notebook_find_page (GtkNotebook* notebook, gint x, gint y)
 
 
 /* bw_notebook_drag_received_cb
- * 
+ *
  * Description: Signal handler for the drag-data-received signal from
  * the GtkNotebook widget.  Finds the tab the messages were dragged
  * over, then transfers them.
@@ -5154,17 +5128,12 @@ bw_notebook_drag_received_cb(GtkWidget * widget, GdkDragContext * context,
 
     if (index == NULL)
         return;
-    
+
     mailbox = index->mailbox_node->mailbox;
 
     if (mailbox != NULL && mailbox != orig_mailbox)
-#if GTK_CHECK_VERSION(2,22,0)
         balsa_index_transfer(orig_index, selected, mailbox,
                              gdk_drag_context_get_selected_action(context) != GDK_ACTION_MOVE);
-#else
-        balsa_index_transfer(orig_index, selected, mailbox,
-                             context->action != GDK_ACTION_MOVE);
-#endif
     balsa_index_selected_msgnos_free(orig_index, selected);
 }
 
@@ -5173,26 +5142,19 @@ static gboolean bw_notebook_drag_motion_cb(GtkWidget * widget,
                                            gint x, gint y, guint time,
                                            gpointer user_data)
 {
-#if GTK_CHECK_VERSION(2,22,0)
     gdk_drag_status(context,
                     (gdk_drag_context_get_actions(context) ==
                      GDK_ACTION_COPY) ? GDK_ACTION_COPY :
                     GDK_ACTION_MOVE, time);
-#else
-    gdk_drag_status(context,
-                    (context->actions ==
-                     GDK_ACTION_COPY) ? GDK_ACTION_COPY :
-                    GDK_ACTION_MOVE, time);
-#endif
 
     return FALSE;
 }
 
 /* bw_progress_timeout
- * 
+ *
  * This function is called at a preset interval to cause the progress
- * bar to move in activity mode.  
- * this routine is called from g_timeout_dispatch() and needs to take care 
+ * bar to move in activity mode.
+ * this routine is called from g_timeout_dispatch() and needs to take care
  * of GDK locking itself using gdk_threads_{enter,leave}
  *
  * Use of the progress bar to show a fraction of a task takes priority.
@@ -5214,7 +5176,7 @@ bw_progress_timeout(BalsaWindow ** window)
 
 
 /* balsa_window_increase_activity
- * 
+ *
  * Calling this causes this to the progress bar of the window to
  * switch into activity mode if it's not already going.  Otherwise it
  * simply increments the counter (so that multiple threads can
@@ -5251,7 +5213,7 @@ balsa_window_increase_activity(BalsaWindow * window, const gchar * message)
 
 
 /* balsa_window_decrease_activity
- * 
+ *
  * When called, decreases the reference counter of the progress
  * activity bar, if it goes to zero the progress bar is stopped and
  * cleared.
@@ -5261,7 +5223,7 @@ balsa_window_decrease_activity(BalsaWindow * window, const gchar * message)
 {
     GSList *link;
     GtkProgressBar *progress_bar;
-    
+
     link = g_slist_find_custom(window->activity_messages, message,
                                (GCompareFunc) strcmp);
     g_free(link->data);
@@ -5288,14 +5250,14 @@ balsa_window_decrease_activity(BalsaWindow * window, const gchar * message)
 
 
 /* balsa_window_setup_progress
- * 
- * window: BalsaWindow that contains the progressbar 
+ *
+ * window: BalsaWindow that contains the progressbar
  * text:   to appear superimposed on the progress bar,
  *         or NULL to clear and release the progress bar.
- * 
+ *
  * returns: true if initialization is successful, otherwise returns
  * false.
- * 
+ *
  * Initializes the progress bar for incremental operation with a range
  * from 0 to 1.  If the bar is already in activity mode, the function
  * returns false; if the initialization is successful it returns true.
@@ -5304,10 +5266,10 @@ gboolean
 balsa_window_setup_progress(BalsaWindow * window, const gchar * text)
 {
     GtkProgressBar *progress_bar;
-    
+
     if (text) {
         /* make sure the progress bar is currently unused */
-        if (window->progress_type == BALSA_PROGRESS_INCREMENT) 
+        if (window->progress_type == BALSA_PROGRESS_INCREMENT)
             return FALSE;
         window->progress_type = BALSA_PROGRESS_INCREMENT;
     } else
@@ -5326,7 +5288,7 @@ balsa_window_setup_progress(BalsaWindow * window, const gchar * text)
  * balsa_window_setup_progress, this function increments the
  * adjustment by one and executes any pending gtk events.  So the
  * progress bar will be shown as updated even if called within a loop.
- * 
+ *
  * NOTE: This does not work with threads because a thread cannot
  * process events by itself and it holds the GDK lock preventing the
  * main thread from processing events.
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 09511f9..078f0a9 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -4,17 +4,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -178,10 +178,10 @@ static void edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg);
 #endif
 static void change_identity_dialog_cb(GtkAction * action,
                                       BalsaSendmsg * bsmsg);
-static void replace_identity_signature(BalsaSendmsg* bsmsg, 
+static void replace_identity_signature(BalsaSendmsg* bsmsg,
                                        LibBalsaIdentity* new_ident,
                                        LibBalsaIdentity* old_ident,
-                                       gint* replace_offset, gint siglen, 
+                                       gint* replace_offset, gint siglen,
                                        const gchar* new_sig);
 static void update_bsmsg_identity(BalsaSendmsg*, LibBalsaIdentity*);
 
@@ -245,8 +245,8 @@ static void bsmsg_set_subject_from_body(BalsaSendmsg * bsmsg,
                                         LibBalsaIdentity * ident);
 
 /* the array of locale names and charset names included in the MIME
-   type information.  
-   if you add a new encoding here add to SendCharset in libbalsa.c 
+   type information.
+   if you add a new encoding here add to SendCharset in libbalsa.c
 */
 struct SendLocales {
     const gchar *locale, *charset, *lang_name;
@@ -261,8 +261,8 @@ struct SendLocales {
     {"cs_CZ", "ISO-8859-2",    N_("_Czech")},
     {"da_DK", "ISO-8859-1",    N_("_Danish")},
     {"nl_NL", "ISO-8859-15",   N_("_Dutch")},
-    {"en_US", "ISO-8859-1",    N_("_English (American)")}, 
-    {"en_GB", "ISO-8859-1",    N_("_English (British)")}, 
+    {"en_US", "ISO-8859-1",    N_("_English (American)")},
+    {"en_GB", "ISO-8859-1",    N_("_English (British)")},
     {"eo_XX", "UTF-8",         N_("_Esperanto")},
     {"et_EE", "ISO-8859-15",   N_("_Estonian")},
     {"fi_FI", "ISO-8859-15",   N_("_Finnish")},
@@ -428,7 +428,7 @@ static const GtkToggleActionEntry toggle_entries[] = {
     {"Fcc", NULL, N_("F_cc"), NULL, NULL,
      G_CALLBACK(toggle_fcc_cb), TRUE},
     {"RequestMDN", BALSA_PIXMAP_REQUEST_MDN,
-     N_("_Request Disposition Notification"), NULL, 
+     N_("_Request Disposition Notification"), NULL,
      N_("Request Message Disposition Notification"),
      G_CALLBACK(toggle_reqdispnotify_cb), FALSE},
     {"Flowed", NULL, N_("_Format = Flowed"), NULL,
@@ -718,7 +718,7 @@ static void
 balsa_attach_info_class_init(BalsaAttachInfoClass *klass)
 {
     GObjectClass *object_class = G_OBJECT_CLASS(klass);
-    
+
     object_class->finalize = balsa_attach_info_destroy;
 }
 
@@ -740,7 +740,7 @@ balsa_attach_info_get_type()
                 0,
                 (GInstanceInitFunc) balsa_attach_info_init
             };
-        balsa_attach_info_type = 
+        balsa_attach_info_type =
            g_type_register_static (G_TYPE_OBJECT, "BalsaAttachInfo",
                                    &balsa_attach_info_info, 0);
     }
@@ -751,7 +751,7 @@ static void
 balsa_attach_info_init(GObject *object, gpointer data)
 {
     BalsaAttachInfo * info = BALSA_ATTACH_INFO(object);
-    
+
     info->popup_menu = NULL;
     info->file_uri = NULL;
     info->force_mime_type = NULL;
@@ -762,7 +762,7 @@ balsa_attach_info_init(GObject *object, gpointer data)
 }
 
 static BalsaAttachInfo*
-balsa_attach_info_new(BalsaSendmsg *bm) 
+balsa_attach_info_new(BalsaSendmsg *bm)
 {
     BalsaAttachInfo * info = g_object_new(TYPE_BALSA_ATTACH_INFO, NULL);
 
@@ -812,7 +812,7 @@ balsa_attach_info_destroy(GObject * object)
     libbalsa_message_headers_destroy(info->headers);
 
     parent_class = g_type_class_peek_parent(G_OBJECT_GET_CLASS(object));
-    parent_class->finalize(object);    
+    parent_class->finalize(object);
 }
 
 /* ===================================================================
@@ -841,7 +841,7 @@ append_comma_separated(GtkEditable *editable, const gchar * text)
 #define BALSA_SENDMSG_ROW_REF_KEY      "balsa-sendmsg-row-ref"
 static void
 address_book_cb(LibBalsaAddressView * address_view,
-                GtkTreeRowReference * row_ref, 
+                GtkTreeRowReference * row_ref,
                 BalsaSendmsg * bsmsg)
 {
     GtkWidget *ab;
@@ -962,7 +962,7 @@ delete_event_cb(GtkWidget * widget, GdkEvent * e, gpointer data)
 static void
 close_window_cb(GtkAction * action, gpointer data)
 {
-    BalsaSendmsg* bsmsg = data;   
+    BalsaSendmsg* bsmsg = data;
     BALSA_DEBUG_MSG("close_window_cb: start\n");
     if(!delete_handler(bsmsg))
 	gtk_widget_destroy(bsmsg->window);
@@ -1121,7 +1121,7 @@ edit_with_gnome_check(gpointer data) {
         perror("waitpid");
         return TRUE;
     } else if(pid == 0) return TRUE;
-    
+
     tmp = fopen(data_real->filename, "r");
     if(tmp == NULL){
         perror("fopen");
@@ -1147,7 +1147,7 @@ edit_with_gnome_check(gpointer data) {
                 const gchar *type_string = _(address_types[type]);
                 if (libbalsa_str_has_prefix(line, type_string))
                     libbalsa_address_view_set_from_string
-                        (data_real->bsmsg->recipient_view, 
+                        (data_real->bsmsg->recipient_view,
                          address_types[type],
                          line + strlen(type_string) + 1);
             }
@@ -1179,7 +1179,7 @@ edit_with_gnome_check(gpointer data) {
  *
  * We fork twice current process, so we get:
  *
- * - Old (parent) process (this needs to continue because we don't want 
+ * - Old (parent) process (this needs to continue because we don't want
  *   balsa to 'hang' until the editor exits
  * - New (child) process (forks and waits for child to finish)
  * - New (grandchild) process (executes editor)
@@ -1189,7 +1189,7 @@ edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg)
 {
     static const char TMP_PATTERN[] = "/tmp/balsa-edit-XXXXXX";
     gchar filename[sizeof(TMP_PATTERN)];
-    balsa_edit_with_gnome_data *data = 
+    balsa_edit_with_gnome_data *data =
         g_malloc(sizeof(balsa_edit_with_gnome_data));
     pid_t pid;
     FILE *tmp;
@@ -1224,7 +1224,7 @@ edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg)
 
 
     tmp = fdopen(tmpfd, "w+");
-    
+
     if(balsa_app.edit_headers) {
         guint type;
 
@@ -1250,16 +1250,16 @@ edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg)
     fclose(tmp);
     if ((pid = fork()) < 0) {
         perror ("fork");
-        return; 
-    } 
+        return;
+    }
     if (pid == 0) {
         setpgid(0, 0);
-        execvp (argv[0], argv); 
-        perror ("execvp"); 
-        g_strfreev (argv); 
+        execvp (argv[0], argv);
+        perror ("execvp");
+        g_strfreev (argv);
         exit(127);
     }
-    g_strfreev (argv); 
+    g_strfreev (argv);
     /* Return immediately. We don't want balsa to 'hang' */
     data->pid_editor = pid;
     data->filename = g_strdup(filename);
@@ -1269,7 +1269,7 @@ edit_with_gnome(GtkAction * action, BalsaSendmsg* bsmsg)
 
 #endif /* ENABLE_TOUCH_UI */
 
-static void 
+static void
 change_identity_dialog_cb(GtkAction * action, BalsaSendmsg* bsmsg)
 {
     libbalsa_identity_select_dialog(GTK_WINDOW(bsmsg->window),
@@ -1285,8 +1285,8 @@ change_identity_dialog_cb(GtkAction * action, BalsaSendmsg* bsmsg)
 /* NOTE: replace_offset and siglen are  utf-8 character offsets. */
 static void
 replace_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
-                           LibBalsaIdentity* old_ident, gint* replace_offset, 
-                           gint siglen, const gchar* new_sig) 
+                           LibBalsaIdentity* old_ident, gint* replace_offset,
+                           gint siglen, const gchar* new_sig)
 {
     gint newsiglen;
     GtkTextBuffer *buffer =
@@ -1294,7 +1294,7 @@ replace_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
     GtkTextIter ins, end;
     GtkTextMark *mark;
     gboolean insert_signature;
-    
+
     /* Save cursor */
     gtk_text_buffer_get_iter_at_mark(buffer, &ins,
                                      gtk_text_buffer_get_insert(buffer));
@@ -1307,7 +1307,7 @@ replace_identity_signature(BalsaSendmsg* bsmsg, LibBalsaIdentity* new_ident,
     gtk_text_buffer_delete(buffer, &ins, &end);
 
     newsiglen = strlen(new_sig);
-    
+
     switch (bsmsg->type) {
     case SEND_NORMAL:
     default:
@@ -1413,21 +1413,21 @@ sw_get_active(BalsaSendmsg * bsmsg, const gchar * action_name)
 
 /*
  * update_bsmsg_identity
- * 
+ *
  * Change the specified BalsaSendmsg current identity, and update the
- * corresponding fields. 
+ * corresponding fields.
  * */
 static void
 update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
 {
-    GtkTextBuffer *buffer = 
+    GtkTextBuffer *buffer =
         gtk_text_view_get_buffer(GTK_TEXT_VIEW(bsmsg->text));
     GtkTextIter start, end;
 
     gint replace_offset = 0;
     gint siglen;
     gint i = 0;
-    
+
     gboolean found_sig = FALSE;
     gchar* old_sig;
     gchar* new_sig;
@@ -1437,14 +1437,14 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
     gchar* tmpstr;
     const gchar* subject;
     gint replen, fwdlen;
-    
+
     LibBalsaIdentity* old_ident;
-    gboolean reply_type = (bsmsg->type == SEND_REPLY || 
+    gboolean reply_type = (bsmsg->type == SEND_REPLY ||
                            bsmsg->type == SEND_REPLY_ALL ||
                            bsmsg->type == SEND_REPLY_GROUP);
-    gboolean forward_type = (bsmsg->type == SEND_FORWARD_ATTACH || 
+    gboolean forward_type = (bsmsg->type == SEND_FORWARD_ATTACH ||
                              bsmsg->type == SEND_FORWARD_INLINE);
-    
+
     g_return_if_fail(ident != NULL);
 
 
@@ -1510,7 +1510,7 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
                                             bcc_list);
         g_object_unref(bcc_list);
     }
-    
+
     /* change the subject to use the reply/forward strings */
     subject = gtk_entry_get_text(GTK_ENTRY(bsmsg->subject[1]));
 
@@ -1570,7 +1570,7 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
     gtk_text_buffer_get_bounds(buffer, &start, &end);
     message_text = gtk_text_iter_get_text(&start, &end);
     if (!old_sig) {
-        replace_offset = bsmsg->ident->sig_prepend 
+        replace_offset = bsmsg->ident->sig_prepend
             ? 0 : g_utf8_strlen(message_text, -1);
         replace_identity_signature(bsmsg, ident, old_ident, &replace_offset,
                                    0, new_sig);
@@ -1641,7 +1641,7 @@ update_bsmsg_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity* ident)
         g_strfreev(message_split);
     }
     sw_set_active(bsmsg, "SendMPAlt", bsmsg->ident->send_mp_alternative);
-    
+
 #ifdef HAVE_GPGME
     bsmsg_update_gpg_ui_on_ident_change(bsmsg, ident);
 #endif
@@ -1696,7 +1696,7 @@ remove_attachment(GtkWidget * menu_item, BalsaAttachInfo *info)
 	return;
     }
     g_object_unref(test_info);
-    
+
     /* remove the attachment */
     gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
 }
@@ -1738,7 +1738,7 @@ change_attach_mode(GtkWidget * menu_item, BalsaAttachInfo *info)
 	return;
     }
     g_object_unref(test_info);
-    
+
     /* verify that the user *really* wants to attach as reference */
     if (info->mode != new_mode && new_mode == LIBBALSA_ATTACH_AS_EXTBODY) {
 	GtkWidget *extbody_dialog, *parent;
@@ -1769,7 +1769,7 @@ change_attach_mode(GtkWidget * menu_item, BalsaAttachInfo *info)
 	if (result != GTK_RESPONSE_YES)
 	    return;
     }
-    
+
     /* change the attachment mode */
     info->mode = new_mode;
     gtk_list_store_set(GTK_LIST_STORE(model), &iter, ATTACH_MODE_COLUMN,
@@ -1975,7 +1975,7 @@ get_fwd_mail_headers(const gchar *mailfile)
     g_object_unref (parser);
     g_object_unref(stream);
     close(fd);
-	
+
     /* get the headers from the gmime message */
     headers = g_new0(LibBalsaMessageHeaders, 1);
     libbalsa_message_headers_from_gmime(headers, message);
@@ -2001,7 +2001,7 @@ get_fwd_mail_headers(const gchar *mailfile)
    adds given filename (uri format) to the list.
 */
 gboolean
-add_attachment(BalsaSendmsg * bsmsg, const gchar *filename, 
+add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
                gboolean is_a_temp_file, const gchar *forced_mime_type)
 {
     LibbalsaVfs * file_uri;
@@ -2048,13 +2048,13 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 	!g_ascii_strncasecmp(forced_mime_type, "message/", 8) && is_a_temp_file;
     if (is_fwd_message)
 	content_type = g_strdup(forced_mime_type);
-    pixbuf = 
+    pixbuf =
 	libbalsa_icon_finder(forced_mime_type, file_uri, &content_type,
 			     GTK_ICON_SIZE_LARGE_TOOLBAR);
     if (!content_type)
 	/* Last ditch. */
 	content_type = g_strdup("application/octet-stream");
-	
+
     /* create a new attachment info block */
     attach_data = balsa_attach_info_new(bsmsg);
     attach_data->charset = NULL;
@@ -2072,7 +2072,7 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 	    content_type = g_strdup(forced_mime_type);
 	}
     }
-    
+
     if (is_fwd_message) {
 	attach_data->headers = get_fwd_mail_headers(filename);
 	if (!attach_data->headers)
@@ -2099,22 +2099,22 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 
     model = BALSA_MSG_ATTACH_MODEL(bsmsg);
     gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-    
+
     attach_data->file_uri = file_uri;
     attach_data->force_mime_type = g_strdup(forced_mime_type);
-    
+
     attach_data->delete_on_destroy = is_a_temp_file;
     can_inline = !is_a_temp_file &&
 	(!g_ascii_strncasecmp(content_type, "text/", 5) ||
 	 !g_ascii_strncasecmp(content_type, "image/", 6));
     attach_data->mode = LIBBALSA_ATTACH_AS_ATTACHMENT;
-    
+
     /* build the attachment's popup menu */
     attach_data->popup_menu = gtk_menu_new();
 
     /* only real text/... and image/... parts may be inlined */
     if (can_inline) {
-	menu_item = 
+	menu_item =
 	    gtk_menu_item_new_with_label(_(attach_modes
                                            [LIBBALSA_ATTACH_AS_INLINE]));
 	g_object_set_data(G_OBJECT(menu_item), "new-mode",
@@ -2128,7 +2128,7 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 
     /* all real files can be attachments */
     if (can_inline || !is_a_temp_file) {
-	menu_item = 
+	menu_item =
 	    gtk_menu_item_new_with_label(_(attach_modes
                                            [LIBBALSA_ATTACH_AS_ATTACHMENT]));
 	gtk_widget_set_sensitive(menu_item, FALSE);
@@ -2143,7 +2143,7 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 
     /* real files may be references (external body) */
     if (!is_a_temp_file) {
-	menu_item = 
+	menu_item =
 	    gtk_menu_item_new_with_label(_(attach_modes
                                            [LIBBALSA_ATTACH_AS_EXTBODY]));
 	g_object_set_data(G_OBJECT(menu_item), "new-mode",
@@ -2154,21 +2154,21 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
 	gtk_menu_shell_append(GTK_MENU_SHELL(attach_data->popup_menu),
 			      menu_item);
     }
-	
+
     /* an attachment can be removed */
-    menu_item = 
+    menu_item =
 	gtk_menu_item_new_with_label(_("Remove"));
     g_signal_connect(G_OBJECT (menu_item), "activate",
 		     G_CALLBACK(remove_attachment),
 		     (gpointer)attach_data);
     gtk_menu_shell_append(GTK_MENU_SHELL(attach_data->popup_menu),
 			  menu_item);
-    
+
     /* add the usual vfs menu so the user can inspect what (s)he actually
        attached... (only for non-message attachments) */
     if (!is_fwd_message)
 	libbalsa_vfs_fill_menu_by_content_type(GTK_MENU(attach_data->popup_menu),
-					       content_type, 
+					       content_type,
 					       G_CALLBACK(attachment_menu_vfs_cb),
 					       (gpointer)attach_data);
     gtk_widget_show_all(attach_data->popup_menu);
@@ -2188,7 +2188,7 @@ add_attachment(BalsaSendmsg * bsmsg, const gchar *filename,
     g_free(utf8name);
     g_free(content_type);
     g_free(content_desc);
-    
+
     show_attachment_widget(bsmsg);
 
     return TRUE;
@@ -2214,34 +2214,34 @@ add_urlref_attachment(BalsaSendmsg * bsmsg, gchar *url)
     pixbuf = gtk_widget_render_icon(GTK_WIDGET(balsa_app.main_window),
 				    GTK_STOCK_JUMP_TO,
 				    GTK_ICON_SIZE_MENU, NULL);
-	
+
     /* create a new attachment info block */
     attach_data = balsa_attach_info_new(bsmsg);
     attach_data->charset = NULL;
-    
+
     model = BALSA_MSG_ATTACH_MODEL(bsmsg);
     gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-    
+
     attach_data->uri_ref = g_strconcat("URL:", url, NULL);
     attach_data->force_mime_type = g_strdup("message/external-body");
     attach_data->delete_on_destroy = FALSE;
     attach_data->mode = LIBBALSA_ATTACH_AS_EXTBODY;
-    
+
     /* build the attachment's popup menu - may only be removed */
     attach_data->popup_menu = gtk_menu_new();
-    menu_item = 
+    menu_item =
 	gtk_menu_item_new_with_label(_("Remove"));
     g_signal_connect(G_OBJECT (menu_item), "activate",
 		     G_CALLBACK(remove_attachment),
 		     (gpointer)attach_data);
     gtk_menu_shell_append(GTK_MENU_SHELL(attach_data->popup_menu),
 			  menu_item);
-    
+
     /* add a separator and the usual vfs menu so the user can inspect what
        (s)he actually attached... (only for non-message attachments) */
     gtk_menu_shell_append(GTK_MENU_SHELL(attach_data->popup_menu),
 			  gtk_separator_menu_item_new());
-    menu_item = 
+    menu_item =
 	gtk_menu_item_new_with_label(_("Open..."));
     g_signal_connect(G_OBJECT (menu_item), "activate",
 		     G_CALLBACK(on_open_url_cb),
@@ -2262,7 +2262,7 @@ add_urlref_attachment(BalsaSendmsg * bsmsg, gchar *url)
     g_object_unref(attach_data);
     g_object_unref(pixbuf);
     g_free(url);
-    
+
     show_attachment_widget(bsmsg);
 
     return TRUE;
@@ -2297,7 +2297,7 @@ attach_dialog_response(GtkWidget * dialog, gint response,
     }
 
     g_slist_free(files);
-    
+
     g_free(balsa_app.attach_dir);
     balsa_app.attach_dir = gtk_file_chooser_get_current_folder_uri(fc);
 
@@ -2347,11 +2347,11 @@ attach_clicked(GtkAction * action, gpointer data)
 /* attach_message:
    returns TRUE on success, FALSE on failure.
 */
-static gboolean 
+static gboolean
 attach_message(BalsaSendmsg *bsmsg, LibBalsaMessage *message)
 {
     gchar *name, *tmp_file_name;
-	
+
     if (libbalsa_mktempdir(&tmp_file_name) == FALSE)
 	return FALSE;
     name = g_strdup_printf("%s/forwarded-message", tmp_file_name);
@@ -2371,15 +2371,15 @@ attach_message(BalsaSendmsg *bsmsg, LibBalsaMessage *message)
 static void
 insert_selected_messages(BalsaSendmsg *bsmsg, QuoteType type)
 {
-    GtkTextBuffer *buffer = 
+    GtkTextBuffer *buffer =
         gtk_text_view_get_buffer(GTK_TEXT_VIEW(bsmsg->text));
     GtkWidget *index =
 	balsa_window_find_current_index(balsa_app.main_window);
     GList *l;
-    
+
     if (index && (l = balsa_index_selected_list(BALSA_INDEX(index)))) {
 	GList *node;
-    
+
 	for (node = l; node; node = g_list_next(node)) {
 	    LibBalsaMessage *message = node->data;
             GString *body = quote_message_body(bsmsg, message, type);
@@ -2399,14 +2399,14 @@ include_message_cb(GtkAction * action, BalsaSendmsg * bsmsg)
 
 
 static void
-attach_message_cb(GtkAction * action, BalsaSendmsg *bsmsg) 
+attach_message_cb(GtkAction * action, BalsaSendmsg *bsmsg)
 {
     GtkWidget *index =
 	balsa_window_find_current_index(balsa_app.main_window);
-    
+
     if (index) {
 	GList *node, *l = balsa_index_selected_list(BALSA_INDEX(index));
-    
+
 	for (node = l; node; node = g_list_next(node)) {
 	    LibBalsaMessage *message = node->data;
 
@@ -2440,10 +2440,10 @@ uri2gslist(const char *uri_list)
   while (*uri_list) {
     char	*linebreak = strchr(uri_list, 13);
     int	length;
-    
+
     if (!linebreak || linebreak[1] != '\n')
         return list;
-    
+
     length = linebreak - uri_list;
 
     if (length && uri_list[0] != '#') {
@@ -2489,7 +2489,7 @@ rfc2396_uri(const gchar *instr)
 	}
 	s1++;
     }
-    
+
     /* success... */
     return uri;
 }
@@ -2512,7 +2512,7 @@ attachments_add(GtkWidget * widget,
 	LibBalsaMailbox *mailbox = index->mailbox_node->mailbox;
         GArray *selected = balsa_index_selected_msgnos_new(index);
 	guint i;
-        
+
         for (i = 0; i < selected->len; i++) {
 	    guint msgno = g_array_index(selected, guint, i);
 	    LibBalsaMessage *message =
@@ -2546,7 +2546,7 @@ attachments_add(GtkWidget * widget,
 	    add_urlref_attachment(bsmsg, url);
 	else
 	    drag_result = FALSE;
-    }	
+    }
     gtk_drag_finish(context, drag_result, FALSE, time);
 }
 
@@ -2568,14 +2568,14 @@ to_add(GtkWidget * widget,
 
 /*
  * static void create_email_or_string_entry()
- * 
+ *
  * Creates a gtk_label()/entry pair.
  *
  * Input: GtkWidget* table       - Table to attach to.
  *        const gchar* label     - Label string.
  *        int y_pos              - position in the table.
  *        arr                    - arr[1] is the entry widget.
- *      
+ *
  * Output: GtkWidget* arr[] - arr[0] will be the label widget.
  */
 static void
@@ -2607,13 +2607,13 @@ create_email_or_string_entry(GtkWidget * table, const gchar * label,
 
 /*
  * static void create_string_entry()
- * 
+ *
  * Creates a gtk_label()/gtk_entry() pair.
  *
  * Input: GtkWidget* table       - Table to attach to.
  *        const gchar* label     - Label string.
  *        int y_pos              - position in the table.
- *      
+ *
  * Output: GtkWidget* arr[] - arr[0] will be the label widget.
  *                          - arr[1] will be the entry widget.
  */
@@ -2763,7 +2763,7 @@ create_from_entry(GtkWidget * table, BalsaSendmsg * bsmsg)
     create_email_or_string_entry(table, _("F_rom:"), 0, bsmsg->from);
 }
 
-static gboolean 
+static gboolean
 attachment_button_press_cb(GtkWidget * widget, GdkEventButton * event,
 			   gpointer data)
 {
@@ -2814,7 +2814,7 @@ attachment_popup_cb(GtkWidget *widget, gpointer user_data)
 
     if (!gtk_tree_selection_get_selected(selection, &model, &iter))
 	return FALSE;
-    
+
     gtk_tree_model_get(model, &iter, ATTACH_INFO_COLUMN, &attach_info, -1);
     if (attach_info) {
 	if (attach_info->popup_menu)
@@ -2822,7 +2822,7 @@ attachment_popup_cb(GtkWidget *widget, gpointer user_data)
 		       NULL, 0, gtk_get_current_event_time());
 	g_object_unref(attach_info);
     }
-	
+
     return TRUE;
 }
 
@@ -2857,8 +2857,8 @@ render_attach_size(GtkTreeViewColumn *column, GtkCellRenderer *cell,
 }
 
 
-/* create_info_pane 
-   creates upper panel with the message headers: From, To, ... and 
+/* create_info_pane
+   creates upper panel with the message headers: From, To, ... and
    returns it.
 */
 static GtkWidget *
@@ -3087,11 +3087,6 @@ drag_data_quote(GtkWidget * widget,
     GArray *selected;
     guint i;
 
-#if !GTK_CHECK_VERSION(2,22,0)
-    if (context->action == GDK_ACTION_ASK)
-        context->action = GDK_ACTION_COPY;
-#endif
-
     switch(info) {
     case TARGET_MESSAGES:
 	index =
@@ -3099,7 +3094,7 @@ drag_data_quote(GtkWidget * widget,
 	mailbox = index->mailbox_node->mailbox;
         selected = balsa_index_selected_msgnos_new(index);
 	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
-       
+
         for (i = 0; i < selected->len; i++) {
 	    guint msgno = g_array_index(selected, guint, i);
 	    LibBalsaMessage *message;
@@ -3144,7 +3139,7 @@ drag_data_quote(GtkWidget * widget,
     gtk_drag_finish(context, TRUE, FALSE, time);
 }
 
-/* create_text_area 
+/* create_text_area
    Creates the text entry part of the compose window.
 */
 #if (HAVE_GTKSOURCEVIEW == 1)
@@ -3315,7 +3310,7 @@ continue_body(BalsaSendmsg * bsmsg, LibBalsaMessage * message)
 	    gchar *name, *body_type, *tmp_file_name;
             GError *err = NULL;
             gboolean res = FALSE;
-            
+
 	    if (body->filename) {
 		libbalsa_mktempdir(&tmp_file_name);
 		name = g_strdup_printf("%s/%s", tmp_file_name, body->filename);
@@ -3467,18 +3462,18 @@ scan_bodies(GtkTreeStore * bodies, GtkTreeIter * parent, LibBalsaMessageBody * b
 		    body->embhdrs) {
 		    gchar *from = balsa_message_sender_to_gchar(body->embhdrs->from, 0);
 		    gchar *subj = g_strdup(body->embhdrs->subject);
-		
+
 
 		    libbalsa_utf8_sanitize(&from, balsa_app.convert_unknown_8bit, NULL);
 		    libbalsa_utf8_sanitize(&subj, balsa_app.convert_unknown_8bit, NULL);
-		    description = 
+		    description =
 			g_strdup_printf(_("message from %s, subject \"%s\""),
 					from, subj);
 		    g_free(from);
 		    g_free(subj);
 		} else
 		    description = g_strdup(mime_type);
-	    
+
 		gtk_tree_store_append(bodies, &iter, parent);
 		gtk_tree_store_set(bodies, &iter,
 				   QUOTE_INCLUDE, FALSE,
@@ -3489,7 +3484,7 @@ scan_bodies(GtkTreeStore * bodies, GtkTreeIter * parent, LibBalsaMessageBody * b
 		g_free(description);
 		count += scan_bodies(bodies, &iter, body->parts, ignore_html, 0);
 	    }
-	    
+
 	default:
 	    break;
 	}
@@ -3505,7 +3500,7 @@ set_all_cells(GtkTreeModel * model, GtkTreeIter * iter, const gboolean value)
 {
     do {
 	GtkTreeIter children;
-	
+
 	if (gtk_tree_model_iter_children(model, &children, iter))
 	    set_all_cells(model, &children, value);
 	gtk_tree_store_set(GTK_TREE_STORE(model), iter, QUOTE_INCLUDE, value, -1);
@@ -3531,7 +3526,7 @@ calculate_expander_toggles(GtkTreeModel * model, GtkTreeIter * iter)
 	    on++;
 	count++;
     } while (gtk_tree_model_iter_next(model, iter));
-    
+
     return count == on;
 }
 
@@ -3543,7 +3538,7 @@ cell_toggled_cb(GtkCellRendererToggle *cell, gchar *path_str, GtkTreeView *treev
     GtkTreeIter iter;
     GtkTreeIter children;
     gboolean active;
-  
+
     g_return_if_fail (GTK_IS_TREE_VIEW (treeview));
     if (!(model = gtk_tree_view_get_model(treeview)))
 	return;
@@ -3552,7 +3547,7 @@ cell_toggled_cb(GtkCellRendererToggle *cell, gchar *path_str, GtkTreeView *treev
     if (!gtk_tree_model_get_iter(model, &iter, path))
 	return;
     gtk_tree_path_free(path);
-  
+
     gtk_tree_model_get(model, &iter,
 		       QUOTE_INCLUDE, &active,
 		       -1);
@@ -3595,7 +3590,7 @@ append_parts(GString * q_body, LibBalsaMessage *message, GtkTreeModel * model,
 		    this_part= process_mime_part(message, this_body,
                                                  reply_prefix_str, llen,
                                                  FALSE, flow);
-		    
+
 		    if (q_body->len > 0 && q_body->str[q_body->len - 1] != '\n')
 			g_string_append_c(q_body, '\n');
 		    if (!used_from_msg && from_msg) {
@@ -3691,7 +3686,7 @@ quote_parts_select_dlg(GtkTreeStore *tree_store, GtkWindow * parent)
     gtk_tree_view_expand_all(GTK_TREE_VIEW(tree_view));
     gtk_tree_model_get_iter_first(GTK_TREE_MODEL(tree_store), &iter);
     calculate_expander_toggles(GTK_TREE_MODEL(tree_store), &iter);
-    
+
     /* add, show & run */
     gtk_container_add(GTK_CONTAINER(scroll), tree_view);
     gtk_widget_show_all(hbox);
@@ -3776,7 +3771,7 @@ quote_body(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
 
     g_return_val_if_fail(headers, NULL);
 
-    if (headers->from && 
+    if (headers->from &&
 	(orig_address =
 	 libbalsa_address_get_name_from_list(headers->from))) {
         personStr = g_strdup(orig_address);
@@ -3793,7 +3788,7 @@ quote_body(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
     if (qtype == QUOTE_HEADERS) {
 	gchar *subject;
 
-	str = g_strdup_printf(_("------forwarded message from %s------\n"), 
+	str = g_strdup_printf(_("------forwarded message from %s------\n"),
 			      personStr);
 	body = g_string_new(str);
 	g_free(str);
@@ -3823,7 +3818,7 @@ quote_body(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
 	}
 
 	if (internet_address_list_length(headers->cc_list) > 0) {
-	    gchar *cc_list = 
+	    gchar *cc_list =
 		internet_address_list_to_string(headers->cc_list,
 			                        FALSE);
 	    g_string_append_printf(body, "%s %s\n", _("Cc:"), cc_list);
@@ -3842,7 +3837,7 @@ quote_body(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
                  ref_list = g_list_next(ref_list))
 		g_string_append_printf(body, " <%s>",
 				       (gchar *) ref_list->data);
-		
+
 	    g_string_append_c(body, '\n');
 	}
     } else {
@@ -3870,7 +3865,7 @@ quote_body(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
 	    body = g_string_new(str);
 	g_free(str);
     }
-    
+
     g_free(date);
     g_free(personStr);
 
@@ -3903,7 +3898,7 @@ fill_body_from_part(BalsaSendmsg * bsmsg, LibBalsaMessageHeaders *headers,
     if(body->len && body->str[body->len] != '\n')
         g_string_append_c(body, '\n');
     gtk_text_buffer_insert_at_cursor(buffer, body->str, body->len);
-    
+
     if(qtype == QUOTE_HEADERS)
         gtk_text_buffer_get_end_iter(buffer, &start);
     else
@@ -3940,7 +3935,7 @@ static void
 insert_signature_cb(GtkAction * action, BalsaSendmsg *bsmsg)
 {
     gchar *signature;
-    
+
     if(!bsmsg->ident->signature_path || !bsmsg->ident->signature_path[0])
         return;
     signature = libbalsa_identity_get_signature(bsmsg->ident,
@@ -3950,11 +3945,11 @@ insert_signature_cb(GtkAction * action, BalsaSendmsg *bsmsg)
             gtk_text_view_get_buffer(GTK_TEXT_VIEW(bsmsg->text));
 #if !HAVE_GTKSOURCEVIEW
         sw_buffer_save(bsmsg);
-#endif                          /* HAVE_GTKSOURCEVIEW */	
+#endif                          /* HAVE_GTKSOURCEVIEW */
         sw_buffer_signals_block(bsmsg, buffer);
         gtk_text_buffer_insert_at_cursor(buffer, signature, -1);
         sw_buffer_signals_unblock(bsmsg, buffer);
-	
+
 	g_free(signature);
     } else
         balsa_information_parented(GTK_WINDOW(bsmsg->window),
@@ -4003,16 +3998,16 @@ generate_forwarded_subject(const char *orig_subject,
         }
         while( *tmp && isspace((int)*tmp) ) tmp++;
         if (headers && headers->from)
-            newsubject = 
+            newsubject =
                 g_strdup_printf("%s %s [%s]",
-                                ident->forward_string, 
+                                ident->forward_string,
                                 tmp,
                                 libbalsa_address_get_mailbox_from_list
                                 (headers->from));
         else {
-            newsubject = 
-                g_strdup_printf("%s %s", 
-                                ident->forward_string, 
+            newsubject =
+                g_strdup_printf("%s %s",
+                                ident->forward_string,
                                 tmp);
             g_strchomp(newsubject);
         }
@@ -4213,9 +4208,9 @@ setup_headers_from_message(BalsaSendmsg* bsmsg, LibBalsaMessage *message)
 }
 
 
-/* 
+/*
  * set_identity_from_mailbox
- * 
+ *
  * Attempt to determine the default identity from the mailbox containing
  * the message.
  **/
@@ -4244,9 +4239,9 @@ set_identity_from_mailbox(BalsaSendmsg* bsmsg, LibBalsaMessage * message)
     return FALSE; /* use default */
 }
 
-/* 
+/*
  * guess_identity
- * 
+ *
  * Attempt to determine if a message should be associated with a
  * particular identity, other than the default.  The to_list of the
  * original message needs to be set in order for it to work.
@@ -4310,7 +4305,7 @@ guess_identity(BalsaSendmsg* bsmsg, LibBalsaMessage * message)
 }
 
 static void
-setup_headers_from_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity *ident)    
+setup_headers_from_identity(BalsaSendmsg* bsmsg, LibBalsaIdentity *ident)
 {
     gtk_combo_box_set_active(GTK_COMBO_BOX(bsmsg->from[1]),
                              g_list_index(balsa_app.identities, ident));
@@ -4360,7 +4355,7 @@ create_lang_menu(GtkWidget * parent, BalsaSendmsg * bsmsg)
 
     /* find the preferred charset... */
 #if HAVE_GTKSPELL
-    selected_pos = 
+    selected_pos =
 	find_locale_index_by_locale(balsa_app.spell_check_lang
 				    ? balsa_app.spell_check_lang
 				    : setlocale(LC_CTYPE, NULL));
@@ -4425,7 +4420,7 @@ create_lang_menu(GtkWidget * parent, BalsaSendmsg * bsmsg)
     gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent), langs);
     gtk_widget_show(parent);
 }
-        
+
 /* Standard buttons; "" means a separator. */
 static const gchar* compose_toolbar[] = {
 #if defined(ENABLE_TOUCH_UI)
@@ -4502,14 +4497,14 @@ static void
 sw_cc_add_list(InternetAddressList **new_cc, InternetAddressList * list)
 {
     int i;
-    
+
     if (!list)
         return;
 
     for (i = 0; i < internet_address_list_length(list); i++) {
         InternetAddress *ia = internet_address_list_get_address (list, i);
 	GList *ident;
-	
+
 	/* do not insert any of my identities into the cc: list */
 	for (ident = balsa_app.identities; ident; ident = ident->next)
 	    if (libbalsa_ia_rfc2821_equal
@@ -4554,7 +4549,7 @@ sendmsg_window_new()
     /*
      * restore the SendMsg window size
      */
-    gtk_window_set_default_size(GTK_WINDOW(window), 
+    gtk_window_set_default_size(GTK_WINDOW(window),
                                 balsa_app.sw_width,
                                 balsa_app.sw_height);
     if (balsa_app.sw_maximized)
@@ -4624,7 +4619,7 @@ sendmsg_window_new()
 
     sw_set_sensitive(bsmsg, "SelectIdentity",
                      balsa_app.identities->next != NULL);
-    bsmsg->identities_changed_id = 
+    bsmsg->identities_changed_id =
         g_signal_connect_swapped(balsa_app.main_window, "identities-changed",
                                  (GCallback)bsmsg_identities_changed_cb,
                                  bsmsg);
@@ -4672,11 +4667,11 @@ sendmsg_window_new()
 #endif                          /* HAVE_GTKSOURCEVIEW */
 
     bsmsg->update_config = TRUE;
- 
-    bsmsg->delete_sig_id = 
+
+    bsmsg->delete_sig_id =
 	g_signal_connect(G_OBJECT(balsa_app.main_window), "delete-event",
 			 G_CALLBACK(delete_event_cb), bsmsg);
-    
+
     bsmsg->current_language_menu =
 #if !defined(ENABLE_TOUCH_UI)
         gtk_ui_manager_get_widget(ui_manager, "/MainMenu/LanguageMenu");
@@ -4829,7 +4824,7 @@ set_references_reply(BalsaSendmsg *bsmsg, GList *references,
                      const gchar *in_reply_to, const gchar *message_id)
 {
     GList *refs = NULL, *list;
- 
+
     for (list = references; list; list = list->next)
         refs = g_list_prepend(refs, g_strdup(list->data));
 
@@ -4878,7 +4873,7 @@ sendmsg_window_reply(LibBalsaMailbox * mailbox, guint msgno,
 
     g_assert(message);
     switch(reply_type) {
-    case SEND_REPLY: 
+    case SEND_REPLY:
     case SEND_REPLY_ALL:
     case SEND_REPLY_GROUP:
         bsmsg->type = reply_type;       break;
@@ -4896,7 +4891,7 @@ sendmsg_window_reply(LibBalsaMailbox * mailbox, guint msgno,
     if (reply_type == SEND_REPLY_ALL)
         set_cc_from_all_recipients(bsmsg, message->headers);
     set_references_reply(bsmsg, message->references,
-                         message->in_reply_to 
+                         message->in_reply_to
                          ? message->in_reply_to->data : NULL,
                          message->message_id);
     if(balsa_app.autoquote)
@@ -4920,7 +4915,7 @@ sendmsg_window_reply_embedded(LibBalsaMessageBody *part,
     g_return_val_if_fail(part->embhdrs, bsmsg);
 
     switch(reply_type) {
-    case SEND_REPLY: 
+    case SEND_REPLY:
     case SEND_REPLY_ALL:
     case SEND_REPLY_GROUP:
         bsmsg->type = reply_type;       break;
@@ -4932,11 +4927,11 @@ sendmsg_window_reply_embedded(LibBalsaMessageBody *part,
     set_to(bsmsg, headers);
 
     if(part->embhdrs) {
-        const gchar *message_id = 
+        const gchar *message_id =
             libbalsa_message_header_get_one(part->embhdrs, "Message-Id");
         const gchar *in_reply_to =
             libbalsa_message_header_get_one(part->embhdrs, "In-Reply-To");
-        GList *references = 
+        GList *references =
             libbalsa_message_header_get_all(part->embhdrs, "References");
         if (message_id)
             set_in_reply_to(bsmsg, message_id, headers);
@@ -4967,7 +4962,7 @@ sendmsg_window_forward(LibBalsaMailbox *mailbox, guint msgno,
         libbalsa_mailbox_get_message(mailbox, msgno);
     BalsaSendmsg *bsmsg = sendmsg_window_new();
     g_assert(message);
-    
+
     bsmsg->type = attach ? SEND_FORWARD_ATTACH : SEND_FORWARD_INLINE;
     if (attach) {
 	if(!attach_message(bsmsg, message))
@@ -5090,7 +5085,7 @@ decode_and_strdup(const gchar*str, int delim, gchar** newstr)
     gchar num[3];
     GString *s = g_string_new(NULL);
     /* eos points to the character after the last to parse */
-    gchar *eos = strchr(str, delim); 
+    gchar *eos = strchr(str, delim);
 
     if(!eos) eos = (gchar*)str + strlen(str);
     while(str<eos) {
@@ -5115,12 +5110,12 @@ decode_and_strdup(const gchar*str, int delim, gchar** newstr)
     g_string_free(s,FALSE);
     return eos;
 }
-    
+
 /* process_url:
    extracts all characters until NUL or question mark; parse later fields
    of format 'key'='value' with ampersands as separators.
-*/ 
-void 
+*/
+void
 sendmsg_window_process_url(const char *url, field_setter func, void *data)
 {
     gchar * ptr, *to, *key, *val;
@@ -5235,7 +5230,7 @@ sendmsg_window_set_field(BalsaSendmsg * bsmsg, const gchar * key,
         gtk_widget_show_all(bsmsg->subject[1]);
         return;
     }
-    
+
     if (g_ascii_strcasecmp(key, "to") == 0)
         type = "To:";
     else if(g_ascii_strcasecmp(key, "cc") == 0)
@@ -5484,7 +5479,7 @@ attachment2message(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
 
 /* bsmsg2message:
    creates Message struct based on given BalsaMessage
-   stripping EOL chars is necessary - the GtkEntry fields can in principle 
+   stripping EOL chars is necessary - the GtkEntry fields can in principle
    contain them. Such characters might screw up message formatting
    (consider moving this code to mutt part).
 */
@@ -5549,7 +5544,7 @@ bsmsg2message(BalsaSendmsg * bsmsg)
 
     message->headers->cc_list =
         libbalsa_address_view_get_list(bsmsg->recipient_view, "Cc:");
-    
+
     message->headers->bcc_list =
         libbalsa_address_view_get_list(bsmsg->recipient_view, "Bcc:");
 
@@ -5599,7 +5594,7 @@ bsmsg2message(BalsaSendmsg * bsmsg)
 #endif                          /* HAVE_GTKSOURCEVIEW */
     body->buffer = gtk_text_iter_get_text(&start, &end);
     if (bsmsg->send_mp_alt)
-        body->html_buffer = 
+        body->html_buffer =
             libbalsa_text_to_html(message->subj, body->buffer,
                                   bsmsg->spell_check_lang);
     if (bsmsg->flow)
@@ -5630,7 +5625,7 @@ bsmsg2message(BalsaSendmsg * bsmsg)
     message->headers->date = time(NULL);
 #ifdef HAVE_GPGME
     if (balsa_app.has_openpgp || balsa_app.has_smime)
-        message->gpg_mode = 
+        message->gpg_mode =
             (bsmsg->gpg_mode & LIBBALSA_PROTECT_MODE) != 0 ? bsmsg->gpg_mode : 0;
     else
         message->gpg_mode = 0;
@@ -5675,16 +5670,13 @@ subject_not_empty(BalsaSendmsg * bsmsg)
 	if (*p != '\0')
 	    return TRUE;
     }
-	    
+
     /* build the dialog */
     no_subj_dialog = gtk_dialog_new ();
     gtk_container_set_border_width (GTK_CONTAINER (no_subj_dialog), 6);
     gtk_window_set_modal (GTK_WINDOW (no_subj_dialog), TRUE);
     gtk_window_set_resizable (GTK_WINDOW (no_subj_dialog), FALSE);
     gtk_window_set_type_hint (GTK_WINDOW (no_subj_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
-#if !GTK_CHECK_VERSION(2,22,0)
-    gtk_dialog_set_has_separator (GTK_DIALOG (no_subj_dialog), FALSE);
-#endif
 
     dialog_vbox = gtk_dialog_get_content_area(GTK_DIALOG(no_subj_dialog));
 
@@ -5726,19 +5718,11 @@ subject_not_empty(BalsaSendmsg * bsmsg)
 
     cnclbutton = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
     gtk_dialog_add_action_widget (GTK_DIALOG (no_subj_dialog), cnclbutton, GTK_RESPONSE_CANCEL);
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_set_can_default(cnclbutton, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    GTK_WIDGET_SET_FLAGS (cnclbutton, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     okbutton = gtk_button_new ();
     gtk_dialog_add_action_widget (GTK_DIALOG (no_subj_dialog), okbutton, GTK_RESPONSE_OK);
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_set_can_default(okbutton, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    GTK_WIDGET_SET_FLAGS (okbutton, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
     gtk_dialog_set_default_response(GTK_DIALOG (no_subj_dialog),
                                     GTK_RESPONSE_OK);
 
@@ -5753,13 +5737,8 @@ subject_not_empty(BalsaSendmsg * bsmsg)
 
     label = gtk_label_new_with_mnemonic (_("_Send"));
     gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_set_can_focus(label, TRUE);
     gtk_widget_set_can_default(label, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    GTK_WIDGET_SET_FLAGS (label, GTK_CAN_FOCUS);
-    GTK_WIDGET_SET_FLAGS (label, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     gtk_widget_grab_focus (subj_entry);
     gtk_editable_select_region(GTK_EDITABLE(subj_entry), 0, -1);
@@ -5845,14 +5824,10 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
 
 	dialog_action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog));
 	gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area), GTK_BUTTONBOX_END);
- 
+
 	button = gtk_button_new();
 	gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_YES);
-#if GTK_CHECK_VERSION(2, 18, 0)
         gtk_widget_set_can_default(button, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 	gtk_widget_grab_focus(button);
 	alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
 	gtk_container_add(GTK_CONTAINER(button), alignment);
@@ -5867,11 +5842,7 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
 
 	button = gtk_button_new();
 	gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_NO);
-#if GTK_CHECK_VERSION(2, 18, 0)
         gtk_widget_set_can_default(button, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 	alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
 	gtk_container_add(GTK_CONTAINER(button), alignment);
 
@@ -5886,11 +5857,7 @@ check_suggest_encryption(BalsaSendmsg * bsmsg)
 	button = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
 	gtk_widget_show(button);
 	gtk_dialog_add_action_widget(GTK_DIALOG(dialog), button, GTK_RESPONSE_CANCEL);
-#if GTK_CHECK_VERSION(2, 18, 0)
         gtk_widget_set_can_default(button, TRUE);
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-	GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
 	choice = gtk_dialog_run(GTK_DIALOG(dialog));
 	gtk_widget_destroy(dialog);
@@ -5935,7 +5902,7 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
             gtk_tree_model_get_iter_first(BALSA_MSG_ATTACH_MODEL(bsmsg), &iter);
         warn_html_sign = (bsmsg->gpg_mode & LIBBALSA_PROTECT_MODE) == LIBBALSA_PROTECT_SIGN &&
             bsmsg->send_mp_alt;
-            
+
         if (warn_mp || warn_html_sign) {
             /* we are going to RFC2440 sign/encrypt a multipart, or to
              * RFC2440 sign a multipart/alternative... */
@@ -5954,8 +5921,8 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
                     g_string_append(message,
                         _("The message contains attachments, which cannot be "
                           "signed or encrypted.\n"));
-            message = 
-                g_string_append(message, 
+            message =
+                g_string_append(message,
                     _("You should select MIME mode if the complete "
                       "message shall be protected. Do you really want to proceed?"));
             dialog = gtk_message_dialog_new
@@ -5990,7 +5957,7 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
 	result = libbalsa_message_queue(message, balsa_app.outbox, fcc,
 					bsmsg->ident->smtp_server,
 					bsmsg->flow, &error);
-    else 
+    else
         result = libbalsa_message_send(message, balsa_app.outbox, fcc,
                                        balsa_find_sentbox_by_url,
 				       bsmsg->ident->smtp_server,
@@ -5999,10 +5966,10 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
     if(queue_only)
 	result = libbalsa_message_queue(message, balsa_app.outbox, fcc,
 					bsmsg->flow, &error);
-    else 
+    else
         result = libbalsa_message_send(message, balsa_app.outbox, fcc,
                                        balsa_find_sentbox_by_url,
-				       bsmsg->flow, balsa_app.debug, &error); 
+				       bsmsg->flow, balsa_app.debug, &error);
 #endif
     if (result == LIBBALSA_MESSAGE_CREATE_OK) {
 	if (bsmsg->parent_message && bsmsg->parent_message->mailbox
@@ -6017,7 +5984,7 @@ send_message_handler(BalsaSendmsg * bsmsg, gboolean queue_only)
         const char *msg;
         switch(result) {
         default:
-        case LIBBALSA_MESSAGE_CREATE_ERROR: 
+        case LIBBALSA_MESSAGE_CREATE_ERROR:
             msg = _("Message could not be created"); break;
         case LIBBALSA_MESSAGE_QUEUE_ERROR:
             msg = _("Message could not be queued in outbox"); break;
@@ -6119,7 +6086,7 @@ message_postpone(BalsaSendmsg * bsmsg)
                                              (gchar **) headers->pdata,
                                              bsmsg->flow, &error);
     else
-	successp = libbalsa_message_postpone(message, balsa_app.draftbox, 
+	successp = libbalsa_message_postpone(message, balsa_app.draftbox,
                                              NULL,
                                              (gchar **) headers->pdata,
                                              bsmsg->flow, &error);
@@ -6190,7 +6157,7 @@ print_message_cb(GtkAction * action, BalsaSendmsg * bsmsg)
 /*
  * Signal handlers for updating the cursor when text is inserted.
  * The "insert-text" signal is emitted before the insertion, so we
- * create a mark at the insertion point. 
+ * create a mark at the insertion point.
  * The "changed" signal is emitted after the insertion, and we move the
  * cursor to the end of the inserted text.
  * This achieves nothing if the text was typed, as the cursor is moved
@@ -6323,7 +6290,7 @@ sw_spell_detach(BalsaSendmsg * bsmsg)
     spell = gtkspell_get_from_text_view(GTK_TEXT_VIEW(bsmsg->text));
     if (spell)
         gtkspell_detach(spell);
-    
+
     return spell != NULL;
 }
 #endif                          /* HAVE_GTKSPELL */
@@ -6720,7 +6687,7 @@ spell_check_menu_cb(GtkToggleAction * action, BalsaSendmsg * bsmsg)
 
 #else                           /* HAVE_GTKSPELL */
 /* spell_check_cb
- * 
+ *
  * Start the spell check
  * */
 static void
@@ -6765,7 +6732,7 @@ spell_check_cb(GtkAction * action, BalsaSendmsg * bsmsg)
 }
 
 static void
-sw_spell_check_response(BalsaSpellCheck * spell_check, gint response, 
+sw_spell_check_response(BalsaSpellCheck * spell_check, gint response,
                         BalsaSendmsg * bsmsg)
 {
     gtk_widget_destroy(GTK_WIDGET(spell_check));
@@ -6930,7 +6897,7 @@ set_list_post_rfc2369(BalsaSendmsg * bsmsg, const gchar * url)
 }
 
 /* rfc2822_skip_comments:
- * skip CFWS (comments and folding white space) 
+ * skip CFWS (comments and folding white space)
  *
  * CRLFs have already been stripped, so we need to look only for
  * comments and white space
@@ -7077,7 +7044,7 @@ bsmsg_setup_gpg_ui_by_mode(BalsaSendmsg *bsmsg, gint mode)
 #ifdef HAVE_SMIME
     if (mode & LIBBALSA_PROTECT_SMIMEV3)
         sw_set_active(bsmsg, "SMimeMode", TRUE);
-    else 
+    else
 #endif
     if (mode & LIBBALSA_PROTECT_OPENPGP)
         sw_set_active(bsmsg, "OldOpenPgpMode", TRUE);
@@ -7110,7 +7077,7 @@ bsmsg_check_format_compatibility(GtkWindow *parent, const gchar *filename)
     for(i=0; i<ELEMENTS(compatibility_table); i++) {
         unsigned le_len = strlen(compatibility_table[i].linux_extension);
         int offset = fn_len - le_len;
-        
+
         if(offset>0 &&
            strcmp(filename+offset, compatibility_table[i].linux_extension)==0)
             break; /* a match has been found */
@@ -7156,7 +7123,7 @@ bsmsg_check_format_compatibility(GtkWindow *parent, const gchar *filename)
     gtk_widget_show(checkbox);
     gtk_widget_show(label);
     response = gtk_dialog_run(dialog);
-    balsa_app.do_file_format_check = 
+    balsa_app.do_file_format_check =
         !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox));
     gtk_widget_destroy(GTK_WIDGET(dialog));
     return response == GTK_RESPONSE_OK;
diff --git a/src/toolbar-factory.c b/src/toolbar-factory.c
index adbd6ee..75b79f0 100644
--- a/src/toolbar-factory.c
+++ b/src/toolbar-factory.c
@@ -5,17 +5,17 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option) 
+ * the Free Software Foundation; either version 2, or (at your option)
  * any later version.
- *  
+ *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *  
+ *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
 
@@ -122,7 +122,7 @@ balsa_toolbar_model_get_type()
                                    "BalsaToolbarModel",
                                    &balsa_toolbar_model_info, 0);
     }
-    
+
     return balsa_toolbar_model_type;
 }
 
@@ -201,7 +201,7 @@ void
 balsa_toolbar_remove_all(GtkWidget * widget)
 {
     GList *child, *children;
-    
+
     children = gtk_container_get_children(GTK_CONTAINER(widget));
     for (child = children; child; child = child->next)
         gtk_widget_destroy(child->data);
@@ -664,9 +664,7 @@ tm_popup_position_func(GtkMenu * menu, gint * x, gint * y,
     GtkRequisition req;
     gint monitor_num;
     GdkRectangle monitor;
-#if GTK_CHECK_VERSION(2, 18, 0)
     GtkAllocation allocation;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     g_return_if_fail(gtk_widget_get_window(toolbar));
 
@@ -674,14 +672,9 @@ tm_popup_position_func(GtkMenu * menu, gint * x, gint * y,
 
     gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req);
 
-#if GTK_CHECK_VERSION(2, 18, 0)
     gtk_widget_get_allocation(toolbar, &allocation);
     *x += (allocation.width - req.width) / 2;
     *y += allocation.height;
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    *x += (toolbar->allocation.width - req.width) / 2;
-    *y += toolbar->allocation.height;
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
 
     monitor_num = gdk_screen_get_monitor_at_point(screen, *x, *y);
     gtk_menu_set_monitor(menu, monitor_num);
@@ -769,11 +762,7 @@ tm_do_popup_menu(GtkWidget * toolbar, GdkEventButton * event,
         }
     }
 
-#if GTK_CHECK_VERSION(2, 18, 0)
     if (gtk_widget_is_sensitive(toolbar)) {
-#else                           /* GTK_CHECK_VERSION(2, 18, 0) */
-    if (GTK_WIDGET_IS_SENSITIVE(toolbar)) {
-#endif                          /* GTK_CHECK_VERSION(2, 18, 0) */
         /* This is a real toolbar, not the template from the
          * toolbar-prefs dialog. */
         GtkWidget *item;



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