X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=f1a9dc2ed25f9934bf990cc40d40375fb108ece5;hb=77ec8108a10a8d372bed6298e22c89d7de651577;hp=fa632f85121a56d969c2365ff882282290007f53;hpb=606e4461f803829077af4e3b2579583f7e39bc3e;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index fa632f85..f1a9dc2e 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); @@ -1443,7 +1447,7 @@ _notmuch_database_link_message_to_parents (notmuch_database_t *notmuch, keys = g_hash_table_get_keys (parents); for (l = keys; l; l = l->next) { char *parent_message_id; - const char *parent_thread_id; + const char *parent_thread_id = NULL; parent_message_id = (char *) l->data; @@ -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 {