]> git.notmuchmail.org Git - notmuch/blobdiff - lib/directory.cc
lib: Eliminate some redundant includes of xapian.h
[notmuch] / lib / directory.cc
index 5e75b73eb5cfea02d2c7796ae0cd7de7dccf125e..2540ca7647fa99e976593d052fed6b55437c9380 100644 (file)
@@ -21,8 +21,6 @@
 #include "notmuch-private.h"
 #include "database-private.h"
 
-#include <xapian.h>
-
 struct _notmuch_filenames {
     Xapian::TermIterator iterator;
     Xapian::TermIterator end;
@@ -52,7 +50,7 @@ _notmuch_filenames_destructor (notmuch_filenames_t *filenames)
  * iterating over the non-prefixed portion of terms sharing a common
  * prefix.
  */
-notmuch_filenames_t *
+static notmuch_filenames_t *
 _notmuch_filenames_create (void *ctx,
                           notmuch_database_t *notmuch,
                           const char *prefix)
@@ -231,7 +229,8 @@ _notmuch_directory_create (notmuch_database_t *notmuch,
            directory->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,
                                      Xapian::sortable_serialise (0));
 
-           directory->document_id = db->add_document (directory->doc);
+           directory->document_id = _notmuch_database_generate_doc_id (notmuch);
+           db->replace_document (directory->document_id, directory->doc);
            talloc_free (local);
        }