[Commits] xml-plugin.c 1.11 1.12
miras at claws-mail.org
miras at claws-mail.org
Sat Apr 7 17:31:13 CEST 2012
Update of /home/claws-mail/contacts/plugins/xml
In directory srv:/tmp/cvs-serv31357/plugins/xml
Modified Files:
xml-plugin.c
Log Message:
2012-04-07 [mir] 0.6.0cvs84
* plugins/xml/xml-plugin.c
If no old address books are found stop
import process immediately.
Index: xml-plugin.c
===================================================================
RCS file: /home/claws-mail/contacts/plugins/xml/xml-plugin.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- xml-plugin.c 31 Dec 2011 00:39:16 -0000 1.11
+++ xml-plugin.c 7 Apr 2012 15:31:11 -0000 1.12
@@ -968,26 +968,28 @@
G_DIR_SEPARATOR_S,
old_abook_index_file(),
NULL);
- books = parse_index_file(index, error);
- g_free(index);
- if (*error) {
+ if (index) {
+ books = parse_index_file(index, error);
+ g_free(index);
+ if (*error) {
show_message(NULL, GTK_UTIL_MESSAGE_WARNING, "%s", *error);
return FALSE;
- }
- for (cur = books; cur; cur = g_slist_next(cur)) {
+ }
+ for (cur = books; cur; cur = g_slist_next(cur)) {
Attribute* attr = (Attribute *) cur->data;
abook = address_book_new();
abook->abook_name = g_strdup(attr->attr_name);
abook->URL = g_strconcat(
- old_abook_addr_dir(), G_DIR_SEPARATOR_S, attr->file, NULL);
+ old_abook_addr_dir(), G_DIR_SEPARATOR_S, attr->file, NULL);
open_addr_book(abook, error);
if (*error)
continue;
abook_get_images(abook);
abook_convert_uid(abook);
abooks = g_list_prepend(abooks, abook);
+ }
+ attribute_list_free(&books);
}
- attribute_list_free(&books);
}
else {
closed_books_remove(abook);
@@ -1004,8 +1006,9 @@
abook->dirty = FALSE;
}
abooks = g_list_prepend(abooks, abook);
- }
- abook->open = TRUE;
+ }
+ if (abook)
+ abook->open = TRUE;
return TRUE;
}
More information about the Commits
mailing list