Changeset 966

Show
Ignore:
Timestamp:
09/17/06 17:58:54
Author:
pvanhoof
Message:

API changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r965 r966  
    33        * Changed the length method of the TnyList interface to get_length as 
    44        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 
    69        * This was a major API change 
    710 
  • trunk/docs/devel/reference/tmpl/tny-folder.sgml

    r936 r966  
    5858@get_all_count_func:  
    5959@get_unread_count_func:  
    60 @set_subscribed_func:  
    61 @get_subscribed_func:  
     60@is_subscribed_func:  
    6261@refresh_async_func:  
    6362@refresh_func:  
     
    178177 
    179178 
    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  
    198179<!-- ##### FUNCTION tny_folder_refresh_async ##### --> 
    199180<para> 
  • trunk/docs/devel/reference/tmpl/tny-stream.sgml

    r914 r966  
    3434@flush_func:  
    3535@close_func:  
    36 @eos_func:  
     36@is_eos_func:  
    3737@reset_func:  
    3838@write_to_stream_func:  
     
    7878 
    7979 
    80 <!-- ##### FUNCTION tny_stream_eos ##### --> 
    81 <para> 
    82  
    83 </para> 
    84  
    85 @self:  
    86 @Returns:  
    87  
    88  
    8980<!-- ##### FUNCTION tny_stream_reset ##### --> 
    9081<para> 
  • trunk/libtinymail-camel/tny-camel-folder.c

    r925 r966  
    197197 
    198198static gboolean 
    199 tny_camel_folder_get_subscribed (TnyFolder *self) 
     199tny_camel_folder_is_subscribed (TnyFolder *self) 
    200200{ 
    201201        TnyCamelFolderPriv *priv = TNY_CAMEL_FOLDER_GET_PRIVATE (self); 
     
    221221} 
    222222 
    223 static void 
    224 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_subscribe  
    232                         (TNY_STORE_ACCOUNT (priv->account), self); 
    233         else 
    234                 tny_store_account_unsubscribe 
    235                         (TNY_STORE_ACCOUNT (priv->account), self); 
    236  
    237         return; 
    238 } 
    239223 
    240224static guint 
     
    881865        klass->get_all_count_func = tny_camel_folder_get_all_count; 
    882866        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; 
    885868        klass->refresh_async_func = tny_camel_folder_refresh_async; 
    886869        klass->refresh_func = tny_camel_folder_refresh; 
  • trunk/libtinymail-camel/tny-camel-stream.c

    r900 r966  
    123123 
    124124static gboolean 
    125 tny_camel_stream_eos   (TnyStream *self) 
     125tny_camel_stream_is_eos   (TnyStream *self) 
    126126{ 
    127127        TnyCamelStreamPriv *priv = TNY_CAMEL_STREAM_GET_PRIVATE (self); 
     
    212212        klass->flush_func = tny_camel_stream_flush; 
    213213        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; 
    215215        klass->reset_func = tny_camel_stream_reset; 
    216216        klass->write_to_stream_func = tny_camel_stream_write_to_stream; 
  • trunk/libtinymail-camel/tny-stream-camel.c

    r900 r966  
    9595{ 
    9696        TnyStreamCamel *self = (TnyStreamCamel *)stream; 
    97         return tny_stream_eos (self->stream); 
     97        return tny_stream_is_eos (self->stream); 
    9898} 
    9999 
  • trunk/libtinymail-gnomevfs/tny-vfs-stream.c

    r961 r966  
    161161        gssize nb_written; 
    162162         
    163         while (G_UNLIKELY (!tny_stream_eos (self))) { 
     163        while (G_UNLIKELY (!tny_stream_is_eos (self))) { 
    164164                nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 
    165165                if (G_UNLIKELY (nb_read < 0)) 
     
    344344 
    345345static gboolean  
    346 tny_vfs_eos (TnyStream *self) 
     346tny_vfs_is_eos (TnyStream *self) 
    347347{ 
    348348        TnyVfsStreamPriv *priv = TNY_VFS_STREAM_GET_PRIVATE (self); 
     
    383383        klass->reset_func = tny_vfs_reset; 
    384384        klass->flush_func = tny_vfs_flush; 
    385         klass->eos_func = tny_vfs_eos; 
     385        klass->is_eos_func = tny_vfs_is_eos; 
    386386 
    387387        klass->read_func = tny_vfs_stream_read; 
  • trunk/libtinymail-test/tny-mime-part-test.c

    r900 r966  
    139139        tny_mime_part_write_to_stream (iface, to); 
    140140 
    141         while (!tny_stream_eos (to) && n < 1) 
     141        while (!tny_stream_is_eos (to) && n < 1) 
    142142        { 
    143143                gchar buf[2]; 
  • trunk/libtinymail-test/tny-stream-test.c

    r962 r966  
    122122        tny_stream_reset (source); 
    123123 
    124         while (!tny_stream_eos (iface)) 
     124        while (!tny_stream_is_eos (iface)) 
    125125        { 
    126126                gchar buf[2]; 
  • trunk/libtinymail-test/tny-test-anything.c

    r960 r966  
    8484        tny_stream_reset (source); 
    8585 
    86         while (!tny_stream_eos (iface)) 
     86        while (!tny_stream_is_eos (iface)) 
    8787        { 
    8888                gchar buf[2]; 
  • trunk/libtinymail-test/tny-test-stream.c

    r900 r966  
    5050        ssize_t nb_written; 
    5151         
    52         while (!tny_stream_eos (self))  
     52        while (!tny_stream_is_eos (self))  
    5353        { 
    5454 
     
    122122 
    123123static gboolean 
    124 tny_test_stream_eos (TnyStream *self) 
     124tny_test_stream_is_eos (TnyStream *self) 
    125125{ 
    126126        TnyTestStream *me = TNY_TEST_STREAM (self); 
     
    171171        klass->close_func = tny_test_stream_close; 
    172172        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; 
    174174        klass->reset_func = tny_test_stream_reset; 
    175175 
  • trunk/libtinymail/tny-folder.c

    r917 r966  
    142142} 
    143143 
    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 *  
    171149 * 
    172150 * Get the subscribed status of this folder. 
     
    175153 **/ 
    176154gboolean 
    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); 
     155tny_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); 
    185163} 
    186164 
  • trunk/libtinymail/tny-folder.h

    r943 r966  
    8787        guint (*get_all_count_func) (TnyFolder *self);   
    8888        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); 
    9190        void (*refresh_async_func) (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 
    9291        void (*refresh_func) (TnyFolder *self); 
     
    107106guint tny_folder_get_all_count (TnyFolder *self); 
    108107guint 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); 
     108gboolean tny_folder_is_subscribed (TnyFolder *self); 
    111109void tny_folder_refresh_async (TnyFolder *self, TnyRefreshFolderCallback callback, TnyRefreshFolderStatusCallback status_callback, gpointer user_data); 
    112110void tny_folder_refresh (TnyFolder *self); 
  • trunk/libtinymail/tny-fs-stream.c

    r961 r966  
    7575        gssize nb_written; 
    7676         
    77         while (G_UNLIKELY (!tny_stream_eos (self))) { 
     77        while (G_UNLIKELY (!tny_stream_is_eos (self))) { 
    7878                nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 
    7979                if (G_UNLIKELY (nb_read < 0)) 
     
    244244 
    245245static gboolean  
    246 tny_fs_eos (TnyStream *self) 
     246tny_fs_is_eos (TnyStream *self) 
    247247{ 
    248248        TnyFsStreamPriv *priv = TNY_FS_STREAM_GET_PRIVATE (self); 
     
    266266        klass->reset_func = tny_fs_reset; 
    267267        klass->flush_func = tny_fs_flush; 
    268         klass->eos_func = tny_fs_eos; 
     268        klass->is_eos_func = tny_fs_is_eos; 
    269269 
    270270        klass->read_func = tny_fs_stream_read; 
  • trunk/libtinymail/tny-stream.c

    r900 r966  
    135135 
    136136/** 
    137  * tny_stream_eos: 
     137 * tny_stream_is_eos: 
    138138 * @self: a #TnyStream object 
    139139 *  
     
    144144 **/ 
    145145gboolean 
    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); 
     146tny_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); 
    154154} 
    155155 
  • trunk/libtinymail/tny-stream.h

    r903 r966  
    4747        gint (*flush_func) (TnyStream *self); 
    4848        gint (*close_func) (TnyStream *self); 
    49         gboolean (*eos_func) (TnyStream *self); 
     49        gboolean (*is_eos_func) (TnyStream *self); 
    5050        gint (*reset_func) (TnyStream *self); 
    5151        gssize (*write_to_stream_func) (TnyStream *self, TnyStream *output); 
     
    5858gint tny_stream_flush (TnyStream *self); 
    5959gint tny_stream_close (TnyStream *self); 
    60 gboolean tny_stream_eos (TnyStream *self); 
     60gboolean tny_stream_is_eos (TnyStream *self); 
    6161gint tny_stream_reset (TnyStream *self); 
    6262gssize tny_stream_write_to_stream (TnyStream *self, TnyStream *output); 
  • trunk/libtinymailui-gtk/tny-gtk-text-buffer-stream.c

    r957 r966  
    5050        gssize nb_written; 
    5151         
    52         while (G_LIKELY (!tny_stream_eos (self)))  
     52        while (G_LIKELY (!tny_stream_is_eos (self)))  
    5353        { 
    5454                nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 
     
    130130 
    131131static gboolean 
    132 tny_gtk_text_buffer_stream_eos   (TnyStream *self) 
     132tny_gtk_text_buffer_stream_is_eos   (TnyStream *self) 
    133133{ 
    134134        TnyGtkTextBufferStreamPriv *priv = TNY_GTK_TEXT_BUFFER_STREAM_GET_PRIVATE (self); 
     
    237237        klass->flush_func = tny_gtk_text_buffer_stream_flush; 
    238238        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; 
    240240        klass->reset_func = tny_gtk_text_buffer_stream_reset; 
    241241        klass->write_to_stream_func = tny_text_buffer_write_to_stream; 
  • trunk/libtinymailui-mozembed/tny-moz-embed-stream.c

    r900 r966  
    5454        ssize_t nb_written; 
    5555         
    56         while (G_LIKELY (!tny_stream_eos (self)))  
     56        while (G_LIKELY (!tny_stream_is_eos (self)))  
    5757        { 
    5858                nb_read = tny_stream_read (self, tmp_buf, sizeof (tmp_buf)); 
     
    195195 
    196196static gboolean 
    197 tny_moz_embed_stream_eos   (TnyStream *self) 
     197tny_moz_embed_stream_is_eos   (TnyStream *self) 
    198198{ 
    199199        return TRUE; 
     
    279279        klass->flush_func = tny_moz_embed_stream_flush; 
    280280        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; 
    282282        klass->reset_func = tny_moz_embed_stream_reset; 
    283283        klass->write_to_stream_func = tny_moz_embed_write_to_stream;