X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;h=98f101e6e617a04e9b6c26213f7e35a03dd5c0c3;hp=88be939138c7e6db51fc2e1fc70313bb170d2a1e;hb=69dc421ab3355930f23ec6aa47e7e936cbfafb97;hpb=1dedfc90f6eee7cad10f1a1ceb39a7a1c4dbd1b1 diff --git a/lib/database.cc b/lib/database.cc index 88be9391..98f101e6 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -26,6 +26,7 @@ #include #include /* g_free, GPtrArray, GHashTable */ +#include /* g_type_init */ using namespace std; @@ -600,6 +601,9 @@ notmuch_database_open (const char *path, goto DONE; } + /* Initialize the GLib type system and threads */ + g_type_init (); + notmuch = talloc (NULL, notmuch_database_t); notmuch->exception_reported = FALSE; notmuch->path = talloc_strdup (notmuch, path); @@ -1015,7 +1019,7 @@ notmuch_database_end_atomic (notmuch_database_t *notmuch) * However, we rely on flushing to test atomicity. */ const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD"); if (thresh && atoi (thresh) == 1) - db->commit (); + db->flush (); } catch (const Xapian::Error &error) { fprintf (stderr, "A Xapian exception occurred committing transaction: %s.\n", error.get_msg().c_str()); @@ -1725,7 +1729,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch, goto DONE; date = notmuch_message_file_get_header (message_file, "date"); - _notmuch_message_set_date (message, date); + _notmuch_message_set_header_values (message, date, from, subject); _notmuch_message_index_file (message, filename); } else {