Changeset 563
- Timestamp:
- 07/09/06 09:05:06
- Files:
-
- trunk/AUTHORS (modified) (1 diff)
- trunk/ChangeLog (modified) (2 diffs)
- trunk/libtinymail-camel/tny-msg-folder-list-iterator.c (modified) (2 diffs)
- trunk/libtinymail/tny-iterator-iface.c (modified) (1 diff)
- trunk/libtinymail/tny-iterator-iface.h (modified) (2 diffs)
- trunk/libtinymail/tny-list-iterator.c (modified) (4 diffs)
- trunk/libtinymailui-gtk/tny-account-tree-model-iterator.c (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-msg-header-list-iterator.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/AUTHORS
r377 r563 9 9 Florian Boor <florian.boor@kernelconcepts.de> 10 10 11 * Initial support for status flags. 11 * Initial support for status flags 12 13 Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com> 14 15 * Contributions to the TnyIteratorIface type trunk/ChangeLog
r539 r563 1 06-09-2006 Dirk-Jan C. Binnema <dirk-jan.binnema@nokia.com> 2 3 * tny_iterator_iface_is_end method 4 5 06-07-2006 Philip Van Hoof <pvanhoof@gnome.org> 6 7 * Major API changes in TnyAccountStore 8 1 9 06-21-2006 Florian Boor <florian.boor@kernelconcepts.de> 2 10 3 11 * Make GPE TnyDevice default to be online for now. 4 12 13 06-01-2006 Philip Van Hoof <pvanhoof@gnome.org> 14 15 * Implementation and implementing 16 5 17 06-09-2006 Florian Boor <florian.boor@kernelconcepts.de> 6 18 7 19 * Fix endless loop sending mails. 20 21 05-01-2006 Philip Van Hoof <pvanhoof@gnome.org> 22 23 * Implementation and implementing 8 24 9 25 05-24-2006 Florian Boor <florian.boor@kernelconcepts.de> … … 12 28 * Minor fixes. 13 29 14 XX-YY-2006 Philip Van Hoof <pvanhoof@gnome.org>30 04-01-2006 Philip Van Hoof <pvanhoof@gnome.org> 15 31 16 * More ChangeLog items coming soon. Really.32 * Implementation and implementing 17 33 18 34 03-07-2006 Raphael Slinckx <raphael@slinckx.net> trunk/libtinymail-camel/tny-msg-folder-list-iterator.c
r550 r563 93 93 g_mutex_unlock (me->model->iterator_lock); 94 94 95 return me->current->data; 96 } 95 return me->current ? me->current->data : NULL; 96 } 97 98 99 100 101 static gboolean 102 tny_msg_folder_list_iterator_is_done (TnyIteratorIface *self) 103 { 104 TnyMsgFolderListIterator *me = (TnyMsgFolderListIterator*) self; 105 106 if (G_UNLIKELY (!me || !me->model)) 107 return TRUE; 108 109 return me->current != NULL; 110 } 111 112 113 97 114 98 115 static gpointer … … 232 249 klass->has_first_func = tny_msg_folder_list_iterator_has_first; 233 250 klass->get_list_func = tny_msg_folder_list_iterator_get_list; 234 251 klass->is_done = tny_msg_folder_list_iterator_is_done; 252 235 253 return; 236 254 } trunk/libtinymail/tny-iterator-iface.c
r550 r563 124 124 return TNY_ITERATOR_IFACE_GET_CLASS (self)->current_func (self); 125 125 } 126 127 128 129 /** 130 * tny_iterator_iface_is_done: 131 * @self: A #TnyIteratorIface instance 132 * 133 * Does the iterator point to some valid list item 134 * 135 * Return value: TRUE if it points to a valid list item, FALSE otherwise 136 * 137 **/ 138 gboolean 139 tny_iterator_iface_is_done (TnyIteratorIface *self) 140 { 141 #ifdef DEBUG 142 if (!TNY_ITERATOR_IFACE_GET_CLASS (self)->is_done) 143 g_critical ("You must implement tny_iterator_iface_is_done\n"); 144 #endif 145 146 return TNY_ITERATOR_IFACE_GET_CLASS (self)->is_done (self); 147 } 148 149 126 150 127 151 trunk/libtinymail/tny-iterator-iface.h
r554 r563 49 49 gboolean (*has_next_func) (TnyIteratorIface *self); 50 50 51 gboolean (*is_done) (TnyIteratorIface *self); 52 51 53 TnyListIface* (*get_list_func) (TnyIteratorIface *self); 52 54 }; … … 62 64 gboolean tny_iterator_iface_has_first (TnyIteratorIface *self); 63 65 gboolean tny_iterator_iface_has_next (TnyIteratorIface *self); 66 67 gboolean tny_iterator_iface_is_done (TnyIteratorIface *self); 68 64 69 TnyListIface* tny_iterator_iface_get_list (TnyIteratorIface *self); 65 70 trunk/libtinymail/tny-list-iterator.c
r552 r563 95 95 g_mutex_unlock (lpriv->iterator_lock); 96 96 97 return me->current ? me->current->data : NULL; 98 } 99 100 static gpointer 101 tny_list_iterator_prev (TnyIteratorIface *self) 102 { 103 TnyListIterator *me = (TnyListIterator*) self; 104 TnyListPriv *lpriv; 105 106 if (G_UNLIKELY (!me || !me->current || !me->model)) 107 return NULL; 108 109 lpriv = TNY_LIST_GET_PRIVATE (me->model); 110 111 g_mutex_lock (lpriv->iterator_lock); 112 me->current = g_list_previous (me->current); 113 g_mutex_unlock (lpriv->iterator_lock); 114 97 115 return me->current->data; 98 116 } 99 117 100 118 static gpointer 101 tny_list_iterator_ prev(TnyIteratorIface *self)119 tny_list_iterator_first (TnyIteratorIface *self) 102 120 { 103 121 TnyListIterator *me = (TnyListIterator*) self; … … 110 128 111 129 g_mutex_lock (lpriv->iterator_lock); 112 me->current = g_list_previous (me->current);130 me->current = lpriv->first; 113 131 g_mutex_unlock (lpriv->iterator_lock); 114 132 … … 116 134 } 117 135 118 static gpointer 119 tny_list_iterator_first (TnyIteratorIface *self) 120 { 121 TnyListIterator *me = (TnyListIterator*) self; 122 TnyListPriv *lpriv; 123 124 if (G_UNLIKELY (!me || !me->current || !me->model)) 125 return NULL; 126 127 lpriv = TNY_LIST_GET_PRIVATE (me->model); 128 129 g_mutex_lock (lpriv->iterator_lock); 130 me->current = lpriv->first; 131 g_mutex_unlock (lpriv->iterator_lock); 132 133 return me->current->data; 134 } 136 137 static gboolean 138 tny_list_iterator_is_done (TnyIteratorIface *self) 139 { 140 TnyListIterator *me = (TnyListIterator*) self; 141 142 return me->current == NULL; 143 } 144 135 145 136 146 … … 241 251 klass->has_next_func = tny_list_iterator_has_next; 242 252 klass->get_list_func = tny_list_iterator_get_list; 243 253 klass->is_done = tny_list_iterator_is_done; 254 244 255 return; 245 256 } trunk/libtinymailui-gtk/tny-account-tree-model-iterator.c
r556 r563 87 87 g_mutex_unlock (me->model->iterator_lock); 88 88 89 return me->current ? me->current->data : NULL; 90 } 91 92 static gpointer 93 tny_account_tree_model_iterator_prev (TnyIteratorIface *self) 94 { 95 TnyAccountTreeModelIterator *me = (TnyAccountTreeModelIterator*) self; 96 97 if (G_UNLIKELY (!me || !me->current || !me->model)) 98 return NULL; 99 100 /* Move the iterator to the previous node */ 101 102 g_mutex_lock (me->model->iterator_lock); 103 me->current = g_list_previous (me->current); 104 g_mutex_unlock (me->model->iterator_lock); 105 89 106 return me->current->data; 90 107 } 91 108 92 static gpointer 93 tny_account_tree_model_iterator_prev (TnyIteratorIface *self) 94 { 95 TnyAccountTreeModelIterator *me = (TnyAccountTreeModelIterator*) self; 96 97 if (G_UNLIKELY (!me || !me->current || !me->model)) 98 return NULL; 99 100 /* Move the iterator to the previous node */ 101 102 g_mutex_lock (me->model->iterator_lock); 103 me->current = g_list_previous (me->current); 104 g_mutex_unlock (me->model->iterator_lock); 105 106 return me->current->data; 107 } 109 110 static gboolean 111 tny_account_tree_model_iterator_is_done (TnyIteratorIface *self) 112 { 113 TnyAccountTreeModelIterator *me = (TnyAccountTreeModelIterator*) self; 114 115 if (G_UNLIKELY (!me || !me->model)) 116 return TRUE; 117 118 return me->current == NULL; 119 } 120 121 108 122 109 123 static gpointer … … 229 243 klass->has_next_func = tny_account_tree_model_iterator_has_next; 230 244 klass->get_list_func = tny_account_tree_model_iterator_get_list; 231 245 klass->is_done = tny_account_tree_model_iterator_is_done; 246 232 247 return; 233 248 } trunk/libtinymailui-gtk/tny-msg-header-list-iterator.c
r550 r563 109 109 g_mutex_unlock (me->model->iterator_lock); 110 110 111 return me->current ? me->current->data : NULL; 112 } 113 114 gpointer 115 _tny_msg_header_list_iterator_prev_nl (TnyMsgHeaderListIterator *me) 116 { 117 me->current = me->current?g_list_previous (me->current):NULL; 118 return me->current?me->current->data:NULL; 119 } 120 121 static gpointer 122 tny_msg_header_list_iterator_prev (TnyIteratorIface *self) 123 { 124 TnyMsgHeaderListIterator *me = (TnyMsgHeaderListIterator*) self; 125 126 if (G_UNLIKELY (!me || !me->current || !me->model)) 127 return NULL; 128 129 /* Move the iterator to the previous node */ 130 131 g_mutex_lock (me->model->iterator_lock); 132 me->current = g_list_previous (me->current); 133 g_mutex_unlock (me->model->iterator_lock); 134 111 135 return me->current->data; 112 136 } 113 137 114 gpointer 115 _tny_msg_header_list_iterator_prev_nl (TnyMsgHeaderListIterator *me) 116 { 117 me->current = me->current?g_list_previous (me->current):NULL; 118 return me->current?me->current->data:NULL; 119 } 120 121 static gpointer 122 tny_msg_header_list_iterator_prev (TnyIteratorIface *self) 123 { 124 TnyMsgHeaderListIterator *me = (TnyMsgHeaderListIterator*) self; 125 126 if (G_UNLIKELY (!me || !me->current || !me->model)) 127 return NULL; 128 129 /* Move the iterator to the previous node */ 130 131 g_mutex_lock (me->model->iterator_lock); 132 me->current = g_list_previous (me->current); 133 g_mutex_unlock (me->model->iterator_lock); 134 135 return me->current->data; 136 } 138 139 static gboolean 140 tny_msg_header_list_iterator_is_done (TnyIteratorIface *self) 141 { 142 TnyMsgHeaderListIterator *me = (TnyMsgHeaderListIterator*) self; 143 144 if (G_UNLIKELY (!me || !me->model)) 145 return TRUE; 146 147 return me->current != NULL; 148 } 149 137 150 138 151 gpointer … … 284 297 klass->has_next_func = tny_msg_header_list_iterator_has_next; 285 298 klass->get_list_func = tny_msg_header_list_iterator_get_list; 286 299 klass->is_done = tny_msg_header_list_iterator_is_done; 300 287 301 return; 288 302 }
