]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
lib: call g_type_init from notmuch_database_open
[notmuch] / lib / database.cc
index fa632f85121a56d969c2365ff882282290007f53..98f101e6e617a04e9b6c26213f7e35a03dd5c0c3 100644 (file)
@@ -26,6 +26,7 @@
 #include <signal.h>
 
 #include <glib.h> /* g_free, GPtrArray, GHashTable */
+#include <glib-object.h> /* 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);
@@ -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 {