* tiny optimization for the header view: avoid one needless
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 31 Aug 2007 15:08:56 +0000 (15:08 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Fri, 31 Aug 2007 15:08:56 +0000 (15:08 +0000)
  copy of the subject

pmo-trunk-r3174

src/widgets/modest-header-view-render.c

index 3a0b66c..c7fc54b 100644 (file)
@@ -248,7 +248,7 @@ _modest_header_view_date_cell_data  (GtkTreeViewColumn *column,  GtkCellRenderer
                            TNY_GTK_HEADER_LIST_MODEL_FLAGS_COLUMN, &flags,
                            date_col, &date,
                            -1);
-
+       
        display_date = modest_text_utils_get_display_date (date);
        g_object_set (G_OBJECT(renderer), "text", display_date, NULL);  
 
@@ -335,9 +335,9 @@ _modest_header_view_compact_header_cell_data  (GtkTreeViewColumn *column,  GtkCe
                                    TNY_GTK_HEADER_LIST_MODEL_SUBJECT_COLUMN, &subject,
                                    TNY_GTK_HEADER_LIST_MODEL_DATE_SENT_TIME_T_COLUMN, &date,
                                    TNY_GTK_HEADER_LIST_MODEL_INSTANCE_COLUMN, &msg_header,
-                                   -1);
-
+                                   -1);        
        /* flags */
+       /* FIXME: we might gain something by doing all the g_object_set's at once */
        prior_flags = flags & TNY_HEADER_FLAG_PRIORITY;
        if (flags & TNY_HEADER_FLAG_ATTACHMENTS)
                g_object_set (G_OBJECT (attach_cell), "pixbuf",
@@ -354,20 +354,18 @@ _modest_header_view_compact_header_cell_data  (GtkTreeViewColumn *column,  GtkCe
        else
                g_object_set (G_OBJECT (priority_cell), "pixbuf",
                              NULL, NULL);
-                             
-       header = g_markup_printf_escaped ("%s", (subject && strlen (subject)) ? subject : _("mail_va_no_subject"));
+
+
+       g_object_set (G_OBJECT (subject_cell), "markup",
+                     (subject && strlen (subject)) ? subject : _("mail_va_no_subject"),
+                     NULL);
        g_free (subject);
-       subject = NULL;
-       g_object_set (G_OBJECT (subject_cell), "markup", header, NULL);
-       g_free (header);
-       header = NULL;
        set_common_flags (subject_cell, flags);
 
-
-       /* fixme: we hardcode the color to #666666; instead we should use SecondaryTextColour from the
+       /* FIXME: we hardcode the color to #666666; instead we should use SecondaryTextColour from the
         * theme (gtkrc file) */
-       
-       header = g_markup_printf_escaped ("<span size='small' foreground='#666666'>%s</span>", modest_text_utils_get_display_address (address));
+       header = g_markup_printf_escaped ("<span size='small' foreground='#666666'>%s</span>",
+                                         modest_text_utils_get_display_address (address));
        g_free (address);
        address = NULL;
        g_object_set (G_OBJECT (recipient_cell),