aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-09 17:23:01 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2010-11-10 06:33:24 +0800
commite534a01e809e19e7ea1af4a9b19e005df2547012 (patch)
treed942696157494edac0c6d2cdb9c767897f56ea88 /addressbook
parent50784afa509b36d0089f1d6f5f0a5b25011797cd (diff)
downloadgsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar.gz
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar.bz2
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar.lz
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar.xz
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.tar.zst
gsoc2013-evolution-e534a01e809e19e7ea1af4a9b19e005df2547012.zip
Bug #632671 - "Search interrupted" status message forever
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c27
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c2
2 files changed, 28 insertions, 1 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 7fa827aa39..e6b24abe75 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -49,6 +49,7 @@ struct _EAddressbookModelPrivate {
gulong writable_status_id;
gulong view_complete_id;
gulong backend_died_id;
+ guint remove_status_id;
guint search_in_progress : 1;
guint editable : 1;
@@ -114,12 +115,15 @@ remove_book_view (EAddressbookModel *model)
g_signal_handler_disconnect (
model->priv->book_view,
model->priv->view_complete_id);
+ if (model->priv->remove_status_id)
+ g_source_remove (model->priv->remove_status_id);
model->priv->create_contact_id = 0;
model->priv->remove_contact_id = 0;
model->priv->modify_contact_id = 0;
model->priv->status_message_id = 0;
model->priv->view_complete_id = 0;
+ model->priv->remove_status_id = 0;
model->priv->search_in_progress = FALSE;
@@ -127,6 +131,8 @@ remove_book_view (EAddressbookModel *model)
e_book_view_stop (model->priv->book_view);
g_object_unref (model->priv->book_view);
model->priv->book_view = NULL;
+
+ g_signal_emit (model, signals[STATUS_MESSAGE], 0, NULL);
}
}
@@ -271,6 +277,10 @@ status_message (EBookView *book_view,
gchar * status,
EAddressbookModel *model)
{
+ if (model->priv->remove_status_id)
+ g_source_remove (model->priv->remove_status_id);
+ model->priv->remove_status_id = 0;
+
g_signal_emit (model, signals[STATUS_MESSAGE], 0, status);
}
@@ -394,6 +404,20 @@ addressbook_model_idle_cb (EAddressbookModel *model)
return FALSE;
}
+static gboolean
+remove_status_cb (gpointer data)
+{
+ EAddressbookModel *model = data;
+
+ g_return_val_if_fail (model != NULL, FALSE);
+ g_return_val_if_fail (E_IS_ADDRESSBOOK_MODEL (model), FALSE);
+
+ g_signal_emit (model, signals[STATUS_MESSAGE], 0, NULL);
+ model->priv->remove_status_id = 0;
+
+ return FALSE;
+}
+
static void
addressbook_model_set_property (GObject *object,
guint property_id,
@@ -716,6 +740,9 @@ e_addressbook_model_stop (EAddressbookModel *model)
message = _("Search Interrupted");
g_signal_emit (model, signals[STOP_STATE_CHANGED], 0);
g_signal_emit (model, signals[STATUS_MESSAGE], 0, message);
+
+ if (!model->priv->remove_status_id)
+ model->priv->remove_status_id = g_timeout_add_seconds (3, remove_status_cb, model);
}
gboolean
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index fcf4dd3f7c..bb5fc15bb8 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -1075,9 +1075,9 @@ status_message (EAddressbookView *view,
if (status == NULL || *status == '\0') {
if (activity != NULL) {
+ view->priv->activity = NULL;
e_activity_set_state (activity, E_ACTIVITY_COMPLETED);
g_object_unref (activity);
- view->priv->activity = NULL;
}
} else if (activity == NULL) {