From: Dirk-Jan C. Binnema Date: Fri, 2 Feb 2007 13:18:17 +0000 (+0000) Subject: * fix all compiler warnings (when using gtk/ frontend) X-Git-Tag: git_migration_finished~4098 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=b94b783d9801be57422fdf478ae5bdafbc7200a7;ds=sidebyside * fix all compiler warnings (when using gtk/ frontend) * fix remaing _get_current leaks * remove unuses modest_tny_msg_find_nth_part pmo-trunk-r783 --- diff --git a/src/modest-account-mgr-helpers.c b/src/modest-account-mgr-helpers.c index 57ba232..74766fd 100644 --- a/src/modest-account-mgr-helpers.c +++ b/src/modest-account-mgr-helpers.c @@ -273,6 +273,7 @@ modest_account_mgr_get_tny_account (ModestAccountMgr *self, const gchar* account 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)); diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 2012d79..59d3509 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -494,10 +494,11 @@ folder_refresh_cb (TnyFolder *folder, gboolean canceled, GError **err, gpointer 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); } @@ -509,7 +510,8 @@ update_folders_cb (TnyFolderStore *folder_store, TnyList *list, GError **err, gp ModestMailOperation *self; ModestMailOperationPrivate *priv; RefreshFolderAsyncHelper *helper; - + TnyFolder *folder; + self = MODEST_MAIL_OPERATION (user_data); priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self); @@ -530,10 +532,10 @@ update_folders_cb (TnyFolderStore *folder_store, TnyList *list, GError **err, gp 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 diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index 9cd96a4..7f796a8 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -142,33 +142,5 @@ TnyMimePart* 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); } diff --git a/src/modest-tny-msg.h b/src/modest-tny-msg.h index edfcdd5..1a696a0 100644 --- a/src/modest-tny-msg.h +++ b/src/modest-tny-msg.h @@ -44,19 +44,6 @@ TnyMimePart *modest_tny_msg_find_body_part (TnyMsg * self, gboolean 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: diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index 0e7204f..9bdb0df 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -194,7 +194,7 @@ static GdkPixbuf* get_cached_icon (const gchar *name) { GError *err = NULL; - GdkPixbuf *pixbuf; + gpointer pixbuf; gpointer orig_key; static GHashTable *icon_cache = NULL; @@ -204,8 +204,8 @@ get_cached_icon (const gchar *name) 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); @@ -216,7 +216,7 @@ get_cached_icon (const gchar *name) if (icon_cache) g_hash_table_insert (icon_cache, g_strdup(name),(gpointer)pixbuf); } - return pixbuf; + return GDK_PIXBUF(pixbuf); } diff --git a/src/widgets/modest-header-view-render.c b/src/widgets/modest-header-view-render.c index f4292a5..b5aeace 100644 --- a/src/widgets/modest-header-view-render.c +++ b/src/widgets/modest-header-view-render.c @@ -39,7 +39,7 @@ static GdkPixbuf* get_cached_icon (const gchar *name) { GError *err = NULL; - GdkPixbuf *pixbuf; + gpointer pixbuf; gpointer orig_key; static GHashTable *icon_cache = NULL; @@ -49,8 +49,8 @@ get_cached_icon (const gchar *name) 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); @@ -61,7 +61,7 @@ get_cached_icon (const gchar *name) if (icon_cache) g_hash_table_insert (icon_cache, g_strdup(name),(gpointer)pixbuf); } - return pixbuf; + return GDK_PIXBUF(pixbuf); }