mirror of https://github.com/djcb/mu.git
* mu-msg-doc.cc, mu-msg-iter.cc, mu-msg.h: cosmetics
This commit is contained in:
parent
9cb879ab64
commit
8ab3ff1fec
|
@ -30,12 +30,12 @@
|
|||
#include "mu-date.h"
|
||||
|
||||
struct _MuMsgDoc {
|
||||
_MuMsgDoc (Xapian::Document *doc) : _doc (doc) {}
|
||||
|
||||
_MuMsgDoc (Xapian::Document *doc): _doc (doc) { }
|
||||
~_MuMsgDoc () { delete _doc; }
|
||||
const Xapian::Document doc() const { return *_doc; }
|
||||
private:
|
||||
Xapian::Document *_doc;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -80,10 +80,11 @@ public:
|
|||
~_MuMsgIter () {
|
||||
if (_thread_hash)
|
||||
g_hash_table_destroy (_thread_hash);
|
||||
|
||||
set_msg (NULL);
|
||||
}
|
||||
|
||||
const Xapian::Enquire& enquire() { return _enq; }
|
||||
const Xapian::Enquire& enquire() const { return _enq; }
|
||||
Xapian::MSet& matches() { return _matches; }
|
||||
|
||||
Xapian::MSet::const_iterator cursor () const { return _cursor; }
|
||||
|
@ -98,6 +99,7 @@ public:
|
|||
mu_msg_unref (_msg);
|
||||
return _msg = msg;
|
||||
}
|
||||
|
||||
private:
|
||||
const Xapian::Enquire _enq;
|
||||
Xapian::MSet _matches;
|
||||
|
@ -146,7 +148,7 @@ mu_msg_iter_get_msg_floating (MuMsgIter *iter)
|
|||
docp = new Xapian::Document(iter->cursor().get_document());
|
||||
|
||||
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)
|
||||
MU_HANDLE_G_ERROR(err);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <mu-flags.h>
|
||||
#include <mu-msg-fields.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
|
||||
|
||||
|
@ -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
|
||||
*
|
||||
* @param store a MuStore ptr
|
||||
* @param doc a ptr to a Xapian::Document (but cast to XapianDocument,
|
||||
* because this is C not C++). MuMsg takes _ownership_ of this pointer;
|
||||
* don't touch it afterwards
|
||||
|
@ -68,7 +69,6 @@ MuMsg *mu_msg_new_from_doc (XapianDocument* doc, GError **err)
|
|||
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* increase the reference count for this message
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue