Changeset 3468
- Timestamp:
- 03/05/08 15:17:33
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-header-list-iterator-priv.h (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-header-list-model.c (modified) (5 diffs)
- trunk/libtinymailui-gtk/tny-gtk-header-list-model.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r3466 r3468 2 2 3 3 * Check-for-duplicates in TnyFolderObserver and TnyFolderMonitor 4 * Introduction of tny_gtk_header_list_model_set_no_duplicates 4 5 5 6 * This was a minor API change trunk/libtinymailui-gtk/tny-gtk-header-list-iterator-priv.h
r3324 r3468 81 81 GArray *del_timeouts; 82 82 TnyIterator *iterator; 83 gboolean no_duplicates; 83 84 }; 84 85 trunk/libtinymailui-gtk/tny-gtk-header-list-model.c
r3348 r3468 152 152 return retval; 153 153 } 154 155 154 156 155 static gboolean … … 701 700 702 701 702 static gboolean 703 uid_matcher (TnyList *list, GObject *item, gpointer match_data) 704 { 705 const char *uid = tny_header_get_uid ((TnyHeader *) item); 706 707 if (uid && !strcmp (uid, (const char*) match_data)) 708 return TRUE; 709 710 return FALSE; 711 } 712 703 713 704 714 /* This will be called often while you are in tny_folder_refresh(_async). It can … … 711 721 712 722 g_static_rec_mutex_lock (priv->iterator_lock); 723 724 if (priv->no_duplicates) { 725 const gchar *uid = tny_header_get_uid ((TnyHeader *) item); 726 if (uid) 727 tny_list_remove_matches (self, uid_matcher, (gpointer) uid); 728 } 713 729 714 730 /* Prepend something to the list itself. The get_length will auto update … … 1133 1149 self->priv = priv; 1134 1150 1151 priv->no_duplicates = FALSE; 1135 1152 priv->folder = NULL; 1136 1153 priv->iterator_lock = g_new0 (GStaticRecMutex, 1); … … 1150 1167 } 1151 1168 1169 1170 /** 1171 * tny_gtk_header_list_model_set_no_duplicates: 1172 * @self: a #TnyGtkHeaderListModel 1173 * @setting: whether or not to allow duplicates 1174 * 1175 * Sets whether or not @self allows duplicates of TnyHeader instances to be 1176 * added. The duplicates will be tested by tny_header_get_uid uniqueness. 1177 * Setting this property to TRUE will negatively impact performance of @self. 1178 * It'll also influence behaviour of tny_list_prepend and tny_list_append. 1179 * 1180 * Default value, therefore, is FALSE. 1181 * 1182 * since: 1.0 1183 * audience: application-developer 1184 **/ 1185 void 1186 tny_gtk_header_list_model_set_no_duplicates (TnyGtkHeaderListModel *self, gboolean setting) 1187 { 1188 TnyGtkHeaderListModelPriv *priv = TNY_GTK_HEADER_LIST_MODEL_GET_PRIVATE (self); 1189 priv->no_duplicates = setting; 1190 return; 1191 } 1152 1192 1153 1193 /** trunk/libtinymailui-gtk/tny-gtk-header-list-model.h
r3349 r3468 78 78 gint tny_gtk_header_list_model_received_date_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data); 79 79 gint tny_gtk_header_list_model_sent_date_sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data); 80 void tny_gtk_header_list_model_set_no_duplicates (TnyGtkHeaderListModel *self, gboolean setting); 80 81 81 82 G_END_DECLS
