[gnome-photos/wip/foo: 2/13] organize-collection-model: Fold destroy into dispose



commit 11fc475beecc223900d8f6e434238dd5203f4b0e
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Mar 27 15:45:33 2013 +0100

    organize-collection-model: Fold destroy into dispose
    
    ... because that is the only place where it is supposed to be used.

 src/photos-organize-collection-model.c |   33 ++++++++++++-------------------
 src/photos-organize-collection-model.h |    2 -
 src/photos-organize-collection-view.c  |   11 +---------
 3 files changed, 14 insertions(+), 32 deletions(-)
---
diff --git a/src/photos-organize-collection-model.c b/src/photos-organize-collection-model.c
index 6e688e6..848adaa 100644
--- a/src/photos-organize-collection-model.c
+++ b/src/photos-organize-collection-model.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012 Red Hat, Inc.
+ * Copyright © 2012, 2013 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -59,6 +59,18 @@ photos_organize_collection_model_dispose (GObject *object)
   PhotosOrganizeCollectionModel *self = PHOTOS_ORGANIZE_COLLECTION_MODEL (object);
   PhotosOrganizeCollectionModelPrivate *priv = self->priv;
 
+  if (priv->coll_added_id != 0)
+    {
+      g_signal_handler_disconnect (priv->manager, priv->coll_added_id);
+      priv->coll_added_id = 0;
+    }
+
+  if (priv->coll_removed_id != 0)
+    {
+      g_signal_handler_disconnect (priv->manager, priv->coll_removed_id);
+      priv->coll_removed_id = 0;
+    }
+
   g_clear_object (&priv->manager);
 
   G_OBJECT_CLASS (photos_organize_collection_model_parent_class)->dispose (object);
@@ -149,25 +161,6 @@ photos_organize_collection_model_add_placeholder (PhotosOrganizeCollectionModel
 }
 
 
-void
-photos_organize_collection_model_destroy (PhotosOrganizeCollectionModel *self)
-{
-  PhotosOrganizeCollectionModelPrivate *priv = self->priv;
-
-  if (priv->coll_added_id != 0)
-    {
-      g_signal_handler_disconnect (priv->manager, priv->coll_added_id);
-      priv->coll_added_id = 0;
-    }
-
-  if (priv->coll_removed_id != 0)
-    {
-      g_signal_handler_disconnect (priv->manager, priv->coll_removed_id);
-      priv->coll_removed_id = 0;
-    }
-}
-
-
 GtkTreePath *
 photos_organize_collection_model_get_placeholder (PhotosOrganizeCollectionModel *self, gboolean forget)
 {
diff --git a/src/photos-organize-collection-model.h b/src/photos-organize-collection-model.h
index 22b046c..19cae93 100644
--- a/src/photos-organize-collection-model.h
+++ b/src/photos-organize-collection-model.h
@@ -89,8 +89,6 @@ GtkListStore     *photos_organize_collection_model_new                    (void)
 
 GtkTreePath      *photos_organize_collection_model_add_placeholder        (PhotosOrganizeCollectionModel 
*self);
 
-void              photos_organize_collection_model_destroy                (PhotosOrganizeCollectionModel 
*self);
-
 GtkTreePath      *photos_organize_collection_model_get_placeholder        (PhotosOrganizeCollectionModel 
*self,
                                                                            gboolean                       
forget);
 
diff --git a/src/photos-organize-collection-view.c b/src/photos-organize-collection-view.c
index f24af3b..5ae350e 100644
--- a/src/photos-organize-collection-view.c
+++ b/src/photos-organize-collection-view.c
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012 Red Hat, Inc.
+ * Copyright © 2012, 2013 Red Hat, Inc.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -99,14 +99,6 @@ photos_organize_collection_view_text_editing_canceled (GObject *object, GParamSp
 
 
 static void
-photos_organize_collection_view_destroy (GtkWidget *widget)
-{
-  PhotosOrganizeCollectionView *self = PHOTOS_ORGANIZE_COLLECTION_VIEW (widget);
-  photos_organize_collection_model_destroy (PHOTOS_ORGANIZE_COLLECTION_MODEL (self->priv->model));
-}
-
-
-static void
 photos_organize_collection_view_dispose (GObject *object)
 {
   PhotosOrganizeCollectionView *self = PHOTOS_ORGANIZE_COLLECTION_VIEW (object);
@@ -179,7 +171,6 @@ photos_organize_collection_view_class_init (PhotosOrganizeCollectionViewClass *c
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
 
   object_class->dispose = photos_organize_collection_view_dispose;
-  widget_class->destroy = photos_organize_collection_view_destroy;
 
   g_type_class_add_private (class, sizeof (PhotosOrganizeCollectionViewPrivate));
 }


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