aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-05 09:21:28 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-05 09:21:28 +0800
commit0d327d6fc33813fcc06ae52b10cb74c7b0421acd (patch)
treea7ce0e0329996a99abb140dd4b4f49197b2f4934
parentab9a56f51b6c836884eb1fd7d8864807e6c5ed40 (diff)
downloadgsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.gz
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.bz2
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.lz
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.xz
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.tar.zst
gsoc2013-evolution-0d327d6fc33813fcc06ae52b10cb74c7b0421acd.zip
Fixed some referencing and lifetime issues.
2000-04-04 Christopher James Lahey <clahey@helixcode.com> * widgets/e-minicard/e-minicard.c: Fixed some referencing and lifetime issues. From widgets/e-table: 2000-04-04 Christopher James Lahey <clahey@helixcode.com> * e-table-text-model.c: Make this assert a bit more readable. * e-table-item.c: Fix update loop behavior. svn path=/trunk/; revision=2291
-rw-r--r--ChangeLog5
-rw-r--r--addressbook/gui/minicard/e-minicard.c24
-rw-r--r--addressbook/gui/widgets/e-minicard.c24
-rw-r--r--widgets/e-minicard/e-minicard.c24
-rw-r--r--widgets/e-table/ChangeLog6
-rw-r--r--widgets/e-table/e-table-item.c4
-rw-r--r--widgets/e-table/e-table-text-model.c5
-rw-r--r--widgets/table/e-table-item.c4
-rw-r--r--widgets/table/e-table-text-model.c5
-rw-r--r--widgets/text/e-table-text-model.c5
10 files changed, 95 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 82237a5626..324b91fe68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2000-04-04 Christopher James Lahey <clahey@helixcode.com>
+ * widgets/e-minicard/e-minicard.c: Fixed some referencing and
+ lifetime issues.
+
+2000-04-04 Christopher James Lahey <clahey@helixcode.com>
+
* widgets/e-text/e-text.c: Removed an unnecessary get_bounds call.
(From a patch by Iain Holmes <ih@csd.abdn.ac.uk>)
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index b7b9a4c10e..2a98a574c7 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/e-minicard.c
@@ -32,6 +32,7 @@ static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -104,7 +105,7 @@ e_minicard_class_init (EMinicardClass *klass)
object_class->set_arg = e_minicard_set_arg;
object_class->get_arg = e_minicard_get_arg;
- /* object_class->destroy = e_minicard_destroy; */
+ object_class->destroy = e_minicard_destroy;
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
@@ -168,7 +169,11 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gnome_canvas_item_request_update (item);*/
break;
case ARG_MODEL:
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
e_minicard->model = E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg));
+ if (e_minicard->model)
+ gtk_object_ref (e_minicard->model);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
break;
@@ -213,6 +218,23 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
static void
+e_minicard_destroy (GtkObject *object)
+{
+ EMinicard *e_minicard;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_MINICARD (object));
+
+ e_minicard = E_MINICARD (object);
+
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index b7b9a4c10e..2a98a574c7 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -32,6 +32,7 @@ static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -104,7 +105,7 @@ e_minicard_class_init (EMinicardClass *klass)
object_class->set_arg = e_minicard_set_arg;
object_class->get_arg = e_minicard_get_arg;
- /* object_class->destroy = e_minicard_destroy; */
+ object_class->destroy = e_minicard_destroy;
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
@@ -168,7 +169,11 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gnome_canvas_item_request_update (item);*/
break;
case ARG_MODEL:
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
e_minicard->model = E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg));
+ if (e_minicard->model)
+ gtk_object_ref (e_minicard->model);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
break;
@@ -213,6 +218,23 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
static void
+e_minicard_destroy (GtkObject *object)
+{
+ EMinicard *e_minicard;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_MINICARD (object));
+
+ e_minicard = E_MINICARD (object);
+
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;
diff --git a/widgets/e-minicard/e-minicard.c b/widgets/e-minicard/e-minicard.c
index b7b9a4c10e..2a98a574c7 100644
--- a/widgets/e-minicard/e-minicard.c
+++ b/widgets/e-minicard/e-minicard.c
@@ -32,6 +32,7 @@ static void e_minicard_init (EMinicard *card);
static void e_minicard_class_init (EMinicardClass *klass);
static void e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id);
static void e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id);
+static void e_minicard_destroy (GtkObject *object);
static gboolean e_minicard_event (GnomeCanvasItem *item, GdkEvent *event);
static void e_minicard_realize (GnomeCanvasItem *item);
static void e_minicard_unrealize (GnomeCanvasItem *item);
@@ -104,7 +105,7 @@ e_minicard_class_init (EMinicardClass *klass)
object_class->set_arg = e_minicard_set_arg;
object_class->get_arg = e_minicard_get_arg;
- /* object_class->destroy = e_minicard_destroy; */
+ object_class->destroy = e_minicard_destroy;
/* GnomeCanvasItem method overrides */
item_class->realize = e_minicard_realize;
@@ -168,7 +169,11 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
gnome_canvas_item_request_update (item);*/
break;
case ARG_MODEL:
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
e_minicard->model = E_TABLE_MODEL(GTK_VALUE_OBJECT (*arg));
+ if (e_minicard->model)
+ gtk_object_ref (e_minicard->model);
remodel(e_minicard);
e_canvas_item_request_reflow(item);
break;
@@ -213,6 +218,23 @@ e_minicard_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
}
static void
+e_minicard_destroy (GtkObject *object)
+{
+ EMinicard *e_minicard;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (E_IS_MINICARD (object));
+
+ e_minicard = E_MINICARD (object);
+
+ if (e_minicard->model)
+ gtk_object_unref (e_minicard->model);
+
+ if (GTK_OBJECT_CLASS (parent_class)->destroy)
+ (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+}
+
+static void
e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 4d9b7308b1..c91bb0040a 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,9 @@
+2000-04-04 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-table-text-model.c: Make this assert a bit more readable.
+
+ * e-table-item.c: Fix update loop behavior.
+
2000-03-30 Miguel de Icaza <miguel@gnu.org>
* Makefile.am (EXTRA_DIST): Added Glade files to the
diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c
index 2640e2913f..3e1af6b5b1 100644
--- a/widgets/e-table/e-table-item.c
+++ b/widgets/e-table/e-table-item.c
@@ -198,8 +198,10 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
if (item->x1 != o1.x ||
item->y1 != o1.y ||
item->x2 != o2.x ||
- item->y2 != o2.y)
+ item->y2 != o2.y) {
+ gnome_canvas_request_redraw (item->canvas, o1.x, o1.y, o2.x, o2.y);
eti->needs_redraw = 1;
+ }
if (eti->needs_redraw) {
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1,
diff --git a/widgets/e-table/e-table-text-model.c b/widgets/e-table/e-table-text-model.c
index c047c75ae3..5b6fa8b707 100644
--- a/widgets/e-table/e-table-text-model.c
+++ b/widgets/e-table/e-table-text-model.c
@@ -108,9 +108,10 @@ e_table_text_model_destroy (GtkObject *object)
g_return_if_fail (E_IS_TABLE_TEXT_MODEL (object));
model = E_TABLE_TEXT_MODEL (object);
-
- g_assert (!model->model || GTK_IS_OBJECT (model->model));
+ if (model->model)
+ g_assert (GTK_IS_OBJECT (model->model));
+
if (model->cell_changed_signal_id)
gtk_signal_disconnect (GTK_OBJECT(model->model),
model->cell_changed_signal_id);
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 2640e2913f..3e1af6b5b1 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -198,8 +198,10 @@ eti_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags)
if (item->x1 != o1.x ||
item->y1 != o1.y ||
item->x2 != o2.x ||
- item->y2 != o2.y)
+ item->y2 != o2.y) {
+ gnome_canvas_request_redraw (item->canvas, o1.x, o1.y, o2.x, o2.y);
eti->needs_redraw = 1;
+ }
if (eti->needs_redraw) {
gnome_canvas_request_redraw (item->canvas, item->x1, item->y1,
diff --git a/widgets/table/e-table-text-model.c b/widgets/table/e-table-text-model.c
index c047c75ae3..5b6fa8b707 100644
--- a/widgets/table/e-table-text-model.c
+++ b/widgets/table/e-table-text-model.c
@@ -108,9 +108,10 @@ e_table_text_model_destroy (GtkObject *object)
g_return_if_fail (E_IS_TABLE_TEXT_MODEL (object));
model = E_TABLE_TEXT_MODEL (object);
-
- g_assert (!model->model || GTK_IS_OBJECT (model->model));
+ if (model->model)
+ g_assert (GTK_IS_OBJECT (model->model));
+
if (model->cell_changed_signal_id)
gtk_signal_disconnect (GTK_OBJECT(model->model),
model->cell_changed_signal_id);
diff --git a/widgets/text/e-table-text-model.c b/widgets/text/e-table-text-model.c
index c047c75ae3..5b6fa8b707 100644
--- a/widgets/text/e-table-text-model.c
+++ b/widgets/text/e-table-text-model.c
@@ -108,9 +108,10 @@ e_table_text_model_destroy (GtkObject *object)
g_return_if_fail (E_IS_TABLE_TEXT_MODEL (object));
model = E_TABLE_TEXT_MODEL (object);
-
- g_assert (!model->model || GTK_IS_OBJECT (model->model));
+ if (model->model)
+ g_assert (GTK_IS_OBJECT (model->model));
+
if (model->cell_changed_signal_id)
gtk_signal_disconnect (GTK_OBJECT(model->model),
model->cell_changed_signal_id);