* mu-store-priv: when rebuilding, remove the contacts-cache file, too
This commit is contained in:
@ -29,6 +29,7 @@
|
|||||||
#include <xapian.h>
|
#include <xapian.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "mu-store.h"
|
#include "mu-store.h"
|
||||||
#include "mu-contacts.h"
|
#include "mu-contacts.h"
|
||||||
@ -64,6 +65,11 @@ public:
|
|||||||
check_set_version ();
|
check_set_version ();
|
||||||
|
|
||||||
if (contacts_path) {
|
if (contacts_path) {
|
||||||
|
/* when rebuilding, attempt to clear the
|
||||||
|
* contacts path */
|
||||||
|
if (rebuild && access (contacts_path, W_OK) == 0)
|
||||||
|
(void)unlink (contacts_path);
|
||||||
|
|
||||||
_contacts = mu_contacts_new (contacts_path);
|
_contacts = mu_contacts_new (contacts_path);
|
||||||
if (!_contacts)
|
if (!_contacts)
|
||||||
throw MuStoreError (MU_ERROR_FILE,
|
throw MuStoreError (MU_ERROR_FILE,
|
||||||
|
|||||||
Reference in New Issue
Block a user