account = TNY_ACCOUNT(tny_iterator_get_current(iter));
if (strcmp (tny_account_get_id (account), server_account) == 0)
break;
+ g_object_unref (G_OBJECT(account));
}
g_object_unref (G_OBJECT(iter));
g_object_unref (G_OBJECT (list));
g_slice_free (RefreshFolderAsyncHelper, helper);
} else {
- tny_folder_refresh_async (TNY_FOLDER (tny_iterator_get_current (helper->iter)),
- folder_refresh_cb,
+ TnyFolder *folder = TNY_FOLDER (tny_iterator_get_current (helper->iter));
+ tny_folder_refresh_async (folder, folder_refresh_cb,
status_update_cb,
helper);
+ g_object_unref (G_OBJECT(folder));
}
g_signal_emit (G_OBJECT (self), signals[PROGRESS_CHANGED_SIGNAL], 0, NULL);
}
ModestMailOperation *self;
ModestMailOperationPrivate *priv;
RefreshFolderAsyncHelper *helper;
-
+ TnyFolder *folder;
+
self = MODEST_MAIL_OPERATION (user_data);
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
helper->canceled = 0;
/* Async refresh folders */
- tny_folder_refresh_async (TNY_FOLDER (tny_iterator_get_current (helper->iter)),
- folder_refresh_cb,
- status_update_cb,
- helper);
+ folder = TNY_FOLDER (tny_iterator_get_current (helper->iter));
+ tny_folder_refresh_async (folder, folder_refresh_cb,
+ status_update_cb, helper);
+ g_object_unref (G_OBJECT(folder));
}
gboolean
modest_tny_msg_find_body_part (TnyMsg *msg, gboolean want_html)
{
return modest_tny_msg_find_body_part_from_mime_part (TNY_MIME_PART(msg),
- want_html);
-}
-
-
-TnyMimePart *
-modest_tny_msg_find_nth_part (TnyMsg *msg, gint index)
-{
- TnyMimePart *part;
- TnyList *parts;
- TnyIterator *iter;
-
- g_return_val_if_fail (msg, NULL);
- g_return_val_if_fail (index > 0, NULL);
-
- parts = TNY_LIST(tny_simple_list_new());
- tny_mime_part_get_parts (TNY_MIME_PART(msg), parts);
- iter = tny_list_create_iterator (parts);
-
- part = NULL;
-
- if (!tny_iterator_is_done(iter)) {
- tny_iterator_nth (iter, index);
- part = TNY_MIME_PART(tny_iterator_get_current (iter));
- }
-
- g_object_unref (G_OBJECT(iter));
- g_object_unref (G_OBJECT(parts));
-
- return part;
+ want_html);
}
/**
- * modest_tny_msg_get_nth_part:
- * @self: a message
- * @index: number (1-based) of the part to retrieve
- *
- * search for the nth (mime) part in the message
- *
- * Returns: the TnyMsgMimePart for the found part, or NULL if no
- * matching part is foundi; must be unref'd
- */
-TnyMimePart* modest_tny_msg_find_nth_part (TnyMsg *msg, gint index);
-
-
-/**
* modest_tny_msg_find_body:
* @self:
* @want_html:
get_cached_icon (const gchar *name)
{
GError *err = NULL;
- GdkPixbuf *pixbuf;
+ gpointer pixbuf;
gpointer orig_key;
static GHashTable *icon_cache = NULL;
icon_cache = modest_cache_mgr_get_cache (modest_runtime_get_cache_mgr(),
MODEST_CACHE_MGR_CACHE_TYPE_PIXBUF);
- if (!icon_cache || !g_hash_table_lookup_extended (icon_cache, name, &orig_key,(gpointer*)&pixbuf)) {
- pixbuf = gdk_pixbuf_new_from_file (name, &err);
+ if (!icon_cache || !g_hash_table_lookup_extended (icon_cache, name, &orig_key, &pixbuf)) {
+ pixbuf = (gpointer)gdk_pixbuf_new_from_file (name, &err);
if (!pixbuf) {
g_printerr ("modest: error in icon factory while loading '%s': %s\n",
name, err->message);
if (icon_cache)
g_hash_table_insert (icon_cache, g_strdup(name),(gpointer)pixbuf);
}
- return pixbuf;
+ return GDK_PIXBUF(pixbuf);
}
get_cached_icon (const gchar *name)
{
GError *err = NULL;
- GdkPixbuf *pixbuf;
+ gpointer pixbuf;
gpointer orig_key;
static GHashTable *icon_cache = NULL;
icon_cache = modest_cache_mgr_get_cache (modest_runtime_get_cache_mgr(),
MODEST_CACHE_MGR_CACHE_TYPE_PIXBUF);
- if (!icon_cache || !g_hash_table_lookup_extended (icon_cache, name, &orig_key,(gpointer*)&pixbuf)) {
- pixbuf = gdk_pixbuf_new_from_file (name, &err);
+ if (!icon_cache || !g_hash_table_lookup_extended (icon_cache, name, &orig_key,&pixbuf)) {
+ pixbuf = (gpointer)gdk_pixbuf_new_from_file (name, &err);
if (!pixbuf) {
g_printerr ("modest: error in icon factory while loading '%s': %s\n",
name, err->message);
if (icon_cache)
g_hash_table_insert (icon_cache, g_strdup(name),(gpointer)pixbuf);
}
- return pixbuf;
+ return GDK_PIXBUF(pixbuf);
}