From bc90df6c53a4fd8c935437574fb57577411738e3 Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 23 Oct 2012 20:29:24 +0300 Subject: [PATCH] * cosmetics / minor --- guile/mu-guile-message.c | 5 +++-- guile/mu.scm | 9 +++++---- lib/mu-msg-iter.cc | 4 ++-- lib/mu-query.cc | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/guile/mu-guile-message.c b/guile/mu-guile-message.c index 24902116..e1d57b95 100644 --- a/guile/mu-guile-message.c +++ b/guile/mu-guile-message.c @@ -296,8 +296,9 @@ SCM_DEFINE (get_contacts, "mu:c:get-contacts", 2, 0, 0, else if (scm_is_eq (CONTACT_TYPE, SYMB_CONTACT_FROM)) ecdata.ctype = MU_MSG_CONTACT_TYPE_FROM; else - /* FIXME: raise error */ - g_return_val_if_reached (SCM_UNDEFINED); + return mu_guile_error (FUNC_NAME, 0, + "invalid contact type", + SCM_UNDEFINED); } ecdata.lst = SCM_EOL; diff --git a/guile/mu.scm b/guile/mu.scm index 8b60a73a..779c44d8 100644 --- a/guile/mu.scm +++ b/guile/mu.scm @@ -60,7 +60,6 @@ mu:contact->string ;; mu:for-each-contact - ;; mu:contacts ;; @@ -180,9 +179,11 @@ store. MAXRESULTS specifies the maximum of messages to return, or (define-method (mu:contacts (msg ) contact-type) "Get all contacts for MSG of the given CONTACT-TYPE. MSG is of type , -while contact type is either `mu:to', `mu:cc', `mu:from' or `mu:bcc' -to get the corresponding type of contacts, or #t to get all. Returns a -list of objects." +while contact type is either `mu:contact:to', `mu:contact:cc', +`mu:contact:from' or `mu:contact:bcc' to get the corresponding type of +contacts, or #t to get all. + +Returns a list of objects." (map (lambda (pair) ;; a pair (na . addr) (make #:name (car pair) #:email (cdr pair))) (mu:c:get-contacts (slot-ref msg 'msg) contact-type))) diff --git a/lib/mu-msg-iter.cc b/lib/mu-msg-iter.cc index ee0f9bd7..99395307 100644 --- a/lib/mu-msg-iter.cc +++ b/lib/mu-msg-iter.cc @@ -132,7 +132,6 @@ mu_msg_iter_new (XapianEnquire *enq, size_t maxnum, sortfield, revert ? true : false); } catch (const Xapian::DatabaseModifiedError &dbmex) { - mu_util_g_set_error (err, MU_ERROR_XAPIAN_MODIFIED, "database was modified; please reopen"); return 0; @@ -161,7 +160,8 @@ 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); diff --git a/lib/mu-query.cc b/lib/mu-query.cc index 74a25a87..9b5dfea5 100644 --- a/lib/mu-query.cc +++ b/lib/mu-query.cc @@ -282,8 +282,8 @@ mu_query_new (MuStore *store, GError **err) try { return new MuQuery (store); - } MU_XAPIAN_CATCH_BLOCK_G_ERROR_RETURN (err, MU_ERROR_XAPIAN, 0); + return 0; }