mirror of https://github.com/djcb/mu.git
* mu-msg-iter.{cc,h}: updete for mu-msg-data removal
This commit is contained in:
parent
438299a7d6
commit
caef14f316
|
@ -350,47 +350,3 @@ mu_msg_iter_get_prio (MuMsgIter *iter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static gchar*
|
|
||||||
get_field_copy (MuMsgIter *iter, MuMsgFieldId mfid)
|
|
||||||
{
|
|
||||||
const char *s;
|
|
||||||
|
|
||||||
s = get_field (iter, mfid);
|
|
||||||
return s ? g_strdup (s) : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
MuMsgData*
|
|
||||||
mu_msg_iter_get_msgdata (MuMsgIter *iter)
|
|
||||||
{
|
|
||||||
MuMsgData *mdata;
|
|
||||||
|
|
||||||
g_return_val_if_fail (!mu_msg_iter_is_done(iter), NULL);
|
|
||||||
|
|
||||||
mdata = mu_msg_data_new ();
|
|
||||||
|
|
||||||
try {
|
|
||||||
mdata->cc = get_field_copy (iter, MU_MSG_FIELD_ID_CC);
|
|
||||||
mdata->from = get_field_copy (iter, MU_MSG_FIELD_ID_FROM);
|
|
||||||
mdata->maildir = get_field_copy (iter, MU_MSG_FIELD_ID_MAILDIR);
|
|
||||||
mdata->msgid = get_field_copy (iter, MU_MSG_FIELD_ID_MSGID);
|
|
||||||
mdata->path = get_field_copy (iter, MU_MSG_FIELD_ID_PATH);
|
|
||||||
mdata->refs = get_field_copy (iter, MU_MSG_FIELD_ID_REFS);
|
|
||||||
mdata->subject = get_field_copy (iter, MU_MSG_FIELD_ID_SUBJECT);
|
|
||||||
mdata->to = get_field_copy (iter, MU_MSG_FIELD_ID_TO);
|
|
||||||
|
|
||||||
mdata->size = static_cast<size_t>(get_field_numeric
|
|
||||||
(iter, MU_MSG_FIELD_ID_SIZE));
|
|
||||||
mdata->date = static_cast<time_t>(get_field_numeric
|
|
||||||
(iter, MU_MSG_FIELD_ID_DATE));
|
|
||||||
mdata->flags = static_cast<MuMsgFlags>(get_field_numeric
|
|
||||||
(iter, MU_MSG_FIELD_ID_FLAGS));
|
|
||||||
mdata->prio = static_cast<MuMsgPrio>(get_field_numeric
|
|
||||||
(iter, MU_MSG_FIELD_ID_PRIO));
|
|
||||||
|
|
||||||
return mdata;
|
|
||||||
|
|
||||||
} MU_XAPIAN_CATCH_BLOCK;
|
|
||||||
|
|
||||||
mu_msg_data_destroy (mdata); /* something bad happended */
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** Copyright (C) 2008-2011 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
** Copyright (C) 2008-2010 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
**
|
**
|
||||||
** This program is free software; you can redistribute it and/or modify
|
** This program is free software; you can redistribute it and/or modify
|
||||||
** it under the terms of the GNU General Public License as published by
|
** it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <mu-msg.h>
|
#include <mu-msg.h>
|
||||||
#include <mu-msg-data.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -86,20 +85,6 @@ MuMsg* mu_msg_iter_get_msg (MuMsgIter *iter, GError **err)
|
||||||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get a structure with information about this iter; this struct is
|
|
||||||
* newly allocated, can be used to keep an in-memory record of a
|
|
||||||
* message
|
|
||||||
*
|
|
||||||
* @param iter a valid msg iterator
|
|
||||||
*
|
|
||||||
* @return a newly allocate MuMsgData struct (free with
|
|
||||||
* mu_msg_data_destroy), or NULL in case of error
|
|
||||||
*/
|
|
||||||
MuMsgData* mu_msg_iter_get_msgdata (MuMsgIter *iter)
|
|
||||||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the document id for the current message
|
* get the document id for the current message
|
||||||
|
|
Loading…
Reference in New Issue