Changeset 921
- Timestamp:
- 09/11/06 13:48:31
- Files:
-
- trunk/TODO (modified) (1 diff)
- trunk/bindings/python/tinymail.override (modified) (2 diffs)
- trunk/libtinymail/tny-list.c (modified) (1 diff)
- trunk/libtinymail/tny-simple-list.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-account-tree-model.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-attach-list-model.c (modified) (1 diff)
- trunk/libtinymailui-gtk/tny-gtk-header-list-model.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/TODO
r920 r921 3 3 o. The docs don't describe the enums 4 4 o. The docs don't describe the TnyGetFoldersCallback 5 o. The prerequisites of some types add GObject (this isn't needed)6 o. The Python bindings don't wrap the TnyGetFoldersCallback7 o. I think the tny_list_copy implementations need to add a reference to the items!5 o. The prerequisites of some types add GObject (this often isn't needed) 6 o. Implement removing folders and messages (TnyFolderStore) 7 o. Implement and design moving messages (TnyFolderStore?) trunk/bindings/python/tinymail.override
r906 r921 35 35 import gobject.GObject as PyGObject_Type 36 36 %% 37 override tny_folder_store_get_folders_async kwargs 38 39 static void 40 tny_get_folders_cb (TnyFolderStore *self, TnyList *list, gpointer user_data) 41 { 42 PyObject *callback, *args, *ret; 43 PyGILState_STATE state; 44 45 state = pyg_gil_state_ensure(); 46 callback = PyTuple_GetItem((PyObject *)user_data, 0); 47 args = Py_BuildValue("(NNO)", 48 pygobject_new((GObject *)self), 49 pygobject_new((GObject *)list), 50 PyTuple_GetItem((PyObject *)user_data, 1)); 51 ret = PyObject_CallObject(callback, args); 52 if (!ret) 53 PyErr_Print(); 54 Py_XDECREF(ret); 55 Py_DECREF(args); 56 Py_DECREF ((PyObject *)user_data); 57 pyg_gil_state_release(state); 58 } 59 60 61 static PyObject * 62 _wrap_tny_folder_store_get_folders_async (PyGObject *self, PyObject *args, PyObject *kwargs) 63 { 64 static char *kwlist[] = { "list", "get_folders_func", "query", "user_data", NULL }; 65 PyObject *get_folders_func = Py_None, *user_data = Py_None; 66 PyGObject *list = NULL, *query = NULL; 67 PyObject *data; 68 69 if (!PyArg_ParseTupleAndKeywords(args, kwargs, 70 "OO|OO:TnyFolderStore.get_folders_async", kwlist, 71 &list, &get_folders_func, &query, &user_data)) 72 return NULL; 73 74 if (!PyCallable_Check(get_folders_func)) { 75 PyErr_SetString(PyExc_TypeError, "get_folders_async must be callable"); 76 return NULL; 77 } 78 79 data = Py_BuildValue("(OO)", get_folders_func, user_data); 80 81 tny_folder_store_get_folders_async (TNY_FOLDER_STORE (self->obj), 82 TNY_LIST (list->obj), 83 tny_get_folders_cb, 84 query!=NULL?TNY_FOLDER_STORE_QUERY (query->obj):NULL, 85 data); 86 return Py_None; 87 } 88 %% 37 89 override tny_folder_refresh_async kwargs 38 90 … … 134 186 /* TODO: check for failure? */ 135 187 136 tny_iterator_nth (iter, index);188 tny_iterator_nth (iter, index); 137 189 ret = tny_iterator_get_current (iter); 138 g_object_unref (G_OBJECT (ret)); 190 191 g_object_unref (G_OBJECT (ret)); /* IM Not sure about this one */ 139 192 g_object_unref (G_OBJECT (iter)); 140 193 trunk/libtinymail/tny-list.c
r908 r921 211 211 * 212 212 * Creates a copy of the list. It doesn't copy the items. It, however, creates 213 * a new list with new references to the same items. 214 * 215 * Because it's a new instance, the returned list object should be unreferenced216 * a fter use.213 * a new list with new references to the same items. The items will get an extra 214 * reference added for the new list being their second parent, setting their 215 * reference count to for example two. Which means that both lists (the original 216 * and the copy) must be unreferenced after use. 217 217 * 218 218 * Return value: A copy of this list trunk/libtinymail/tny-simple-list.c
r900 r921 105 105 g_mutex_lock (priv->iterator_lock); 106 106 GList *list_copy = g_list_copy (priv->first); 107 g_list_foreach (list_copy, (GFunc)g_object_ref, NULL); 107 108 cpriv->first = list_copy; 108 109 g_mutex_unlock (priv->iterator_lock); trunk/libtinymailui-gtk/tny-gtk-account-tree-model.c
r906 r921 274 274 g_mutex_lock (me->iterator_lock); 275 275 GList *list_copy = g_list_copy (me->first); 276 g_list_foreach (list_copy, (GFunc)g_object_ref, NULL); 276 277 copy->first = list_copy; 277 278 g_mutex_unlock (me->iterator_lock); trunk/libtinymailui-gtk/tny-gtk-attach-list-model.c
r900 r921 301 301 g_mutex_lock (me->iterator_lock); 302 302 GList *list_copy = g_list_copy (me->first); 303 g_list_foreach (list_copy, (GFunc)g_object_ref, NULL); 303 304 copy->first = list_copy; 304 305 g_mutex_unlock (me->iterator_lock); trunk/libtinymailui-gtk/tny-gtk-header-list-model.c
r906 r921 708 708 g_mutex_lock (me->iterator_lock); 709 709 GList *list_copy = g_list_copy (me->first); 710 g_list_foreach (list_copy, (GFunc)g_object_ref, NULL); 710 711 copy->first = list_copy; 711 712 copy->usable_index = FALSE;
