* use the 'display address' in the header view, ie., for
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 9 May 2007 21:58:49 +0000 (21:58 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Wed, 9 May 2007 21:58:49 +0000 (21:58 +0000)
"Donald Duck <donald@duck.org>" just display
   "Donald Duck"

pmo-trunk-r1812

src/modest-text-utils.c
src/modest-text-utils.h
src/widgets/modest-header-view-render.c

index 6888072..df6e03a 100644 (file)
@@ -876,9 +876,9 @@ modest_text_utils_get_display_address (gchar *address)
        
        if (!address)
                return NULL;
        
        if (!address)
                return NULL;
-
+       
        g_return_val_if_fail (g_utf8_validate (address, -1, NULL), NULL);
        g_return_val_if_fail (g_utf8_validate (address, -1, NULL), NULL);
-
+       
        g_strchug (address); /* remove leading whitespace */
 
        /*  <email@address> from display name */
        g_strchug (address); /* remove leading whitespace */
 
        /*  <email@address> from display name */
index ef98550..d896346 100644 (file)
@@ -189,8 +189,11 @@ size_t modest_text_utils_strftime(char *s, size_t max, const char  *fmt, time_t
  * ie. removes "<...>" and "(...)" parts
  * the change is in-place; removes leading/trailing whitespace
  * 
  * ie. removes "<...>" and "(...)" parts
  * the change is in-place; removes leading/trailing whitespace
  * 
- * Returns: the new address. The string is *not* newly allocated.
- * NULL in case of error
+ * Returns: the new address of the string; this new string
+ * is _NOT_ newly allocated, so should not be freed. (remember
+ * the old address of the parameter if that one needs to be freed)
+ * 
+ * NULL in case of error or if address == NULL
  */
 gchar* modest_text_utils_get_display_address (gchar *address);
 
  */
 gchar* modest_text_utils_get_display_address (gchar *address);
 
index 78cd1fc..5aa1585 100644 (file)
@@ -300,7 +300,7 @@ _modest_header_view_compact_header_cell_data  (GtkTreeViewColumn *column,  GtkCe
        rendobj = G_OBJECT(renderer);
        header = g_markup_printf_escaped ("%s\n<small>%s</small>",
                                          subject ? subject : _("mail_va_no_subject"),
        rendobj = G_OBJECT(renderer);
        header = g_markup_printf_escaped ("%s\n<small>%s</small>",
                                          subject ? subject : _("mail_va_no_subject"),
-                                         address);
+                                         modest_text_utils_get_display_address(address));
        g_free (address);
        g_free (subject);
 
        g_free (address);
        g_free (subject);
 
@@ -335,8 +335,8 @@ _modest_header_view_size_cell_data  (GtkTreeViewColumn *column,  GtkCellRenderer
 
 void
 _modest_header_view_status_cell_data  (GtkTreeViewColumn *column,  GtkCellRenderer *renderer,
 
 void
 _modest_header_view_status_cell_data  (GtkTreeViewColumn *column,  GtkCellRenderer *renderer,
-                                    GtkTreeModel *tree_model,  GtkTreeIter *iter,
-                                    gpointer user_data)
+                                      GtkTreeModel *tree_model,  GtkTreeIter *iter,
+                                      gpointer user_data)
 {
         TnyHeaderFlags flags;
        //guint status;
 {
         TnyHeaderFlags flags;
        //guint status;