Hook up our fancy new notmuch_parse_date function.

With all the de-glib-ification out of the way, we can now use it
to allow for date-based sorting of Xapian search results.
This commit is contained in:
Carl Worth 2009-10-19 13:35:29 -07:00
parent 401c6cc579
commit fa562fa22b
3 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@ all: $(PROGS)
%.o: %.c %.o: %.c
$(CC) -c $(CFLAGS) $(MYCFLAGS) $^ -o $@ $(CC) -c $(CFLAGS) $(MYCFLAGS) $^ -o $@
notmuch: notmuch.o database.o message.o xutil.o notmuch: notmuch.o database.o date.o message.o xutil.o
$(CC) $(MYLDFLAGS) $^ -o $@ $(CC) $(MYLDFLAGS) $^ -o $@
notmuch-index-message: notmuch-index-message.cc notmuch-index-message: notmuch-index-message.cc

View file

@ -554,13 +554,11 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
free (message_id); free (message_id);
/*
date = notmuch_message_get_header (message, "date"); date = notmuch_message_get_header (message, "date");
time_value = notmuch_parse_date (date, NULL); time_value = notmuch_parse_date (date, NULL);
doc.add_value (NOTMUCH_VALUE_DATE, doc.add_value (NOTMUCH_VALUE_DATE,
Xapian::sortable_serialise (time_value)); Xapian::sortable_serialise (time_value));
*/
db->add_document (doc); db->add_document (doc);
} catch (const Xapian::Error &error) { } catch (const Xapian::Error &error) {

2
date.c
View file

@ -27,6 +27,8 @@
#include <time.h> #include <time.h>
#include <glib.h> /* For g_ascii_strncasecmp only. */
#ifndef FALSE #ifndef FALSE
#define FALSE 0 #define FALSE 0
#endif #endif