Changeset 1856
- Timestamp:
- 04/28/07 13:17:21
- Files:
-
- trunk/libtinymail/tny-folder-change.c (modified) (7 diffs)
- trunk/libtinymail/tny-folder-monitor.c (modified) (5 diffs)
- trunk/libtinymail/tny-folder-observer.c (modified) (1 diff)
- trunk/libtinymail/tny-folder-stats.c (modified) (1 diff)
- trunk/libtinymail/tny-folder-store-change.c (modified) (1 diff)
- trunk/libtinymail/tny-folder-store.c (modified) (5 diffs)
- trunk/libtinymail/tny-folder.c (modified) (1 diff)
- trunk/libtinymail/tny-fs-stream.c (modified) (2 diffs)
- trunk/libtinymail/tny-iterator.c (modified) (1 diff)
- trunk/libtinymail/tny-list.c (modified) (3 diffs)
- trunk/libtinymail/tny-merge-folder.c (modified) (1 diff)
- trunk/libtinymail/tny-send-queue.c (modified) (1 diff)
- trunk/libtinymail/tny-transport-account.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libtinymail/tny-folder-change.c
r1836 r1856 67 67 * @self: a #TnyFolderChange instance 68 68 * 69 * Get the message that got received 70 * 71 * Return value: the message that got received 69 * Get the message that got received, if the change includes receiving a message. 70 * If no message was received, NULL will be returned. If not NULL, the returned 71 * value must be unreferenced after use. 72 * 73 * Return value: the message that got received or NULL if no message was received 74 * during this change. 72 75 **/ 73 76 TnyMsg * … … 113 116 TnyFolderChangePriv *priv = TNY_FOLDER_CHANGE_GET_PRIVATE (self); 114 117 118 g_mutex_lock (priv->lock); 115 119 priv->new_all_count = new_all_count; 120 priv->changed |= TNY_FOLDER_CHANGE_CHANGED_ALL_COUNT; 121 g_mutex_unlock (priv->lock); 116 122 117 123 return; … … 130 136 TnyFolderChangePriv *priv = TNY_FOLDER_CHANGE_GET_PRIVATE (self); 131 137 138 g_mutex_lock (priv->lock); 132 139 priv->new_unread_count = new_unread_count; 133 140 priv->changed |= TNY_FOLDER_CHANGE_CHANGED_UNREAD_COUNT; 141 g_mutex_unlock (priv->lock); 134 142 135 143 return; … … 329 337 * tny_folder_change_get_rename: 330 338 * @self: a #TnyFolderChange instance 331 * @oldname: a pointer to a string 339 * @oldname: a pointer to a string (by reference) 332 340 * 333 341 * Get the new name of the folder in case of a rename. This will return NULL 334 * of n urename happened. You can pass a pointer if you need the old folder342 * of no rename happened. You can pass a pointer if you need the old folder 335 343 * name too. 336 344 * 337 * You must not free the return value nor the @oldname pointer. It's handled 338 * internally in the TnyFolderChange type. 345 * You should not free the returned value nor the @oldname pointer. 346 * 347 * Return value: The new folder name or NULL 339 348 **/ 340 349 const gchar * … … 365 374 * Mark the change in such a way that the user can know that a rename has 366 375 * happened. The TnyFolderChange will copy your @newname internally, so you 367 * can do whatever you want with what you passed afterwards .376 * can do whatever you want with what you passed afterwards (like freeing it). 368 377 **/ 369 378 void … … 406 415 * 407 416 * Get the folder of @self. The return value of this method must be unreferenced 408 * after use 409 * 410 * Return value: the #TnyFolder instancerelated to this changeset417 * after use. 418 * 419 * Return value: the #TnyFolder related to this changeset 411 420 **/ 412 421 TnyFolder* … … 464 473 priv->added = NULL; 465 474 priv->removed = NULL; 466 467 475 if (priv->msg) 468 476 g_object_unref (priv->msg); trunk/libtinymail/tny-folder-monitor.c
r1636 r1856 45 45 * @list: a #TnyList instance 46 46 * 47 * Add @list to the lists that are interested in changes. The list will remain48 * re ferenced until it's unregisterd using tny_folder_monitor_remove_list or49 * until @self is finalized.47 * Add @list to the registered lists that are interested in changes. @list will 48 * remain referenced until it's unregisterd using tny_folder_monitor_remove_list 49 * or until @self is finalized. 50 50 * 51 51 **/ … … 77 77 * 78 78 * Remove @list from the lists that are interested in changes. This will remove 79 * the reference added to @list that got added when you ussed the 80 * tny_folder_monitor_add_list API. 79 * the reference that got added when you ussed the tny_folder_monitor_add_list. 81 80 * 82 81 **/ … … 107 106 * 108 107 * Trigger the poke method on the folder instance being monitored. 109 * Also take a look at t he tny_folder_poke_status API.108 * Also take a look at tny_folder_poke_status in #TnyFolder. 110 109 * 111 110 **/ … … 261 260 * @self). 262 261 * 263 * The reason for that is that unless otherwise the folder is finalized, @self264 * would still have a reference being held by the TnyFolder instance being265 * monitored. By stopping this monitor, you explicitly ask that folder instance266 * to unregister @self asan observer. And by that loosing that reference too.262 * The reason for that is that unless you stop @self, it would still have a 263 * reference being held by the #TnyFolder instance being monitored. By stopping 264 * this monitor, you explicitly ask that folder instance to unregister @self as 265 * an observer. And by that loosing that reference too. 267 266 * 268 267 **/ … … 287 286 * 288 287 * Start monitoring the folder. The starting of a monitor implies that @self 289 * will become an observer of the folder instance , addinga reference to @self288 * will become an observer of the folder instance. This adds a reference to @self 290 289 * that at some point in time must be removed using tny_folder_monitor_stop. 291 290 * 292 * This means that if you start the monitor, you must also stop it somewhere. 293 * Which makes perfect sense, but I bet that I'm going to be surprised to see 294 * the vast amounts of people that are not going to stop their monitors, and be 295 * surprised to have memory leaks (which is normal, if the lists never get 296 * unreferenced, of course). 291 * This means that if you start the monitor, you must also at some point stop it. 297 292 * 298 * Keep this in mind: monitoring means that the lists are kept alive. A list299 * that is alive means that it's consuming memory. Simple and plain. Or not?293 * Keep this in mind: monitoring means that registered lists are kept alive. A 294 * list that is alive means that it's consuming memory! 300 295 **/ 301 296 void trunk/libtinymail/tny-folder-observer.c
r1727 r1856 29 29 * @change: A #TnyFolderChange instance 30 30 * 31 * Observer's update method ,@change is the delta of changes between the last32 * and the current state. Containing the added and removed headers, and the33 * new all -and unread count of the #TnyFolder.31 * Observer's update method. The @change is the delta of changes between the last 32 * and the current state. It contains for example the added and removed headers 33 * and the new all and unread count of the #TnyFolder. 34 34 * 35 35 **/ trunk/libtinymail/tny-folder-stats.c
r1683 r1856 77 77 * @local_size: the local size of the folder 78 78 * 79 * Set the local disk space that @self is consuming 79 * Set the local disk space that @self is consuming (should probably only be 80 * used by the #TnyFolder implementation internally: it'll define the value 81 * that tny_folder_stats_get_local_size will return). 80 82 **/ 81 83 void trunk/libtinymail/tny-folder-store-change.c
r1649 r1856 236 236 * @self: a #TnyFolderStoreChange instance 237 237 * 238 * Get the folderstore of @self. The return value of this method must be unreferenced239 * after use238 * Get the folderstore of @self. The return value of this method must be 239 * unreferenced after use 240 240 * 241 241 * Return value: the #TnyFolderStore instance related to this changeset trunk/libtinymail/tny-folder-store.c
r1728 r1856 28 28 #include <tny-list.h> 29 29 30 /* Possible future API changes:31 * tny_folder_store_find_folder for finding a folder using an url_string, maybe32 * also a tny_folder_store_set_find_folder_strategy and a33 * tny_folder_store_get_find_folder_strategy if in future alternative ways to34 * find a folder are to be specified and developed */35 30 36 31 /** … … 39 34 * @observer: a #TnyFolderStoreObserver instance 40 35 * 41 * Add @observer to the list of interested observers for the 42 * event that could happen. 36 * Add @observer to the list of interested observers for events that could happen 37 * caused by for example folder creates and deletions and other spontaneous 38 * changes. 39 * 40 * After this, @observer will start receiving notification of changes about @self. 41 * 42 * You must use tny_folder_store_remove_observer, in for example the finalization 43 * of your type if you used this method. Adding an observer to @self, changes 44 * reference counting of the objects involved. Removing the observer will undo 45 * those reference counting changes. Therefore if you don't, you will introduce 46 * memory leaks. 43 47 * 44 48 **/ … … 68 72 * @observer: a #TnyFolderStoreObserver instance 69 73 * 70 * Remove @observer from the list of interested observers for the 71 * event that could happen. 74 * Remove @observer from the list of interested observers for events that could 75 * happen caused by for example folder creates and deletions and other 76 * spontaneous changes. 77 * 78 * After this, @observer will no longer receive notification of changes about @self. 79 * 80 * You must use this method, in for example the finalization of your type 81 * if you used tny_folder_store_add_observer. Adding an observer to @self, changes 82 * reference counting of the objects involved. Removing the observer will undo 83 * those reference counting changes. Therefore if you don't, you will introduce 84 * memory leaks. 72 85 * 73 86 **/ … … 105 118 * but of course not of @self, will automatically be unsubscribed. 106 119 * 120 * API question and TODO (undetermined): what about recursive deleting? 121 * 107 122 * Example: 108 123 * <informalexample><programlisting> … … 152 167 * </programlisting></informalexample> 153 168 * 154 * Return value: A new folder instance representing the folder that was created or NULL in case of failure 169 * Return value: A new folder instance representing the folder that was created 170 * or NULL in case of failure 155 171 * 156 172 **/ trunk/libtinymail/tny-folder.c
r1855 r1856 124 124 * @observer: a #TnyFolderObserver instance 125 125 * 126 * Add @observer to the list of interested observers for eve mts that could happen126 * Add @observer to the list of interested observers for events that could happen 127 127 * caused by for example a tny_folder_poke_status and other spontaneous changes 128 128 * (like Push E-mail events). trunk/libtinymail/tny-fs-stream.c
r1199 r1856 18 18 */ 19 19 20 /* 20 /* Parts of this file were copied from the Evolution project. This is the 21 * original copyright of that file. The file's source code was distributed as 22 * LGPL content. Therefore the copyright of Tinymail is compatible with this. 23 * 21 24 * Authors: Bertrand Guiheneuf <bertrand@helixcode.com> 22 25 * Michael Zucchi <notzed@ximian.com> … … 165 168 * you. 166 169 * 167 * Therefore use it with care. It's more or less an exception in the framework 170 * Therefore use it with care. It's more or less an exception in the framework, 168 171 * whether or not you call it an exception depends on your point of view). 169 172 * 170 * The the instance will on top of close() when destructing ,also fsync() the173 * The the instance will on top of close() when destructing also fsync() the 171 174 * filedescriptor. It does this depending on its mood, the weather and your 172 175 * wives periods using a complex algorithm that abuses your privacy and might trunk/libtinymail/tny-iterator.c
r1732 r1856 111 111 * 112 112 * Does not move the iterator. Returns the object at the current position. If 113 * there no current position, this method returns NULL. If not NULL, the113 * there's no current position, this method returns NULL. If not NULL, the 114 114 * returned value must be unreferenced after use. 115 115 * trunk/libtinymail/tny-list.c
r1737 r1856 68 68 * means loosing your reason of existance. So you'll get destroyed. 69 69 * 70 * You should not prepend, remove nor append items while iterating @self. There's 71 * no guarantee whatsoever that existing iterators of @self will be valid after 72 * this method returned. 73 * 70 74 * Implementers: if you have to choose, make this one the fast one 71 *72 75 **/ 73 76 void … … 120 123 * means loosing your reason of existance. So you'll get destroyed. 121 124 * 125 * You should not prepend, remove nor append items while iterating @self. There's 126 * no guarantee whatsoever that existing iterators of @self will be valid after 127 * this method returned. 128 * 122 129 * Implementers: if you have to choose, make the prepend one the fast one 123 *124 130 **/ 125 131 void … … 150 156 * Removes an item from a list. Removing a item might invalidate all existing 151 157 * iterators or put them in an unknown and unspecified state. You'll need to 152 * recreate the iterator(s) if you remove an item to be certain.158 * recreate the iterator(s) if you removed an item. 153 159 * 154 160 * If you want to clear a list, consider using the tny_list_foreach or simply trunk/libtinymail/tny-merge-folder.c
r1820 r1856 954 954 } 955 955 956 /** 957 * tny_merge_folder_new: 958 * 959 * Creates a a new TnyMergeFolder instance that can merge multiple #TnyFolder 960 * instances together (partly read only, though). 961 * 962 * Return value: a new #TnyMergeFolder instance 963 **/ 956 964 TnyFolder* 957 965 tny_merge_folder_new (void) trunk/libtinymail/tny-send-queue.c
r1732 r1856 80 80 * 81 81 * Get the folder which contains the messages that have not yet been sent. The 82 * return value must be unreferenced after use 82 * return value must be unreferenced after use. It's not guaranteed that when 83 * changing the content of @outbox, @self will automatically adjust itself to 84 * the new situation. Although some implementations of #TnySendQueue might 85 * indeed do this, it's advisable to use tny_send_queue_add in stead of 86 * tny_folder_add_msg on @outbox. The reason for that is lack of specification 87 * and a #TnySendQueue implementation not having to implement #TnyFolderObserver 88 * too (which makes it possible to act on changes happening to @outbox). 83 89 * 84 90 * Return value: a #TnyFolder instance trunk/libtinymail/tny-transport-account.c
r1732 r1856 30 30 * @err: a #GError object or NULL 31 31 * 32 * Send @msg 32 * Send @msg. Note that @msg must be a correct #TnyMsg instance with a correct 33 * #TnyHeader, which can be used as the envelope while sending. 33 34 * 34 35 **/ … … 43 44 #endif 44 45 46 TNY_TRANSPORT_ACCOUNT_GET_IFACE (self)->send_func (self, msg, err); 45 47 46 TNY_TRANSPORT_ACCOUNT_GET_IFACE (self)->send_func (self, msg, err);47 48 return; 48 49 }
