Changeset 966
- Timestamp:
- 09/17/06 17:58:54
- Files:
-
- trunk/ChangeLog (modified) (1 diff)
- trunk/docs/devel/reference/tmpl/tny-folder.sgml (modified) (2 diffs)
- trunk/docs/devel/reference/tmpl/tny-stream.sgml (modified) (2 diffs)
- trunk/libtinymail-camel/tny-camel-folder.c (modified) (3 diffs)
- trunk/libtinymail-camel/tny-camel-stream.c (modified) (2 diffs)
- trunk/libtinymail-camel/tny-stream-camel.c (modified) (1 diff)
- trunk/libtinymail-gnomevfs/tny-vfs-stream.c (modified) (3 diffs)
- trunk/libtinymail-test/tny-mime-part-test.c (modified) (1 diff)
- trunk/libtinymail-test/tny-stream-test.c (modified) (1 diff)
- trunk/libtinymail-test/tny-test-anything.c (modified) (1 diff)
- trunk/libtinymail-test/tny-test-stream.c (modified) (3 diffs)
- trunk/libtinymail/tny-folder.c (modified) (2 diffs)
- trunk/libtinymail/tny-folder.h (modified) (2 diffs)
- trunk/libtinymail/tny-fs-stream.c (modified) (3 diffs)
- trunk/libtinymail/tny-stream.c (modified) (2 diffs)
- trunk/libtinymail/tny-stream.h (modified) (2 diffs)
- trunk/libtinymailui-gtk/tny-gtk-text-buffer-stream.c (modified) (3 diffs)
- trunk/libtinymailui-mozembed/tny-moz-embed-stream.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog
r965 r966 3 3 * Changed the length method of the TnyList interface to get_length as 4 4 it's a normal property like any other 5 5 * Changed the eos method of the TnyStream interface to is_eos as it's 6 a normal property like any other 7 * Changes to the subscribe/unsubscribe API in TnyFolder 8 6 9 * This was a major API change 7 10 trunk/docs/devel/reference/tmpl/tny-folder.sgml
r936 r966 58 58 @get_all_count_func: 59 59 @get_unread_count_func: 60 @set_subscribed_func: 61 @get_subscribed_func: 60 @is_subscribed_func: 62 61 @refresh_async_func: 63 62 @refresh_func: … … 178 177 179 178 180 <!-- ##### FUNCTION tny_folder_set_subscribed ##### -->181 <para>182 183 </para>184 185 @self:186 @subscribed:187 188 189 <!-- ##### FUNCTION tny_folder_get_subscribed ##### -->190 <para>191 192 </para>193 194 @self:195 @Returns:196 197 198 179 <!-- ##### FUNCTION tny_folder_refresh_async ##### --> 199 180 <para> trunk/docs/devel/reference/tmpl/tny-stream.sgml
r914 r966 34 34 @flush_func: 35 35 @close_func: 36 @ eos_func:36 @is_eos_func: 37 37 @reset_func: 38 38 @write_to_stream_func: … … 78 78 79 79 80 <!-- ##### FUNCTION tny_stream_eos ##### -->81 <para>82 83 </para>84 85 @self:86 @Returns:87 88 89 80 <!-- ##### FUNCTION tny_stream_reset ##### --> 90 81 <para> trunk/libtinymail-camel/tny-camel-folder.c
r925 r966 197 197 198 198 static gboolean 199 tny_camel_folder_ get_subscribed (TnyFolder *self)199 tny_camel_folder_is_subscribed (TnyFolder *self) 200 200 { 201 201 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); … … 221 221 } 222 222 223 static void224 tny_camel_folder_set_subscribed (TnyFolder *self, gboolean subscribed)225 {226 TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self);227 228 /* These will synchronize me using _tny_folder_set_subscribed_priv */229 230 if (G_LIKELY (subscribed))231 tny_store_account_subscribe232 (TNY_STORE_ACCOUNT (priv->account), self);233 else234 tny_store_account_unsubscribe235 (TNY_STORE_ACCOUNT (priv->account), self);236 237 return;238 }239 223 240 224 static guint … … 881 865 klass->get_all_count_func = tny_camel_folder_get_all_count; 882 866 klass->get_account_func = tny_camel_folder_get_account; 883 klass->get_subscribed_func = tny_camel_folder_get_subscribed; 884 klass->set_subscribed_func = tny_camel_folder_set_subscribed; 867 klass->is_subscribed_func = tny_camel_folder_is_subscribed; 885 868 klass->refresh_async_func = tny_camel_folder_refresh_async; 886 869 klass->refresh_func = tny_camel_folder_refresh; trunk/libtinymail-camel/tny-camel-stream.c
r900 r966 123 123 124 124 static gboolean 125 tny_camel_stream_ eos (TnyStream *self)125 tny_camel_stream_is_eos (TnyStream *self) 126 126 { 127 127 TnyCamelStreamPriv *priv = TNY_CAMEL_STREAM_GET_PRIVATE (self); … … 212 212 klass->flush_func = tny_camel_stream_flush; 213 213 klass->close_func = tny_camel_stream_close; 214 klass-> eos_func = tny_camel_stream_eos;214 klass->is_eos_func = tny_camel_stream_is_eos; 215 215 klass->reset_func = tny_camel_stream_reset; 216 216 klass->write_to_stream_func = tny_camel_stream_write_to_stream; trunk/libtinymail-camel/tny-stream-camel.c
r900 r966 95 95 { 96 96 TnyStreamCamel *self = (TnyStreamCamel *)stream; 97 return tny_stream_ eos (self->stream);97 return tny_stream_is_eos (self->stream); 98 98 } 99 99 trunk/libtinymail-gnomevfs/tny-vfs-stream.c
r961 r966 161 161 gssize nb_written; 162 162 163 while (G_UNLIKELY (!tny_stream_ eos (self))) {163 while (G_UNLIKELY (!tny_stream_is_eos (self))) { 164 164 nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 165 165 if (G_UNLIKELY (nb_read < 0)) … … 344 344 345 345 static gboolean 346 tny_vfs_ eos (TnyStream *self)346 tny_vfs_is_eos (TnyStream *self) 347 347 { 348 348 TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); … … 383 383 klass->reset_func = tny_vfs_reset; 384 384 klass->flush_func = tny_vfs_flush; 385 klass-> eos_func = tny_vfs_eos;385 klass->is_eos_func = tny_vfs_is_eos; 386 386 387 387 klass->read_func = tny_vfs_stream_read; trunk/libtinymail-test/tny-mime-part-test.c
r900 r966 139 139 tny_mime_part_write_to_stream (iface, to); 140 140 141 while (!tny_stream_ eos (to) && n < 1)141 while (!tny_stream_is_eos (to) && n < 1) 142 142 { 143 143 gchar buf[2]; trunk/libtinymail-test/tny-stream-test.c
r962 r966 122 122 tny_stream_reset (source); 123 123 124 while (!tny_stream_ eos (iface))124 while (!tny_stream_is_eos (iface)) 125 125 { 126 126 gchar buf[2]; trunk/libtinymail-test/tny-test-anything.c
r960 r966 84 84 tny_stream_reset (source); 85 85 86 while (!tny_stream_ eos (iface))86 while (!tny_stream_is_eos (iface)) 87 87 { 88 88 gchar buf[2]; trunk/libtinymail-test/tny-test-stream.c
r900 r966 50 50 ssize_t nb_written; 51 51 52 while (!tny_stream_ eos (self))52 while (!tny_stream_is_eos (self)) 53 53 { 54 54 … … 122 122 123 123 static gboolean 124 tny_test_stream_ eos (TnyStream *self)124 tny_test_stream_is_eos (TnyStream *self) 125 125 { 126 126 TnyTestStream *me = TNY_TEST_STREAM (self); … … 171 171 klass->close_func = tny_test_stream_close; 172 172 klass->write_to_stream_func = tny_test_stream_write_to_stream; 173 klass-> eos_func = tny_test_stream_eos;173 klass->is_eos_func = tny_test_stream_is_eos; 174 174 klass->reset_func = tny_test_stream_reset; 175 175 trunk/libtinymail/tny-folder.c
r917 r966 142 142 } 143 143 144 /** 145 * tny_folder_set_subscribed: 146 * @self: a TnyFolder object 147 * @subscribed: Whether or not to subscribe to the folder 148 * 149 * WARNING: This API might soon change 150 * 151 * Set the subscribed status of this folder. 152 * 153 **/ 154 void 155 tny_folder_set_subscribed (TnyFolder *self, gboolean subscribed) 156 { 157 #ifdef DEBUG 158 if (!TNY_FOLDER_GET_IFACE (self)->set_subscribed_func) 159 g_critical ("You must implement tny_folder_set_subscribed\n"); 160 #endif 161 162 TNY_FOLDER_GET_IFACE (self)->set_subscribed_func (self, subscribed); 163 return; 164 } 165 166 /** 167 * tny_folder_get_subscribed: 168 * @self: a TnyFolder object 169 * 170 * WARNING: This API might soon change 144 145 /** 146 * tny_folder_is_subscribed: 147 * @self: a TnyFolder object 148 * 171 149 * 172 150 * Get the subscribed status of this folder. … … 175 153 **/ 176 154 gboolean 177 tny_folder_ get_subscribed (TnyFolder *self)178 { 179 #ifdef DEBUG 180 if (!TNY_FOLDER_GET_IFACE (self)-> get_subscribed_func)181 g_critical ("You must implement tny_folder_ get_subscribed\n");182 #endif 183 184 return TNY_FOLDER_GET_IFACE (self)-> get_subscribed_func (self);155 tny_folder_is_subscribed (TnyFolder *self) 156 { 157 #ifdef DEBUG 158 if (!TNY_FOLDER_GET_IFACE (self)->is_subscribed_func) 159 g_critical ("You must implement tny_folder_is_subscribed\n"); 160 #endif 161 162 return TNY_FOLDER_GET_IFACE (self)->is_subscribed_func (self); 185 163 } 186 164 trunk/libtinymail/tny-folder.h
r943 r966 87 87 guint (*get_all_count_func) (TnyFolder *self); 88 88 guint (*get_unread_count_func) (TnyFolder *self); 89 void (*set_subscribed_func) (TnyFolder *self, gboolean subscribed); 90 gboolean (*get_subscribed_func) (TnyFolder *self); 89 gboolean (*is_subscribed_func) (TnyFolder *self); 91 90 void (*refresh_async_func) (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 92 91 void (*refresh_func) (TnyFolder *self); … … 107 106 guint tny_folder_get_all_count (TnyFolder *self); 108 107 guint tny_folder_get_unread_count (TnyFolder *self); 109 void tny_folder_set_subscribed (TnyFolder *self, gboolean subscribed); 110 gboolean tny_folder_get_subscribed (TnyFolder *self); 108 gboolean tny_folder_is_subscribed (TnyFolder *self); 111 109 void tny_folder_refresh_async (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 112 110 void tny_folder_refresh (TnyFolder *self); trunk/libtinymail/tny-fs-stream.c
r961 r966 75 75 gssize nb_written; 76 76 77 while (G_UNLIKELY (!tny_stream_ eos (self))) {77 while (G_UNLIKELY (!tny_stream_is_eos (self))) { 78 78 nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 79 79 if (G_UNLIKELY (nb_read < 0)) … … 244 244 245 245 static gboolean 246 tny_fs_ eos (TnyStream *self)246 tny_fs_is_eos (TnyStream *self) 247 247 { 248 248 TnyFsStreamPriv *priv = TNY_FS_STREAM_GET_PRIVATE (self); … … 266 266 klass->reset_func = tny_fs_reset; 267 267 klass->flush_func = tny_fs_flush; 268 klass-> eos_func = tny_fs_eos;268 klass->is_eos_func = tny_fs_is_eos; 269 269 270 270 klass->read_func = tny_fs_stream_read; trunk/libtinymail/tny-stream.c
r900 r966 135 135 136 136 /** 137 * tny_stream_ eos:137 * tny_stream_is_eos: 138 138 * @self: a #TnyStream object 139 139 * … … 144 144 **/ 145 145 gboolean 146 tny_stream_ eos (TnyStream *self)147 { 148 #ifdef DEBUG 149 if (!TNY_STREAM_GET_IFACE (self)-> eos_func)150 g_critical ("You must implement tny_stream_ eos\n");151 #endif 152 153 return TNY_STREAM_GET_IFACE (self)-> eos_func (self);146 tny_stream_is_eos (TnyStream *self) 147 { 148 #ifdef DEBUG 149 if (!TNY_STREAM_GET_IFACE (self)->is_eos_func) 150 g_critical ("You must implement tny_stream_is_eos\n"); 151 #endif 152 153 return TNY_STREAM_GET_IFACE (self)->is_eos_func (self); 154 154 } 155 155 trunk/libtinymail/tny-stream.h
r903 r966 47 47 gint (*flush_func) (TnyStream *self); 48 48 gint (*close_func) (TnyStream *self); 49 gboolean (* eos_func) (TnyStream *self);49 gboolean (*is_eos_func) (TnyStream *self); 50 50 gint (*reset_func) (TnyStream *self); 51 51 gssize (*write_to_stream_func) (TnyStream *self, TnyStream *output); … … 58 58 gint tny_stream_flush (TnyStream *self); 59 59 gint tny_stream_close (TnyStream *self); 60 gboolean tny_stream_ eos (TnyStream *self);60 gboolean tny_stream_is_eos (TnyStream *self); 61 61 gint tny_stream_reset (TnyStream *self); 62 62 gssize tny_stream_write_to_stream (TnyStream *self, TnyStream *output); trunk/libtinymailui-gtk/tny-gtk-text-buffer-stream.c
r957 r966 50 50 gssize nb_written; 51 51 52 while (G_LIKELY (!tny_stream_ eos (self)))52 while (G_LIKELY (!tny_stream_is_eos (self))) 53 53 { 54 54 nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); … … 130 130 131 131 static gboolean 132 tny_gtk_text_buffer_stream_ eos (TnyStream *self)132 tny_gtk_text_buffer_stream_is_eos (TnyStream *self) 133 133 { 134 134 TnyGtkTextBufferStreamPriv *priv = TNY_GTK_TEXT_BUFFER_STREAM_GET_PRIVATE (self); … … 237 237 klass->flush_func = tny_gtk_text_buffer_stream_flush; 238 238 klass->close_func = tny_gtk_text_buffer_stream_close; 239 klass-> eos_func = tny_gtk_text_buffer_stream_eos;239 klass->is_eos_func = tny_gtk_text_buffer_stream_is_eos; 240 240 klass->reset_func = tny_gtk_text_buffer_stream_reset; 241 241 klass->write_to_stream_func = tny_text_buffer_write_to_stream; trunk/libtinymailui-mozembed/tny-moz-embed-stream.c
r900 r966 54 54 ssize_t nb_written; 55 55 56 while (G_LIKELY (!tny_stream_ eos (self)))56 while (G_LIKELY (!tny_stream_is_eos (self))) 57 57 { 58 58 nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); … … 195 195 196 196 static gboolean 197 tny_moz_embed_stream_ eos (TnyStream *self)197 tny_moz_embed_stream_is_eos (TnyStream *self) 198 198 { 199 199 return TRUE; … … 279 279 klass->flush_func = tny_moz_embed_stream_flush; 280 280 klass->close_func = tny_moz_embed_stream_close; 281 klass-> eos_func = tny_moz_embed_stream_eos;281 klass->is_eos_func = tny_moz_embed_stream_is_eos; 282 282 klass->reset_func = tny_moz_embed_stream_reset; 283 283 klass->write_to_stream_func = tny_moz_embed_write_to_stream;
