* mug: update for api changes

This commit is contained in:
Dirk-Jan C. Binnema
2011-08-30 22:03:29 +03:00
parent fec0092312
commit b8447cde47
4 changed files with 34 additions and 26 deletions

View File

@ -61,6 +61,7 @@ static void
reindex (MugData *mugdata)
{
MuIndex *midx;
MuStore *store;
GError *err;
if (mu_store_database_is_locked
@ -68,9 +69,10 @@ reindex (MugData *mugdata)
return;
err = NULL;
midx = mu_index_new (mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
mu_runtime_path(MU_RUNTIME_PATH_CONTACTS),
&err);
store = mu_store_new_writable (mu_runtime_path(MU_RUNTIME_PATH_XAPIANDB),
mu_runtime_path(MU_RUNTIME_PATH_CONTACTS),
&err);
midx = store ? mu_index_new (store, &err) : NULL;
if (!midx) {
if (err && err->code == MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK) {
g_warning ("database busy...");
@ -86,6 +88,7 @@ reindex (MugData *mugdata)
FALSE, NULL, (MuIndexMsgCallback)each_msg, NULL, mugdata);
mu_index_destroy (midx);
mu_store_unref (store);
}