[gnome-photos/gnome-3-16] Turn the PhotosTrackerController sub-classes into extensions
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-16] Turn the PhotosTrackerController sub-classes into extensions
- Date: Fri, 9 Oct 2015 11:14:00 +0000 (UTC)
commit 60a3bc1f9204c9f0547acdc81925f93dacbf17ce
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Oct 7 19:11:03 2015 +0200
Turn the PhotosTrackerController sub-classes into extensions
This will let us freeze and thaw all the TrackerControllers without
having to manually maintain the list.
https://bugzilla.gnome.org/show_bug.cgi?id=741593
src/photos-tracker-collections-controller.c | 15 +++++++++++----
src/photos-tracker-favorites-controller.c | 15 +++++++++++----
src/photos-tracker-overview-controller.c | 15 +++++++++++----
src/photos-tracker-search-controller.c | 15 +++++++++++----
src/photos-utils.c | 13 +++++++++++++
src/photos-utils.h | 1 +
6 files changed, 58 insertions(+), 16 deletions(-)
---
diff --git a/src/photos-tracker-collections-controller.c b/src/photos-tracker-collections-controller.c
index 310a092..6230a45 100644
--- a/src/photos-tracker-collections-controller.c
+++ b/src/photos-tracker-collections-controller.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2013, 2014 Red Hat, Inc.
+ * Copyright © 2013, 2014, 2015 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
@@ -29,6 +29,7 @@
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-collections-controller.h"
+#include "photos-utils.h"
struct _PhotosTrackerCollectionsControllerPrivate
@@ -39,9 +40,15 @@ struct _PhotosTrackerCollectionsControllerPrivate
};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosTrackerCollectionsController,
- photos_tracker_collections_controller,
- PHOTOS_TYPE_TRACKER_CONTROLLER);
+G_DEFINE_TYPE_WITH_CODE (PhotosTrackerCollectionsController,
+ photos_tracker_collections_controller,
+ PHOTOS_TYPE_TRACKER_CONTROLLER,
+ G_ADD_PRIVATE (PhotosTrackerCollectionsController)
+ photos_utils_ensure_extension_points ();
+ g_io_extension_point_implement (PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "collections",
+ 0));
static void
diff --git a/src/photos-tracker-favorites-controller.c b/src/photos-tracker-favorites-controller.c
index 3ec845f..dfcfee5 100644
--- a/src/photos-tracker-favorites-controller.c
+++ b/src/photos-tracker-favorites-controller.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013, 2014 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014, 2015 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
@@ -29,6 +29,7 @@
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-favorites-controller.h"
+#include "photos-utils.h"
struct _PhotosTrackerFavoritesControllerPrivate
@@ -39,9 +40,15 @@ struct _PhotosTrackerFavoritesControllerPrivate
};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosTrackerFavoritesController,
- photos_tracker_favorites_controller,
- PHOTOS_TYPE_TRACKER_CONTROLLER);
+G_DEFINE_TYPE_WITH_CODE (PhotosTrackerFavoritesController,
+ photos_tracker_favorites_controller,
+ PHOTOS_TYPE_TRACKER_CONTROLLER,
+ G_ADD_PRIVATE (PhotosTrackerFavoritesController)
+ photos_utils_ensure_extension_points ();
+ g_io_extension_point_implement (PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "favorites",
+ 0));
static void
diff --git a/src/photos-tracker-overview-controller.c b/src/photos-tracker-overview-controller.c
index 4a01c5e..591fc50 100644
--- a/src/photos-tracker-overview-controller.c
+++ b/src/photos-tracker-overview-controller.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013, 2014 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014, 2015 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
@@ -32,6 +32,7 @@
#include "photos-query-builder.h"
#include "photos-search-context.h"
#include "photos-tracker-overview-controller.h"
+#include "photos-utils.h"
struct _PhotosTrackerOverviewControllerPrivate
@@ -40,9 +41,15 @@ struct _PhotosTrackerOverviewControllerPrivate
};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosTrackerOverviewController,
- photos_tracker_overview_controller,
- PHOTOS_TYPE_TRACKER_CONTROLLER);
+G_DEFINE_TYPE_WITH_CODE (PhotosTrackerOverviewController,
+ photos_tracker_overview_controller,
+ PHOTOS_TYPE_TRACKER_CONTROLLER,
+ G_ADD_PRIVATE (PhotosTrackerOverviewController)
+ photos_utils_ensure_extension_points ();
+ g_io_extension_point_implement (PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "overview",
+ 0));
static PhotosOffsetController *
diff --git a/src/photos-tracker-search-controller.c b/src/photos-tracker-search-controller.c
index b248350..5938d24 100644
--- a/src/photos-tracker-search-controller.c
+++ b/src/photos-tracker-search-controller.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2014 Red Hat, Inc.
+ * Copyright © 2014, 2015 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
@@ -35,6 +35,7 @@
#include "photos-search-context.h"
#include "photos-search-controller.h"
#include "photos-tracker-search-controller.h"
+#include "photos-utils.h"
struct _PhotosTrackerSearchControllerPrivate
@@ -49,9 +50,15 @@ struct _PhotosTrackerSearchControllerPrivate
};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosTrackerSearchController,
- photos_tracker_search_controller,
- PHOTOS_TYPE_TRACKER_CONTROLLER);
+G_DEFINE_TYPE_WITH_CODE (PhotosTrackerSearchController,
+ photos_tracker_search_controller,
+ PHOTOS_TYPE_TRACKER_CONTROLLER,
+ G_ADD_PRIVATE (PhotosTrackerSearchController)
+ photos_utils_ensure_extension_points ();
+ g_io_extension_point_implement (PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME,
+ g_define_type_id,
+ "search",
+ 0));
static void
diff --git a/src/photos-utils.c b/src/photos-utils.c
index e99395b..382b2d0 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -43,7 +43,12 @@
#include "photos-media-server-item.h"
#include "photos-query.h"
#include "photos-source.h"
+#include "photos-tracker-collections-controller.h"
+#include "photos-tracker-controller.h"
+#include "photos-tracker-favorites-controller.h"
+#include "photos-tracker-overview-controller.h"
#include "photos-tracker-queue.h"
+#include "photos-tracker-search-controller.h"
#include "photos-utils.h"
@@ -530,6 +535,11 @@ photos_utils_ensure_builtins (void)
g_type_ensure (PHOTOS_TYPE_LOCAL_ITEM);
g_type_ensure (PHOTOS_TYPE_MEDIA_SERVER_ITEM);
+ g_type_ensure (PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER);
+ g_type_ensure (PHOTOS_TYPE_TRACKER_FAVORITES_CONTROLLER);
+ g_type_ensure (PHOTOS_TYPE_TRACKER_OVERVIEW_CONTROLLER);
+ g_type_ensure (PHOTOS_TYPE_TRACKER_SEARCH_CONTROLLER);
+
g_once_init_leave (&once_init_value, 1);
}
}
@@ -547,6 +557,9 @@ photos_utils_ensure_extension_points (void)
extension_point = g_io_extension_point_register (PHOTOS_BASE_ITEM_EXTENSION_POINT_NAME);
g_io_extension_point_set_required_type (extension_point, PHOTOS_TYPE_BASE_ITEM);
+ extension_point = g_io_extension_point_register (PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME);
+ g_io_extension_point_set_required_type (extension_point, PHOTOS_TYPE_TRACKER_CONTROLLER);
+
g_once_init_leave (&once_init_value, 1);
}
}
diff --git a/src/photos-utils.h b/src/photos-utils.h
index d6726be..fc1a1f7 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -44,6 +44,7 @@ G_BEGIN_DECLS
#define PHOTOS_FLASH_ON (photos_utils_flash_on_quark ())
#define PHOTOS_BASE_ITEM_EXTENSION_POINT_NAME "photos-base-item"
+#define PHOTOS_TRACKER_CONTROLLER_EXTENSION_POINT_NAME "photos-tracker-controller"
#define PHOTOS_COLLECTION_SCREENSHOT \
"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#image-category-screenshot"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]