Commit 12725fb4 authored by Emanuele Aina's avatar Emanuele Aina Committed by Debarshi Ray

Rename all singleton public constructors to _dup_singleton()

Using _dup_singleton() instead of _new() makes more clear that we're not
really allocating a new object, but just taking a reference to an
already existing one.

https://bugzilla.gnome.org/show_bug.cgi?id=703280
parent 117ee07f
......@@ -421,15 +421,15 @@ photos_application_startup (GApplication *application)
NULL,
NULL);
priv->item_mngr = photos_item_manager_new ();
priv->src_mngr = photos_source_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->src_mngr = photos_source_manager_dup_singleton ();
/* A dummy reference to keep it alive during the lifetime of the
* application.
*/
priv->camera_cache = photos_camera_cache_new ();
priv->camera_cache = photos_camera_cache_dup_singleton ();
priv->mode_cntrlr = photos_mode_controller_new ();
priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
action = g_simple_action_new ("about", NULL);
g_signal_connect_swapped (action, "activate", G_CALLBACK (photos_main_window_show_about), priv->main_window);
......
......@@ -896,7 +896,7 @@ photos_base_item_init (PhotosBaseItem *self)
g_mutex_init (&priv->mutex_download);
g_mutex_init (&priv->mutex);
priv->sel_cntrlr = photos_selection_controller_new ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
}
......
......@@ -155,7 +155,7 @@ photos_camera_cache_init (PhotosCameraCache *self)
priv = self->priv;
priv->cache = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free);
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......@@ -171,7 +171,7 @@ photos_camera_cache_class_init (PhotosCameraCacheClass *class)
PhotosCameraCache *
photos_camera_cache_new (void)
photos_camera_cache_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_CAMERA_CACHE, NULL);
}
......
......@@ -65,7 +65,7 @@ struct _PhotosCameraCacheClass
GType photos_camera_cache_get_type (void) G_GNUC_CONST;
PhotosCameraCache *photos_camera_cache_new (void);
PhotosCameraCache *photos_camera_cache_dup_singleton (void);
void photos_camera_cache_get_camera_async (PhotosCameraCache *self,
GQuark id,
......
......@@ -387,8 +387,8 @@ photos_collection_icon_watcher_init (PhotosCollectionIconWatcher *self)
priv = self->priv;
priv->item_connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
priv->item_mngr = photos_item_manager_new ();
priv->queue = photos_tracker_queue_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -69,7 +69,7 @@ photos_collection_manager_class_init (PhotosCollectionManagerClass *class)
PhotosBaseManager *
photos_collection_manager_new (void)
photos_collection_manager_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_COLLECTION_MANAGER, NULL);
}
......
......@@ -68,7 +68,7 @@ struct _PhotosCollectionManagerClass
GType photos_collection_manager_get_type (void) G_GNUC_CONST;
PhotosBaseManager *photos_collection_manager_new (void);
PhotosBaseManager *photos_collection_manager_dup_singleton (void);
gchar *photos_collection_manager_get_where (PhotosCollectionManager *self);
......
......@@ -157,7 +157,7 @@ photos_create_collection_job_init (PhotosCreateCollectionJob *self)
self->priv = photos_create_collection_job_get_instance_private (self);
priv = self->priv;
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -123,7 +123,7 @@ photos_delete_item_job_init (PhotosDeleteItemJob *self)
self->priv = photos_delete_item_job_get_instance_private (self);
priv = self->priv;
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -227,10 +227,10 @@ photos_dlna_renderers_dialog_init (PhotosDlnaRenderersDialog *self)
PHOTOS_TYPE_DLNA_RENDERERS_DIALOG,
PhotosDlnaRenderersDialogPrivate);
priv = self->priv;
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->renderers_mngr = photos_dlna_renderers_manager_dup_singleton ();
priv->remote_mngr = photos_remote_display_manager_dup_singleton ();
priv->mode_cntrlr = photos_mode_controller_new ();
priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
gtk_widget_init_template (GTK_WIDGET (self));
......
......@@ -492,7 +492,7 @@ photos_embed_init (PhotosEmbed *self)
priv->toolbar = photos_main_toolbar_new ();
photos_main_toolbar_set_stack (PHOTOS_MAIN_TOOLBAR (priv->toolbar), GTK_STACK (priv->stack));
priv->ntfctn_mngr = g_object_ref_sink (photos_notification_manager_new ());
priv->ntfctn_mngr = g_object_ref_sink (photos_notification_manager_dup_singleton ());
gtk_overlay_add_overlay (GTK_OVERLAY (priv->stack_overlay), priv->ntfctn_mngr);
priv->indexing_ntfctn = g_object_ref_sink (photos_indexing_notification_new ());
......@@ -525,7 +525,7 @@ photos_embed_init (PhotosEmbed *self)
G_CALLBACK (photos_embed_notify_visible_child),
self, G_CONNECT_SWAPPED);
priv->mode_cntrlr = photos_mode_controller_new ();
priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
g_signal_connect (priv->mode_cntrlr,
"window-mode-changed",
G_CALLBACK (photos_embed_window_mode_changed),
......@@ -535,23 +535,23 @@ photos_embed_init (PhotosEmbed *self)
G_CALLBACK (photos_embed_fullscreen_changed),
self);
priv->trk_ovrvw_cntrlr = photos_tracker_overview_controller_new ();
priv->trk_ovrvw_cntrlr = photos_tracker_overview_controller_dup_singleton ();
g_signal_connect_swapped (priv->trk_ovrvw_cntrlr, "query-error", G_CALLBACK (photos_embed_query_error), self);
g_signal_connect (priv->trk_ovrvw_cntrlr,
"query-status-changed",
G_CALLBACK (photos_embed_query_status_changed),
self);
priv->offset_cntrlr = photos_offset_overview_controller_new ();
priv->offset_cntrlr = photos_offset_overview_controller_dup_singleton ();
g_signal_connect_swapped (priv->offset_cntrlr, "count-changed", G_CALLBACK (photos_embed_count_changed), self);
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
g_signal_connect (priv->item_mngr, "active-changed", G_CALLBACK (photos_embed_active_changed), self);
querying = photos_tracker_controller_get_query_status (priv->trk_ovrvw_cntrlr);
photos_embed_query_status_changed (priv->trk_ovrvw_cntrlr, querying, self);
priv->monitor = photos_tracker_change_monitor_new ();
priv->monitor = photos_tracker_change_monitor_dup_singleton ();
gtk_widget_show (GTK_WIDGET (self));
}
......
......@@ -226,10 +226,10 @@ photos_fetch_collection_state_job_init (PhotosFetchCollectionStateJob *self)
g_free,
photos_fetch_collection_state_job_value_destroy_func);
priv->col_mngr = photos_collection_manager_new ();
priv->item_mngr = photos_item_manager_new ();
priv->sel_cntrlr = photos_selection_controller_new ();
priv->queue = photos_tracker_queue_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -179,7 +179,7 @@ photos_fetch_collections_job_init (PhotosFetchCollectionsJob *self)
self->priv = photos_fetch_collections_job_get_instance_private (self);
priv = self->priv;
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -342,7 +342,7 @@ photos_flickr_item_init (PhotosFlickrItem *self)
self->priv = photos_flickr_item_get_instance_private (self);
priv = self->priv;
priv->src_mngr = photos_source_manager_new ();
priv->src_mngr = photos_source_manager_dup_singleton ();
}
......
......@@ -154,7 +154,7 @@ photos_indexing_notification_init (PhotosIndexingNotification *self)
return;
}
priv->ntfctn_mngr = g_object_ref_sink (photos_notification_manager_new ());
priv->ntfctn_mngr = g_object_ref_sink (photos_notification_manager_dup_singleton ());
priv->spinner = gtk_spinner_new ();
gtk_widget_set_size_request (priv->spinner, 16, 16);
......
......@@ -208,9 +208,9 @@ photos_item_manager_init (PhotosItemManager *self)
priv = self->priv;
priv->collection_path = g_queue_new ();
priv->col_mngr = photos_collection_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->monitor = photos_tracker_change_monitor_new ();
priv->monitor = photos_tracker_change_monitor_dup_singleton ();
g_signal_connect (priv->monitor, "changes-pending", G_CALLBACK (photos_item_manager_changes_pending), self);
}
......@@ -228,7 +228,7 @@ photos_item_manager_class_init (PhotosItemManagerClass *class)
PhotosBaseManager *
photos_item_manager_new (void)
photos_item_manager_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_ITEM_MANAGER, NULL);
}
......
......@@ -72,7 +72,7 @@ struct _PhotosItemManagerClass
GType photos_item_manager_get_type (void) G_GNUC_CONST;
PhotosBaseManager *photos_item_manager_new (void);
PhotosBaseManager *photos_item_manager_dup_singleton (void);
void photos_item_manager_activate_previous_collection (PhotosItemManager *self);
......
......@@ -102,15 +102,15 @@ photos_load_more_button_constructed (GObject *object)
switch (priv->mode)
{
case PHOTOS_WINDOW_MODE_COLLECTIONS:
priv->offset_cntrlr = photos_offset_collections_controller_new ();
priv->offset_cntrlr = photos_offset_collections_controller_dup_singleton ();
break;
case PHOTOS_WINDOW_MODE_FAVORITES:
priv->offset_cntrlr = photos_offset_favorites_controller_new ();
priv->offset_cntrlr = photos_offset_favorites_controller_dup_singleton ();
break;
case PHOTOS_WINDOW_MODE_OVERVIEW:
priv->offset_cntrlr = photos_offset_overview_controller_new ();
priv->offset_cntrlr = photos_offset_overview_controller_dup_singleton ();
break;
default:
......
......@@ -615,17 +615,17 @@ photos_main_toolbar_init (PhotosMainToolbar *self)
photos_header_bar_set_selection_menu (PHOTOS_HEADER_BAR (priv->toolbar),
GD_HEADER_BUTTON (priv->selection_menu));
priv->col_mngr = photos_collection_manager_new ();
priv->item_mngr = photos_item_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->src_mngr = photos_source_manager_new ();
priv->src_mngr = photos_source_manager_dup_singleton ();
g_signal_connect_object (priv->src_mngr,
"active-changed",
G_CALLBACK (photos_main_toolbar_set_toolbar_title),
self,
G_CONNECT_SWAPPED);
priv->mode_cntrlr = photos_mode_controller_new ();
priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
priv->old_mode = PHOTOS_WINDOW_MODE_NONE;
g_signal_connect_object (priv->mode_cntrlr,
"window-mode-changed",
......@@ -633,7 +633,7 @@ photos_main_toolbar_init (PhotosMainToolbar *self)
self,
G_CONNECT_SWAPPED);
priv->sel_cntrlr = photos_selection_controller_new ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
g_signal_connect_object (priv->sel_cntrlr,
"selection-mode-changed",
G_CALLBACK (photos_main_toolbar_reset_toolbar_mode),
......
......@@ -272,9 +272,9 @@ photos_main_window_init (PhotosMainWindow *self)
if (maximized)
gtk_window_maximize (GTK_WINDOW (self));
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->controller = photos_mode_controller_new ();
priv->controller = photos_mode_controller_dup_singleton ();
g_signal_connect (priv->controller,
"fullscreen-changed",
G_CALLBACK (photos_main_window_fullscreen_changed),
......
......@@ -132,7 +132,7 @@ photos_mode_controller_class_init (PhotosModeControllerClass *class)
PhotosModeController *
photos_mode_controller_new (void)
photos_mode_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_MODE_CONTROLLER, NULL);
}
......
......@@ -81,7 +81,7 @@ struct _PhotosModeControllerClass
GType photos_mode_controller_get_type (void) G_GNUC_CONST;
PhotosModeController *photos_mode_controller_new (void);
PhotosModeController *photos_mode_controller_dup_singleton (void);
PhotosWindowMode photos_mode_controller_get_can_fullscreen (PhotosModeController *self);
......
......@@ -106,7 +106,7 @@ photos_notification_manager_class_init (PhotosNotificationManagerClass *class)
GtkWidget *
photos_notification_manager_new (void)
photos_notification_manager_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_NOTIFICATION_MANAGER, "show-close-button", FALSE, "timeout", -1, NULL);
}
......
......@@ -68,7 +68,7 @@ struct _PhotosNotificationManagerClass
GType photos_notification_manager_get_type (void) G_GNUC_CONST;
GtkWidget *photos_notification_manager_new (void);
GtkWidget *photos_notification_manager_dup_singleton (void);
void photos_notification_manager_add_notification (PhotosNotificationManager *self,
GtkWidget *notification);
......
......@@ -97,7 +97,7 @@ photos_offset_collections_controller_init (PhotosOffsetCollectionsController *se
self->priv = photos_offset_collections_controller_get_instance_private (self);
priv = self->priv;
priv->col_mngr = photos_collection_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
}
......@@ -114,7 +114,7 @@ photos_offset_collections_controller_class_init (PhotosOffsetCollectionsControll
PhotosOffsetController *
photos_offset_collections_controller_new (void)
photos_offset_collections_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, NULL);
}
......@@ -68,7 +68,7 @@ struct _PhotosOffsetCollectionsControllerClass
GType photos_offset_collections_controller_get_type (void) G_GNUC_CONST;
PhotosOffsetController *photos_offset_collections_controller_new (void);
PhotosOffsetController *photos_offset_collections_controller_dup_singleton (void);
G_END_DECLS
......
......@@ -119,7 +119,7 @@ photos_offset_controller_init (PhotosOffsetController *self)
self->priv = photos_offset_controller_get_instance_private (self);
priv = self->priv;
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -97,7 +97,7 @@ photos_offset_favorites_controller_init (PhotosOffsetFavoritesController *self)
self->priv = photos_offset_favorites_controller_get_instance_private (self);
priv = self->priv;
priv->col_mngr = photos_collection_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
}
......@@ -114,7 +114,7 @@ photos_offset_favorites_controller_class_init (PhotosOffsetFavoritesControllerCl
PhotosOffsetController *
photos_offset_favorites_controller_new (void)
photos_offset_favorites_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_OFFSET_FAVORITES_CONTROLLER, NULL);
}
......@@ -68,7 +68,7 @@ struct _PhotosOffsetFavoritesControllerClass
GType photos_offset_favorites_controller_get_type (void) G_GNUC_CONST;
PhotosOffsetController *photos_offset_favorites_controller_new (void);
PhotosOffsetController *photos_offset_favorites_controller_dup_singleton (void);
G_END_DECLS
......
......@@ -77,7 +77,7 @@ photos_offset_overview_controller_class_init (PhotosOffsetOverviewControllerClas
PhotosOffsetController *
photos_offset_overview_controller_new (void)
photos_offset_overview_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_OFFSET_OVERVIEW_CONTROLLER, NULL);
}
......@@ -66,7 +66,7 @@ struct _PhotosOffsetOverviewControllerClass
GType photos_offset_overview_controller_get_type (void) G_GNUC_CONST;
PhotosOffsetController *photos_offset_overview_controller_new (void);
PhotosOffsetController *photos_offset_overview_controller_dup_singleton (void);
G_END_DECLS
......
......@@ -203,7 +203,7 @@ photos_organize_collection_model_init (PhotosOrganizeCollectionModel *self)
gtk_list_store_set_column_types (GTK_LIST_STORE (self), sizeof (columns) / sizeof (columns[0]), columns);
priv->manager = photos_collection_manager_new ();
priv->manager = photos_collection_manager_dup_singleton ();
g_signal_connect_object (priv->manager,
"object-added",
......
......@@ -328,8 +328,8 @@ photos_organize_collection_view_init (PhotosOrganizeCollectionView *self)
self,
NULL);
priv->col_mngr = photos_collection_manager_new ();
priv->src_mngr = photos_source_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
priv->src_mngr = photos_source_manager_dup_singleton ();
gtk_widget_show (GTK_WIDGET (self));
}
......
......@@ -488,7 +488,7 @@ photos_preview_nav_buttons_init (PhotosPreviewNavButtons *self)
self->priv = photos_preview_nav_buttons_get_instance_private (self);
priv = self->priv;
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
g_signal_connect_swapped (priv->item_mngr,
"active-changed",
G_CALLBACK (photos_preview_nav_buttons_active_changed),
......
......@@ -188,7 +188,7 @@ photos_preview_view_init (PhotosPreviewView *self)
self->priv = photos_preview_view_get_instance_private (self);
priv = self->priv;
priv->mode_cntrlr = photos_mode_controller_new ();
priv->mode_cntrlr = photos_mode_controller_dup_singleton ();
g_signal_connect_swapped (priv->mode_cntrlr,
"window-mode-changed",
G_CALLBACK (photos_preview_view_window_mode_changed),
......
......@@ -602,8 +602,8 @@ photos_properties_dialog_init (PhotosPropertiesDialog *self)
priv = self->priv;
priv->cancellable = g_cancellable_new ();
priv->item_mngr = photos_item_manager_new ();
priv->camera_cache = photos_camera_cache_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->camera_cache = photos_camera_cache_dup_singleton ();
gtk_dialog_add_button (GTK_DIALOG (self), _("Done"), GTK_RESPONSE_OK);
gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
......
......@@ -59,7 +59,7 @@ photos_query_builder_set_search_type (gint flags)
{
PhotosBaseManager *srch_typ_mngr;
srch_typ_mngr = photos_search_type_manager_new ();
srch_typ_mngr = photos_search_type_manager_dup_singleton ();
if (flags & PHOTOS_QUERY_FLAGS_COLLECTIONS)
photos_base_manager_set_active_object_by_id (srch_typ_mngr, PHOTOS_SEARCH_TYPE_STOCK_COLLECTIONS);
......@@ -81,10 +81,10 @@ photos_query_builder_filter (gint flags)
gchar *src_mngr_filter;
gchar *srch_typ_mngr_filter;
src_mngr = photos_source_manager_new ();
src_mngr = photos_source_manager_dup_singleton ();
src_mngr_filter = photos_base_manager_get_filter (src_mngr);
srch_typ_mngr = photos_search_type_manager_new ();
srch_typ_mngr = photos_search_type_manager_dup_singleton ();
photos_query_builder_set_search_type (flags);
srch_typ_mngr_filter = photos_base_manager_get_filter (srch_typ_mngr);
......@@ -120,9 +120,9 @@ photos_query_builder_where (gboolean global, gint flags)
gchar *sparql;
gchar *srch_typ_mngr_where = NULL;
col_mngr = photos_collection_manager_new ();
col_mngr = photos_collection_manager_dup_singleton ();
srch_typ_mngr = photos_search_type_manager_new ();
srch_typ_mngr = photos_search_type_manager_dup_singleton ();
photos_query_builder_set_search_type (flags);
srch_typ_mngr_where = photos_search_type_manager_get_where (PHOTOS_SEARCH_TYPE_MANAGER (srch_typ_mngr));
......@@ -173,11 +173,11 @@ photos_query_builder_query (gboolean global, gint flags)
gint step;
if (flags & PHOTOS_QUERY_FLAGS_COLLECTIONS)
offset_cntrlr = photos_offset_collections_controller_new ();
offset_cntrlr = photos_offset_collections_controller_dup_singleton ();
else if (flags & PHOTOS_QUERY_FLAGS_FAVORITES)
offset_cntrlr = photos_offset_favorites_controller_new ();
offset_cntrlr = photos_offset_favorites_controller_dup_singleton ();
else
offset_cntrlr = photos_offset_overview_controller_new ();
offset_cntrlr = photos_offset_overview_controller_dup_singleton ();
offset = photos_offset_controller_get_offset (offset_cntrlr);
step = photos_offset_controller_get_step (offset_cntrlr);
......
......@@ -42,7 +42,7 @@ photos_query_new (gchar *sparql)
query = g_slice_new0 (PhotosQuery);
src_mngr = photos_source_manager_new ();
src_mngr = photos_source_manager_dup_singleton ();
active_object = photos_base_manager_get_active_object (src_mngr);
if (active_object != NULL)
query->source = PHOTOS_SOURCE (g_object_ref (active_object));
......
......@@ -113,7 +113,7 @@ photos_search_type_manager_class_init (PhotosSearchTypeManagerClass *class)
PhotosBaseManager *
photos_search_type_manager_new (void)
photos_search_type_manager_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_SEARCH_TYPE_MANAGER, NULL);
}
......
......@@ -68,7 +68,7 @@ struct _PhotosSearchTypeManagerClass
GType photos_search_type_manager_get_type (void) G_GNUC_CONST;
PhotosBaseManager *photos_search_type_manager_new (void);
PhotosBaseManager *photos_search_type_manager_dup_singleton (void);
gchar *photos_search_type_manager_get_where (PhotosSearchTypeManager *self);
......
......@@ -131,7 +131,7 @@ photos_selection_controller_init (PhotosSelectionController *self)
self->priv = photos_selection_controller_get_instance_private (self);
priv = self->priv;
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
g_signal_connect (priv->item_mngr,
"object-removed",
G_CALLBACK (photos_selection_controller_object_removed),
......@@ -174,7 +174,7 @@ photos_selection_controller_class_init (PhotosSelectionControllerClass *class)
PhotosSelectionController *
photos_selection_controller_new (void)
photos_selection_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_SELECTION_CONTROLLER, NULL);
}
......
......@@ -71,7 +71,7 @@ struct _PhotosSelectionControllerClass
GType photos_selection_controller_get_type (void) G_GNUC_CONST;
PhotosSelectionController *photos_selection_controller_new (void);
PhotosSelectionController *photos_selection_controller_dup_singleton (void);
void photos_selection_controller_freeze_selection (PhotosSelectionController *self,
gboolean freeze);
......
......@@ -475,9 +475,9 @@ photos_selection_toolbar_init (PhotosSelectionToolbar *self)
gtk_widget_show_all (GTK_WIDGET (self));
priv->item_mngr = photos_item_manager_new ();
priv->item_mngr = photos_item_manager_dup_singleton ();
priv->sel_cntrlr = photos_selection_controller_new ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
g_signal_connect (priv->sel_cntrlr,
"selection-changed",
G_CALLBACK (photos_selection_toolbar_selection_changed),
......
......@@ -163,8 +163,8 @@ photos_set_collection_job_init (PhotosSetCollectionJob *self)
self->priv = photos_set_collection_job_get_instance_private (self);
priv = self->priv;
priv->sel_cntrlr = photos_selection_controller_new ();
priv->queue = photos_tracker_queue_new ();
priv->sel_cntrlr = photos_selection_controller_dup_singleton ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -169,7 +169,7 @@ photos_single_item_job_init (PhotosSingleItemJob *self)
self->priv = photos_single_item_job_get_instance_private (self);
priv = self->priv;
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
}
......
......@@ -189,7 +189,7 @@ photos_source_manager_class_init (PhotosSourceManagerClass *class)
PhotosBaseManager *
photos_source_manager_new (void)
photos_source_manager_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_SOURCE_MANAGER, NULL);
}
......
......@@ -68,7 +68,7 @@ struct _PhotosSourceManagerClass
GType photos_source_manager_get_type (void) G_GNUC_CONST;
PhotosBaseManager *photos_source_manager_new (void);
PhotosBaseManager *photos_source_manager_dup_singleton (void);
GList *photos_source_manager_get_for_provider_type (PhotosSourceManager *self,
const gchar *provider_type);
......
......@@ -303,7 +303,7 @@ photos_tracker_change_monitor_init (PhotosTrackerChangeMonitor *self)
g_free,
(GDestroyNotify) photos_tracker_change_event_free);
priv->queue = photos_tracker_queue_new ();
priv->queue = photos_tracker_queue_dup_singleton ();
priv->resource_service = tracker_resources_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.Tracker1",
......@@ -339,7 +339,7 @@ photos_tracker_change_monitor_class_init (PhotosTrackerChangeMonitorClass *class
PhotosTrackerChangeMonitor *
photos_tracker_change_monitor_new (void)
photos_tracker_change_monitor_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_TRACKER_CHANGE_MONITOR, NULL);
}
......@@ -72,7 +72,7 @@ struct _PhotosTrackerChangeMonitorClass
GType photos_tracker_change_monitor_get_type (void) G_GNUC_CONST;
PhotosTrackerChangeMonitor *photos_tracker_change_monitor_new (void);
PhotosTrackerChangeMonitor *photos_tracker_change_monitor_dup_singleton (void);
G_END_DECLS
......
......@@ -41,7 +41,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (PhotosTrackerCollectionsController,
static PhotosOffsetController *
photos_tracker_collections_controller_get_offset_controller (void)
{
return photos_offset_collections_controller_new ();
return photos_offset_collections_controller_dup_singleton ();
}
......@@ -101,7 +101,7 @@ photos_tracker_collections_controller_init (PhotosTrackerCollectionsController *
self->priv = photos_tracker_collections_controller_get_instance_private (self);
priv = self->priv;
priv->col_mngr = photos_collection_manager_new ();
priv->col_mngr = photos_collection_manager_dup_singleton ();
}
......@@ -119,7 +119,7 @@ photos_tracker_collections_controller_class_init (PhotosTrackerCollectionsContro
PhotosTrackerController *
photos_tracker_collections_controller_new (void)
photos_tracker_collections_controller_dup_singleton (void)
{
return g_object_new (PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER, NULL);
}
......@@ -64,7 +64,7 @@ struct _PhotosTrackerCollectionsControllerClass
GType photos_tracker_collections_controller_get_type (void) G_GNUC_CONST;
PhotosTrackerController *photos_tracker_collections_controller_new (void);
PhotosTrackerController *photos_tracker_collections_controller_dup_singleton (void);
G_END_DECLS
......