aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-07-18 03:02:03 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-07-18 03:02:03 +0800
commitec790f576119e171ba9b77dd6f7bfcf7a42ebeb1 (patch)
treee584d3de2d6957fefc68112446fd0364b34487d8
parentda665f8f99e778263d0a411def22830b2bcaa647 (diff)
downloadgsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar.gz
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar.bz2
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar.lz
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar.xz
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.tar.zst
gsoc2013-evolution-ec790f576119e171ba9b77dd6f7bfcf7a42ebeb1.zip
Bug 579702 – Contact changes not shown until restart
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c6
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.h2
-rw-r--r--modules/addressbook/e-book-shell-view-private.c18
-rw-r--r--modules/addressbook/e-book-shell-view-private.h2
4 files changed, 18 insertions, 10 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index b68763c805..7ae371d411 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -250,7 +250,7 @@ modify_contact(EBookView *book_view,
array->pdata[ii] = contact;
g_signal_emit (
- model, signals[CONTACT_CHANGED], 0, contact);
+ model, signals[CONTACT_CHANGED], 0, ii);
break;
}
@@ -607,8 +607,8 @@ addressbook_model_class_init (EAddressbookModelClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EAddressbookModelClass, contact_changed),
NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, E_TYPE_CONTACT);
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1, G_TYPE_INT);
signals[MODEL_CHANGED] =
g_signal_new ("model_changed",
diff --git a/addressbook/gui/widgets/e-addressbook-model.h b/addressbook/gui/widgets/e-addressbook-model.h
index d17a8f38a7..b42de48dbc 100644
--- a/addressbook/gui/widgets/e-addressbook-model.h
+++ b/addressbook/gui/widgets/e-addressbook-model.h
@@ -74,7 +74,7 @@ struct _EAddressbookModelClass {
void (*contacts_removed) (EAddressbookModel *model,
gpointer id_list);
void (*contact_changed) (EAddressbookModel *model,
- EContact *contact);
+ gint index);
void (*model_changed) (EAddressbookModel *model);
void (*stop_state_changed) (EAddressbookModel *model);
void (*backend_died) (EAddressbookModel *model);
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index 95e4980c57..f930e6d478 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -90,6 +90,7 @@ book_shell_view_selection_change_foreach (gint row,
contact = e_addressbook_model_get_contact (model, row);
e_book_shell_content_set_preview_contact (book_shell_content, contact);
+ book_shell_view->priv->preview_index = row;
}
static void
@@ -121,24 +122,26 @@ selection_change (EBookShellView *book_shell_view,
selection_model, (EForeachFunc)
book_shell_view_selection_change_foreach,
book_shell_view);
- else
+ else {
e_book_shell_content_set_preview_contact (
book_shell_content, NULL);
+ book_shell_view->priv->preview_index = -1;
+ }
}
static void
contact_changed (EBookShellView *book_shell_view,
- EContact *contact)
+ gint index,
+ EAddressbookModel *model)
{
EBookShellContent *book_shell_content;
- EContact *preview_contact;
+ EContact *contact;
book_shell_content = book_shell_view->priv->book_shell_content;
- preview_contact =
- e_book_shell_content_get_preview_contact (book_shell_content);
+ contact = e_addressbook_model_contact_at (model, index);
- if (contact != preview_contact)
+ if (book_shell_view->priv->preview_index != index)
return;
/* Re-render the same contact. */
@@ -167,6 +170,7 @@ contacts_removed (EBookShellView *book_shell_view,
/* If not, clear the contact display. */
e_book_shell_content_set_preview_contact (book_shell_content, NULL);
+ book_shell_view->priv->preview_index = -1;
}
static void
@@ -422,6 +426,7 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view,
priv->uid_to_view = uid_to_view;
priv->uid_to_editor = uid_to_editor;
+ priv->preview_index = -1;
if (!gal_view_collection_loaded (shell_view_class->view_collection))
book_shell_view_load_view_collection (shell_view_class);
@@ -615,6 +620,7 @@ e_book_shell_view_execute_search (EBookShellView *book_shell_view)
g_free (query);
e_book_shell_content_set_preview_contact (book_shell_content, NULL);
+ book_shell_view->priv->preview_index = -1;
}
void
diff --git a/modules/addressbook/e-book-shell-view-private.h b/modules/addressbook/e-book-shell-view-private.h
index b4701aea81..b49677680f 100644
--- a/modules/addressbook/e-book-shell-view-private.h
+++ b/modules/addressbook/e-book-shell-view-private.h
@@ -100,6 +100,8 @@ struct _EBookShellViewPrivate {
GHashTable *uid_to_view;
GHashTable *uid_to_editor;
+
+ gint preview_index;
};
void e_book_shell_view_private_init