[gnome-photos/wip/search: 20/22] col mngr: no singleton



commit 41775f6541a792c77852090fc74d76aa5a40ba9f
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 18 17:14:36 2014 +0100

    col mngr: no singleton

 src/photos-collection-manager.c |   24 +-----------------------
 src/photos-collection-manager.h |    4 ++--
 2 files changed, 3 insertions(+), 25 deletions(-)
---
diff --git a/src/photos-collection-manager.c b/src/photos-collection-manager.c
index bece01f..33276e7 100644
--- a/src/photos-collection-manager.c
+++ b/src/photos-collection-manager.c
@@ -47,26 +47,6 @@ photos_collection_manager_get_where (PhotosBaseManager *mngr, gint flags)
 }
 
 
-static GObject *
-photos_collection_manager_constructor (GType                  type,
-                                       guint                  n_construct_params,
-                                       GObjectConstructParam *construct_params)
-{
-  static GObject *self = NULL;
-
-  if (self == NULL)
-    {
-      self = G_OBJECT_CLASS (photos_collection_manager_parent_class)->constructor (type,
-                                                                                   n_construct_params,
-                                                                                   construct_params);
-      g_object_add_weak_pointer (self, (gpointer) &self);
-      return self;
-    }
-
-  return g_object_ref (self);
-}
-
-
 static void
 photos_collection_manager_init (PhotosCollectionManager *self)
 {
@@ -76,16 +56,14 @@ photos_collection_manager_init (PhotosCollectionManager *self)
 static void
 photos_collection_manager_class_init (PhotosCollectionManagerClass *class)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (class);
   PhotosBaseManagerClass *base_manager_class = PHOTOS_BASE_MANAGER_CLASS (class);
 
-  object_class->constructor = photos_collection_manager_constructor;
   base_manager_class->get_where = photos_collection_manager_get_where;
 }
 
 
 PhotosBaseManager *
-photos_collection_manager_dup_singleton (void)
+photos_collection_manager_new (void)
 {
   return g_object_new (PHOTOS_TYPE_COLLECTION_MANAGER, NULL);
 }
diff --git a/src/photos-collection-manager.h b/src/photos-collection-manager.h
index e8e5045..1336b5e 100644
--- a/src/photos-collection-manager.h
+++ b/src/photos-collection-manager.h
@@ -1,6 +1,6 @@
 /*
  * Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014 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
@@ -68,7 +68,7 @@ struct _PhotosCollectionManagerClass
 
 GType                     photos_collection_manager_get_type           (void) G_GNUC_CONST;
 
-PhotosBaseManager        *photos_collection_manager_dup_singleton      (void);
+PhotosBaseManager        *photos_collection_manager_new                (void);
 
 G_END_DECLS
 


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