[evolution] Bug #656722 - Incorrect prototype of notify:: signal callback



commit cdf7dc43ec5a42ec9962223e54ec80ce678a807e
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 17 08:57:32 2011 +0200

    Bug #656722 - Incorrect prototype of notify:: signal callback

 addressbook/gui/contact-editor/e-contact-editor.c |    2 +-
 addressbook/gui/widgets/e-addressbook-model.c     |   30 +++++++-------------
 widgets/misc/e-contact-map-window.c               |    2 +-
 3 files changed, 13 insertions(+), 21 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c
index 3d76a40..5dd02b4 100644
--- a/addressbook/gui/contact-editor/e-contact-editor.c
+++ b/addressbook/gui/contact-editor/e-contact-editor.c
@@ -4253,7 +4253,7 @@ e_contact_editor_new (EShell *shell,
 }
 
 static void
-notify_readonly_cb (EBookClient *book_client, EContactEditor *ce)
+notify_readonly_cb (EBookClient *book_client, GParamSpec *pspec, EContactEditor *ce)
 {
 	gint new_target_editable;
 	gboolean changed = FALSE;
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 2a34ccf..dc1068d 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -52,7 +52,6 @@ struct _EAddressbookModelPrivate {
 
 	guint search_in_progress	: 1;
 	guint editable			: 1;
-	guint editable_set		: 1;
 	guint first_get_view		: 1;
 };
 
@@ -325,16 +324,10 @@ view_complete_cb (EBookClientView *client_view,
 
 static void
 readonly_cb (EBookClient *book_client,
+	     GParamSpec *pspec,
              EAddressbookModel *model)
 {
-	if (!model->priv->editable_set) {
-		model->priv->editable =
-			!e_client_is_readonly (E_CLIENT (book_client));
-
-		g_signal_emit (
-			model, signals[WRITABLE_STATUS], 0,
-			model->priv->editable);
-	}
+	e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client)));
 }
 
 static void
@@ -885,13 +878,7 @@ e_addressbook_model_set_client (EAddressbookModel *model,
 		book_client, "backend-died",
 		G_CALLBACK (backend_died_cb), model);
 
-	if (!model->priv->editable_set) {
-		model->priv->editable =
-			!e_client_is_readonly (E_CLIENT (book_client));
-		g_signal_emit (
-			model, signals[WRITABLE_STATUS], 0,
-			model->priv->editable);
-	}
+	e_addressbook_model_set_editable (model, !e_client_is_readonly (E_CLIENT (book_client)));
 
 	if (model->priv->client_view_idle_id == 0)
 		model->priv->client_view_idle_id = g_idle_add (
@@ -915,10 +902,15 @@ e_addressbook_model_set_editable (EAddressbookModel *model,
 {
 	g_return_if_fail (E_IS_ADDRESSBOOK_MODEL (model));
 
-	model->priv->editable = editable;
-	model->priv->editable_set = TRUE;
+	if ((model->priv->editable ? 1 : 0) != (editable ? 1 : 0)) {
+		model->priv->editable = editable;
 
-	g_object_notify (G_OBJECT (model), "editable");
+		g_signal_emit (
+			model, signals[WRITABLE_STATUS], 0,
+			model->priv->editable);
+
+		g_object_notify (G_OBJECT (model), "editable");
+	}
 }
 
 gchar *
diff --git a/widgets/misc/e-contact-map-window.c b/widgets/misc/e-contact-map-window.c
index 41570ee..2984d40 100644
--- a/widgets/misc/e-contact-map-window.c
+++ b/widgets/misc/e-contact-map-window.c
@@ -130,7 +130,7 @@ contact_map_window_zoom_out_cb (GtkButton *button,
 }
 static void
 zoom_level_changed_cb (ChamplainView *view,
-                       gint bzoom_level,
+                       GParamSpec *pspec,
                        gpointer user_data)
 {
 	EContactMapWindow *window = user_data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]