* refactor: add mu_msg_iter_xapian_get_msg_gmime and use it

This commit is contained in:
Dirk-Jan C. Binnema
2010-08-18 22:49:10 +03:00
parent 145fd8f75c
commit 69c93430b9
3 changed files with 58 additions and 24 deletions

View File

@ -63,6 +63,7 @@ mu_msg_iter_xapian_new (const Xapian::Enquire& enq, size_t batchsize)
} MU_XAPIAN_CATCH_BLOCK_RETURN(NULL);
}
void
mu_msg_iter_xapian_destroy (MuMsgIterXapian *iter)
{
@ -78,6 +79,31 @@ mu_msg_iter_xapian_destroy (MuMsgIterXapian *iter)
}
}
MuMsgGMime*
mu_msg_iter_xapian_get_msg_gmime (MuMsgIterXapian *iter)
{
const char *path;
MuMsgGMime *msg;
g_return_val_if_fail (iter, NULL);
path = mu_msg_iter_xapian_get_path (iter);
if (!path) {
g_warning ("%s: no path for message", __FUNCTION__);
return NULL;
}
msg = mu_msg_gmime_new (path, NULL);
if (!msg) {
g_warning ("%s: failed to create msg object", __FUNCTION__);
return NULL;
}
return msg;
}
static gboolean
message_is_readable (MuMsgIterXapian *iter)
{