X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=248d1dc27a89dad5c8759e02e4c9758d3f941e3c;hb=e823d05ae6dc920d4fc9abf774c3d2575d891d7b;hp=82ac5f200ebfec6de03f9b7ff26e0af4aadfe137;hpb=1121299905e2b2684d7cc56ec35c26c3a012783e;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index 82ac5f20..248d1dc2 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -517,29 +517,6 @@ notmuch_database_close (notmuch_database_t *notmuch) return status; } -notmuch_status_t -notmuch_database_reopen (notmuch_database_t *notmuch, - unused(notmuch_database_mode_t mode)) -{ - if (_notmuch_database_mode (notmuch) != NOTMUCH_DATABASE_MODE_READ_ONLY) - return NOTMUCH_STATUS_UNSUPPORTED_OPERATION; - - try { - notmuch->xapian_db->reopen (); - } catch (const Xapian::Error &error) { - if (! notmuch->exception_reported) { - _notmuch_database_log (notmuch, "Error: A Xapian exception reopening database: %s\n", - error.get_msg ().c_str ()); - notmuch->exception_reported = true; - } - return NOTMUCH_STATUS_XAPIAN_EXCEPTION; - } - - notmuch->view++; - - return NOTMUCH_STATUS_SUCCESS; -} - static int unlink_cb (const char *path, unused (const struct stat *sb), @@ -775,7 +752,7 @@ notmuch_database_destroy (notmuch_database_t *notmuch) const char * notmuch_database_get_path (notmuch_database_t *notmuch) { - return notmuch->path; + return notmuch_config_get (notmuch, NOTMUCH_CONFIG_DATABASE_PATH); } unsigned int @@ -1373,7 +1350,7 @@ _notmuch_database_relative_path (notmuch_database_t *notmuch, const char *db_path, *relative; unsigned int db_path_len; - db_path = notmuch_database_get_path (notmuch); + db_path = notmuch_config_get (notmuch, NOTMUCH_CONFIG_MAIL_ROOT); db_path_len = strlen (db_path); relative = path;