[gnome-photos/wip/search: 21/22] src mngr: no singleton



commit fa5124dca75be5641c5ad525f587a038f9be9019
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 18 17:14:53 2014 +0100

    src mngr: no singleton

 src/photos-source-manager.c |   23 +----------------------
 src/photos-source-manager.h |    4 ++--
 2 files changed, 3 insertions(+), 24 deletions(-)
---
diff --git a/src/photos-source-manager.c b/src/photos-source-manager.c
index 6ca8d7b..54bbc66 100644
--- a/src/photos-source-manager.c
+++ b/src/photos-source-manager.c
@@ -107,26 +107,6 @@ photos_source_manager_refresh_accounts (PhotosSourceManager *self)
 }
 
 
-static GObject *
-photos_source_manager_constructor (GType                  type,
-                                   guint                  n_construct_params,
-                                   GObjectConstructParam *construct_params)
-{
-  static GObject *self = NULL;
-
-  if (self == NULL)
-    {
-      self = G_OBJECT_CLASS (photos_source_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_source_manager_dispose (GObject *object)
 {
@@ -183,14 +163,13 @@ photos_source_manager_class_init (PhotosSourceManagerClass *class)
   GObjectClass *object_class = G_OBJECT_CLASS (class);
   PhotosBaseManagerClass *base_manager_class = PHOTOS_BASE_MANAGER_CLASS (class);
 
-  object_class->constructor = photos_source_manager_constructor;
   object_class->dispose = photos_source_manager_dispose;
   base_manager_class->get_filter = photos_source_manager_get_filter;
 }
 
 
 PhotosBaseManager *
-photos_source_manager_dup_singleton (void)
+photos_source_manager_new (void)
 {
   return g_object_new (PHOTOS_TYPE_SOURCE_MANAGER, "title", _("Sources"), NULL);
 }
diff --git a/src/photos-source-manager.h b/src/photos-source-manager.h
index 4dff9ac..e764ee8 100644
--- a/src/photos-source-manager.h
+++ b/src/photos-source-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 _PhotosSourceManagerClass
 
 GType                     photos_source_manager_get_type           (void) G_GNUC_CONST;
 
-PhotosBaseManager        *photos_source_manager_dup_singleton      (void);
+PhotosBaseManager        *photos_source_manager_new                (void);
 
 GList                    *photos_source_manager_get_for_provider_type (PhotosSourceManager *self,
                                                                        const gchar *provider_type);


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