* mu-msg-doc.cc, mu-msg-iter.cc, mu-msg.h: cosmetics
This commit is contained in:
@ -30,12 +30,12 @@
|
|||||||
#include "mu-date.h"
|
#include "mu-date.h"
|
||||||
|
|
||||||
struct _MuMsgDoc {
|
struct _MuMsgDoc {
|
||||||
_MuMsgDoc (Xapian::Document *doc) : _doc (doc) {}
|
|
||||||
~_MuMsgDoc () { delete _doc; }
|
_MuMsgDoc (Xapian::Document *doc): _doc (doc) { }
|
||||||
|
~_MuMsgDoc () { delete _doc; }
|
||||||
const Xapian::Document doc() const { return *_doc; }
|
const Xapian::Document doc() const { return *_doc; }
|
||||||
private:
|
private:
|
||||||
Xapian::Document *_doc;
|
Xapian::Document *_doc;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ struct _MuMsgIter {
|
|||||||
public:
|
public:
|
||||||
_MuMsgIter (Xapian::Enquire &enq, size_t maxnum,
|
_MuMsgIter (Xapian::Enquire &enq, size_t maxnum,
|
||||||
gboolean threads, MuMsgFieldId sortfield):
|
gboolean threads, MuMsgFieldId sortfield):
|
||||||
_enq(enq), _thread_hash (0), _msg(0) {
|
_enq(enq), _thread_hash (0), _msg(0) {
|
||||||
|
|
||||||
_matches = _enq.get_mset (0, maxnum);
|
_matches = _enq.get_mset (0, maxnum);
|
||||||
|
|
||||||
@ -80,10 +80,11 @@ public:
|
|||||||
~_MuMsgIter () {
|
~_MuMsgIter () {
|
||||||
if (_thread_hash)
|
if (_thread_hash)
|
||||||
g_hash_table_destroy (_thread_hash);
|
g_hash_table_destroy (_thread_hash);
|
||||||
|
|
||||||
set_msg (NULL);
|
set_msg (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Xapian::Enquire& enquire() { return _enq; }
|
const Xapian::Enquire& enquire() const { return _enq; }
|
||||||
Xapian::MSet& matches() { return _matches; }
|
Xapian::MSet& matches() { return _matches; }
|
||||||
|
|
||||||
Xapian::MSet::const_iterator cursor () const { return _cursor; }
|
Xapian::MSet::const_iterator cursor () const { return _cursor; }
|
||||||
@ -98,6 +99,7 @@ public:
|
|||||||
mu_msg_unref (_msg);
|
mu_msg_unref (_msg);
|
||||||
return _msg = msg;
|
return _msg = msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const Xapian::Enquire _enq;
|
const Xapian::Enquire _enq;
|
||||||
Xapian::MSet _matches;
|
Xapian::MSet _matches;
|
||||||
@ -146,7 +148,7 @@ mu_msg_iter_get_msg_floating (MuMsgIter *iter)
|
|||||||
docp = new Xapian::Document(iter->cursor().get_document());
|
docp = new Xapian::Document(iter->cursor().get_document());
|
||||||
|
|
||||||
err = NULL;
|
err = NULL;
|
||||||
msg = iter->set_msg (mu_msg_new_from_doc ((XapianDocument*)docp, &err));
|
msg = iter->set_msg (mu_msg_new_from_doc((XapianDocument*)docp, &err));
|
||||||
if (!msg)
|
if (!msg)
|
||||||
MU_HANDLE_G_ERROR(err);
|
MU_HANDLE_G_ERROR(err);
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
#include <mu-flags.h>
|
#include <mu-flags.h>
|
||||||
#include <mu-msg-fields.h>
|
#include <mu-msg-fields.h>
|
||||||
#include <mu-msg-prio.h>
|
#include <mu-msg-prio.h>
|
||||||
#include <mu-util.h> /* for MuResult, MuError and XapianDocument */
|
#include <mu-util.h> /* for MuError and XapianDocument */
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -55,6 +55,7 @@ MuMsg *mu_msg_new_from_file (const char* filepath, const char *maildir,
|
|||||||
/**
|
/**
|
||||||
* create a new MuMsg* instance based on a Xapian::Document
|
* create a new MuMsg* instance based on a Xapian::Document
|
||||||
*
|
*
|
||||||
|
* @param store a MuStore ptr
|
||||||
* @param doc a ptr to a Xapian::Document (but cast to XapianDocument,
|
* @param doc a ptr to a Xapian::Document (but cast to XapianDocument,
|
||||||
* because this is C not C++). MuMsg takes _ownership_ of this pointer;
|
* because this is C not C++). MuMsg takes _ownership_ of this pointer;
|
||||||
* don't touch it afterwards
|
* don't touch it afterwards
|
||||||
@ -65,8 +66,7 @@ MuMsg *mu_msg_new_from_file (const char* filepath, const char *maildir,
|
|||||||
* mu_msg_unref when done with this message
|
* mu_msg_unref when done with this message
|
||||||
*/
|
*/
|
||||||
MuMsg *mu_msg_new_from_doc (XapianDocument* doc, GError **err)
|
MuMsg *mu_msg_new_from_doc (XapianDocument* doc, GError **err)
|
||||||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user