aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorSushma Rai <rsushma@src.gnome.org>2005-08-03 16:34:02 +0800
committerSushma Rai <rsushma@src.gnome.org>2005-08-03 16:34:02 +0800
commit0c08ef49299caf0e6ae997451ba7a2d923931c42 (patch)
tree8a68fda2b4899b2b0114a282c7b8b7b75409d4e3 /addressbook/gui
parentf81882412a602d2b19746dda3d013926021890bd (diff)
downloadgsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar.gz
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar.bz2
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar.lz
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar.xz
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.tar.zst
gsoc2013-evolution-0c08ef49299caf0e6ae997451ba7a2d923931c42.zip
Not removing the contacts, if move fails because of destination address book
load/write error, and also if the move operation was cancelled on finding a duplicate contact. Fixes #311133, #273716. svn path=/trunk/; revision=29967
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 646887a8cd..85a4e8d0f8 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -628,6 +628,7 @@ typedef void (*ContactCopyDone) (ContactCopyProcess *process);
struct ContactCopyProcess_ {
int count;
+ gboolean book_status;
GList *contacts;
EBook *source;
EBook *destination;
@@ -654,9 +655,11 @@ do_delete (gpointer data, gpointer user_data)
static void
delete_contacts (ContactCopyProcess *process)
{
- g_list_foreach (process->contacts,
- do_delete,
- process->source);
+ if (process->book_status == TRUE) {
+ g_list_foreach (process->contacts,
+ do_delete,
+ process->source);
+ }
}
static void
@@ -680,10 +683,17 @@ contact_added_cb (EBook* book, EBookStatus status, const char *id, gpointer user
ContactCopyProcess *process = user_data;
if (status != E_BOOK_ERROR_OK && status != E_BOOK_ERROR_CANCELLED) {
+ process->book_status = FALSE;
eab_error_dialog (_("Error adding contact"), status);
- } else {
- process_unref (process);
+ }
+ else if (status == E_BOOK_ERROR_CANCELLED) {
+ process->book_status = FALSE;
}
+ else {
+ /* success */
+ process->book_status = TRUE;
+ }
+ process_unref (process);
}
static void
@@ -709,6 +719,7 @@ got_book_cb (EBook *book, EBookStatus status, gpointer closure)
process = closure;
if (status == E_BOOK_ERROR_OK) {
process->destination = book;
+ process->book_status = TRUE;
g_object_ref (book);
g_list_foreach (process->contacts,
do_copy,
@@ -757,6 +768,7 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de
process = g_new (ContactCopyProcess, 1);
process->count = 1;
+ process->book_status = FALSE;
process->source = source;
g_object_ref (source);
process->contacts = contacts;