aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/importers/evolution-ldif-importer.c7
-rw-r--r--addressbook/importers/evolution-vcard-importer.c7
3 files changed, 22 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 79e9fae852..0e58a1db19 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2005-12-14 Sushma Rai <rsushma@novell.com>
+
+ * importers/evolution-ldif-importer.c (ldif_import): Proceeding with
+ the import activity only if the book is writable.
+
+ * importers/evolution-vcard-importer.c (vcard_import): Similar.
+ Fixes #266003
+
2005-12-10 Sushma Rai <rsushma@novell.com>
* gui/contact-editor/e-contact-editor.c (fill_in_address_textview):
diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c
index dfec5dfc51..02607e8cb5 100644
--- a/addressbook/importers/evolution-ldif-importer.c
+++ b/addressbook/importers/evolution-ldif-importer.c
@@ -702,6 +702,13 @@ ldif_import(EImport *ei, EImportTarget *target, EImportImporter *im)
return;
}
+ if (!e_book_is_writable (book)) {
+ g_message(G_STRLOC ":Book is readonly");
+ e_import_complete(ei, target);
+ g_object_unref(book);
+ return;
+ }
+
filename = g_filename_from_uri(s->uri_src, NULL, NULL);
if (filename != NULL) {
file = g_fopen(filename, "r");
diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c
index e4be880dea..6aebdbd49c 100644
--- a/addressbook/importers/evolution-vcard-importer.c
+++ b/addressbook/importers/evolution-vcard-importer.c
@@ -464,6 +464,13 @@ vcard_import(EImport *ei, EImportTarget *target, EImportImporter *im)
e_import_complete(ei, target);
return;
}
+
+ if (!e_book_is_writable (book)) {
+ g_message (G_STRLOC ":Book is readonly.");
+ e_import_complete(ei, target);
+ g_object_unref(book);
+ return;
+ }
if (!g_file_get_contents (s->uri_src+7, &contents, NULL, NULL)) {
g_message (G_STRLOC ":Couldn't read file.");