[gnome-photos/wip/rishi/search-type-remove-unused-constructor] search-type, search-type-manager: Simplify code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/search-type-remove-unused-constructor] search-type, search-type-manager: Simplify code
- Date: Mon, 22 Feb 2021 21:19:04 +0000 (UTC)
commit d98082d330b4fb457f22438a50035da3098c720c
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Feb 22 22:18:08 2021 +0100
search-type, search-type-manager: Simplify code
Fallout from 3d4f17a87a4da426c861057e989602387ece83fb
https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/165
src/photos-search-type-manager.c | 36 ++++++++++++++++++------------------
src/photos-search-type.c | 9 +--------
2 files changed, 19 insertions(+), 26 deletions(-)
---
diff --git a/src/photos-search-type-manager.c b/src/photos-search-type-manager.c
index ba059766..0ea98aba 100644
--- a/src/photos-search-type-manager.c
+++ b/src/photos-search-type-manager.c
@@ -117,33 +117,33 @@ photos_search_type_manager_init (PhotosSearchTypeManager *self)
PHOTOS_QUERY_COLLECTIONS_IDENTIFIER);
all_filter = g_strdup_printf ("(%s || %s)", col_filter, item_filter);
- search_type = photos_search_type_new_full (PHOTOS_SEARCH_TYPE_STOCK_ALL,
- _("All"),
- "?urn a rdfs:Resource. "
- "OPTIONAL {?item a nmm:Photo; nie:isPartOf ?urn}",
- all_filter);
+ search_type = photos_search_type_new (PHOTOS_SEARCH_TYPE_STOCK_ALL,
+ _("All"),
+ "?urn a rdfs:Resource. "
+ "OPTIONAL {?item a nmm:Photo; nie:isPartOf ?urn}",
+ all_filter);
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (search_type));
g_object_unref (search_type);
- search_type = photos_search_type_new_full (PHOTOS_SEARCH_TYPE_STOCK_COLLECTIONS,
- _("Albums"),
- "?urn a nfo:DataContainer. "
- "?item a nmm:Photo; nie:isPartOf ?urn.",
- col_filter);
+ search_type = photos_search_type_new (PHOTOS_SEARCH_TYPE_STOCK_COLLECTIONS,
+ _("Albums"),
+ "?urn a nfo:DataContainer. "
+ "?item a nmm:Photo; nie:isPartOf ?urn.",
+ col_filter);
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (search_type));
g_object_unref (search_type);
- search_type = photos_search_type_new_full (PHOTOS_SEARCH_TYPE_STOCK_FAVORITES,
- _("Favorites"),
- "?urn a nmm:Photo; nao:hasTag nao:predefined-tag-favorite. ",
- blocked_mime_types_filter);
+ search_type = photos_search_type_new (PHOTOS_SEARCH_TYPE_STOCK_FAVORITES,
+ _("Favorites"),
+ "?urn a nmm:Photo; nao:hasTag nao:predefined-tag-favorite. ",
+ blocked_mime_types_filter);
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (search_type));
g_object_unref (search_type);
- search_type = photos_search_type_new_full (PHOTOS_SEARCH_TYPE_STOCK_PHOTOS,
- _("Photos"),
- "?urn a nmm:Photo",
- blocked_mime_types_filter);
+ search_type = photos_search_type_new (PHOTOS_SEARCH_TYPE_STOCK_PHOTOS,
+ _("Photos"),
+ "?urn a nmm:Photo",
+ blocked_mime_types_filter);
photos_base_manager_add_object (PHOTOS_BASE_MANAGER (self), G_OBJECT (search_type));
g_object_unref (search_type);
diff --git a/src/photos-search-type.c b/src/photos-search-type.c
index 44dc60eb..f03385aa 100644
--- a/src/photos-search-type.c
+++ b/src/photos-search-type.c
@@ -210,14 +210,7 @@ photos_search_type_filterable_iface_init (PhotosFilterableInterface *iface)
PhotosSearchType *
-photos_search_type_new (const gchar *id, const gchar *name)
-{
- return g_object_new (PHOTOS_TYPE_SEARCH_TYPE, "id", id, "name", name, NULL);
-}
-
-
-PhotosSearchType *
-photos_search_type_new_full (const gchar *id, const gchar *name, const gchar *where, const gchar *filter)
+photos_search_type_new (const gchar *id, const gchar *name, const gchar *where, const gchar *filter)
{
return g_object_new (PHOTOS_TYPE_SEARCH_TYPE,
"id", id,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]