* src/maemo/modest-address-book.c:
authorJose Dapena Paz <jdapena@igalia.com>
Wed, 9 May 2007 09:30:06 +0000 (09:30 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 9 May 2007 09:30:06 +0000 (09:30 +0000)
        * Removed debug messages.
        * Removed a wrong g_object_unref, which was leading to a crash of
          the addressbook button in recipient editor when we opened the
          dialog several times (fixes NB#56212).
* src/maemo/modest-msg-edit-window.c:
        * Attach signal handlers for size change and font change after
          creating all the menu items. Removes some warnings in valgrind.
        * Now we get the offset correctly in the code to remove images in
          body.
* src/widgets/modest-recpt-editor.c:
        * Removed debug messages.

pmo-trunk-r1796

src/maemo/modest-address-book.c
src/maemo/modest-msg-edit-window.c
src/widgets/modest-recpt-editor.c

index 5848840..abf876d 100644 (file)
@@ -204,11 +204,6 @@ modest_address_book_select_addresses (ModestRecptEditor *recpt_editor)
                g_list_free (contacts_list);
        }
 
-       if (contact_view) {
-               g_object_unref (contact_view);
-               contact_view = NULL;
-       }
-
        if (contact_model) {
                g_object_unref (contact_model);
                contact_model = NULL;
@@ -574,7 +569,6 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor)
 
        recipients = modest_recpt_editor_get_recipients (recpt_editor);
        last_length = g_utf8_strlen (recipients, -1);
-       /* g_message ("LENGTH %d", last_length); */
        modest_text_utils_get_addresses_indexes (recipients, &start_indexes, &end_indexes);
 
        if (start_indexes == NULL) {
@@ -603,11 +597,6 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor)
                gtk_text_buffer_get_iter_at_offset (buffer, &end_iter, end_pos);
                gtk_text_buffer_select_range (buffer, &start_iter, &end_iter);
 
-/*
-               g_message ("RANGE %d - %d", start_pos, end_pos);
-
-               g_message ("ADDRESS %s", address);
-*/
                if (!modest_text_utils_validate_recipient (address)) {
                        if (strstr (address, "@") == NULL) {
                                /* here goes searching in addressbook */
@@ -631,7 +620,6 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor)
                                        new_length = g_utf8_strlen (recipients, -1);
                                        offset_delta = offset_delta + new_length - last_length;
                                        last_length = new_length;
-                                       /* g_message ("LENGTH %d", last_length); */
                                }
                        } else {
                                /* this address is not valid, select it and return control to user showing banner */
index daa10b9..3ba9106 100644 (file)
@@ -660,6 +660,7 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window)
        GtkWidget *sizes_menu;
        GtkWidget *fonts_menu;
        GSList *radio_group = NULL;
+       GSList *node = NULL;
        gchar *markup;
 
        /* Toolbar */
@@ -710,9 +711,14 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window)
 
                priv->size_items_group = g_slist_prepend (priv->size_items_group, size_menu_item);
                        
-               g_signal_connect (G_OBJECT (size_menu_item), "toggled", G_CALLBACK (modest_msg_edit_window_size_change),
+       }
+
+       for (node = radio_group; node != NULL; node = g_slist_next (node)) {
+               GtkWidget *item = (GtkWidget *) node->data;
+               g_signal_connect (G_OBJECT (item), "toggled", G_CALLBACK (modest_msg_edit_window_size_change),
                                  window);
        }
+
        priv->size_items_group = g_slist_reverse (priv->size_items_group);
        gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (tool_item), sizes_menu);
        g_signal_connect (G_OBJECT (tool_item), "clicked", G_CALLBACK (menu_tool_button_clicked_popup), NULL);
@@ -750,7 +756,10 @@ modest_msg_edit_window_setup_toolbar (ModestMsgEditWindow *window)
 
                priv->font_items_group = g_slist_prepend (priv->font_items_group, font_menu_item);
                        
-               g_signal_connect (G_OBJECT (font_menu_item), "toggled", G_CALLBACK (modest_msg_edit_window_font_change),
+       }
+       for (node = radio_group; node != NULL; node = g_slist_next (node)) {
+               GtkWidget *item = (GtkWidget *) node->data;
+               g_signal_connect (G_OBJECT (item), "toggled", G_CALLBACK (modest_msg_edit_window_font_change),
                                  window);
        }
        priv->font_items_group = g_slist_reverse (priv->font_items_group);
@@ -2095,7 +2104,7 @@ text_buffer_delete_images_by_id (GtkTextBuffer *buffer, const gchar * image_id)
                                gchar *cur_image_id = g_object_get_data (G_OBJECT (tag), "image-index");
                                if ((cur_image_id != NULL) && (strcmp (image_id, cur_image_id)==0)) {
                                        gint offset;
-                                       gtk_text_iter_get_offset (&match_start);
+                                       offset = gtk_text_iter_get_offset (&match_start);
                                        gtk_text_buffer_delete (buffer, &match_start, &match_end);
                                        gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
                                }
index 27c5b6a..375cefd 100644 (file)
@@ -406,7 +406,6 @@ modest_recpt_editor_on_button_release_event (GtkWidget *widget,
        buffer = modest_recpt_editor_get_buffer (recpt_editor);
        mark = gtk_text_buffer_get_insert (buffer);
        gtk_text_buffer_get_iter_at_mark (buffer, &location, mark);
-       /* g_message ("RELEASE OFFSET %d", gtk_text_iter_get_offset (&location)); */
 
        gtk_text_buffer_get_selection_bounds (buffer, &start, &end);
 
@@ -614,7 +613,6 @@ modest_recpt_editor_on_key_press_event (GtkTextView *text_view,
                gboolean cursor_ready = FALSE;
                while (!cursor_ready) {
                        if (iter_previous_char (&location) == '\n') {
-                               /* g_message ("INTRO FOUND"); */
                                gtk_text_iter_backward_char (&location);
                        } else {
                                cursor_ready = TRUE;
@@ -717,7 +715,6 @@ modest_recpt_editor_on_key_press_event (GtkTextView *text_view,
                if (tag != NULL) {
                        GtkTextIter iter_in_tag;
                        iter_in_tag = location;
-                       /* g_message ("DELETE PREV SELECTION"); */
                        gtk_text_iter_backward_char (&iter_in_tag);
                        select_tag_of_iter (&iter_in_tag, tag);
                        gtk_text_buffer_delete_selection (buffer, TRUE, TRUE);