[PATCH 03/10] Added method to know if a mime part is already fetched.



---
 libtinymail-camel/tny-camel-bs-mime-part.c |   18 ++++++++++++++++++
 libtinymail-camel/tny-camel-bs-mime-part.h |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/libtinymail-camel/tny-camel-bs-mime-part.c b/libtinymail-camel/tny-camel-bs-mime-part.c
index 9bbbe7b..77cb490 100644
--- a/libtinymail-camel/tny-camel-bs-mime-part.c
+++ b/libtinymail-camel/tny-camel-bs-mime-part.c
@@ -1081,6 +1081,24 @@ _tny_camel_bs_mime_part_set_strat (TnyCamelBsMimePart *self, TnyCamelBsMsgReceiv
 	return;
 }
 
+gboolean
+tny_camel_bs_mime_part_is_fetched (TnyCamelBsMimePart *part)
+{
+	TnyCamelBsMimePartPriv *priv = TNY_CAMEL_BS_MIME_PART_GET_PRIVATE (self);
+	CamelFolderPartState state;
+	CamelFolder *cfolder = _tny_camel_folder_get_camel_folder (TNY_CAMEL_FOLDER (priv->folder));
+	gchar *pos_filename = camel_folder_get_cache_filename (cfolder, 
+		priv->uid, priv->bodystructure->part_spec, &state);
+
+	if (pos_filename) {
+		g_free (pos_filename);
+		return TRUE;
+	}
+
+	return FALSE;
+}
+
+
 static void
 tny_camel_bs_mime_part_finalize (GObject *object)
 {
diff --git a/libtinymail-camel/tny-camel-bs-mime-part.h b/libtinymail-camel/tny-camel-bs-mime-part.h
index 3972901..b2ebf46 100644
--- a/libtinymail-camel/tny-camel-bs-mime-part.h
+++ b/libtinymail-camel/tny-camel-bs-mime-part.h
@@ -79,6 +79,8 @@ struct _TnyCamelBsMimePartClass
 
 GType tny_camel_bs_mime_part_get_type (void);
 
+gboolean tny_camel_bs_mime_part_is_fetched (TnyCamelBsMimePart *part);
+
 
 G_END_DECLS
 
-- 
1.6.3.3


--=-gnkDh763C8UIUYIzLd8x
Content-Disposition: attachment; filename*0=0004-Added-a-global-filter-to-bs-msg-receive-strategy-to-.pat; filename*1=ch
Content-Type: text/x-patch; name="0004-Added-a-global-filter-to-bs-msg-receive-strategy-to-.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]