[gnome-photos] offset-collections-controller: Make it a final class
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] offset-collections-controller: Make it a final class
- Date: Thu, 24 Mar 2016 11:24:36 +0000 (UTC)
commit b2aa8319a4859f2f9188cfd6c84357d7fe47f1c6
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Mar 24 12:18:01 2016 +0100
offset-collections-controller: Make it a final class
src/photos-offset-collections-controller.c | 32 ++++++++++++++--------------
src/photos-offset-collections-controller.h | 28 +----------------------
2 files changed, 18 insertions(+), 42 deletions(-)
---
diff --git a/src/photos-offset-collections-controller.c b/src/photos-offset-collections-controller.c
index 717a638..066f4c3 100644
--- a/src/photos-offset-collections-controller.c
+++ b/src/photos-offset-collections-controller.c
@@ -33,30 +33,35 @@
#include "photos-search-context.h"
-struct _PhotosOffsetCollectionsControllerPrivate
+struct _PhotosOffsetCollectionsController
{
+ PhotosOffsetController parent_instance;
PhotosBaseManager *item_mngr;
};
+struct _PhotosOffsetCollectionsControllerClass
+{
+ PhotosOffsetControllerClass parent_class;
+};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosOffsetCollectionsController,
- photos_offset_collections_controller,
- PHOTOS_TYPE_OFFSET_CONTROLLER);
+
+G_DEFINE_TYPE (PhotosOffsetCollectionsController,
+ photos_offset_collections_controller,
+ PHOTOS_TYPE_OFFSET_CONTROLLER);
static PhotosQuery *
photos_offset_collections_controller_get_query (PhotosOffsetController *offset_cntrlr)
{
PhotosOffsetCollectionsController *self = PHOTOS_OFFSET_COLLECTIONS_CONTROLLER (offset_cntrlr);
- PhotosOffsetCollectionsControllerPrivate *priv = self->priv;
GApplication *app;
PhotosBaseItem *collection;
PhotosSearchContextState *state;
gint flags;
- g_return_val_if_fail (priv->item_mngr != NULL, NULL);
+ g_return_val_if_fail (self->item_mngr != NULL, NULL);
- collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (priv->item_mngr));
+ collection = photos_item_manager_get_active_collection (PHOTOS_ITEM_MANAGER (self->item_mngr));
if (collection != NULL)
flags = PHOTOS_QUERY_FLAGS_NONE;
else
@@ -93,10 +98,9 @@ static void
photos_offset_collections_controller_finalize (GObject *object)
{
PhotosOffsetCollectionsController *self = PHOTOS_OFFSET_COLLECTIONS_CONTROLLER (object);
- PhotosOffsetCollectionsControllerPrivate *priv = self->priv;
- if (priv->item_mngr != NULL)
- g_object_remove_weak_pointer (G_OBJECT (priv->item_mngr), (gpointer *) &priv->item_mngr);
+ if (self->item_mngr != NULL)
+ g_object_remove_weak_pointer (G_OBJECT (self->item_mngr), (gpointer *) &self->item_mngr);
G_OBJECT_CLASS (photos_offset_collections_controller_parent_class)->finalize (object);
}
@@ -105,18 +109,14 @@ photos_offset_collections_controller_finalize (GObject *object)
static void
photos_offset_collections_controller_init (PhotosOffsetCollectionsController *self)
{
- PhotosOffsetCollectionsControllerPrivate *priv;
GApplication *app;
PhotosSearchContextState *state;
- self->priv = photos_offset_collections_controller_get_instance_private (self);
- priv = self->priv;
-
app = g_application_get_default ();
state = photos_search_context_get_state (PHOTOS_SEARCH_CONTEXT (app));
- priv->item_mngr = state->item_mngr;
- g_object_add_weak_pointer (G_OBJECT (priv->item_mngr), (gpointer *) &priv->item_mngr);
+ self->item_mngr = state->item_mngr;
+ g_object_add_weak_pointer (G_OBJECT (self->item_mngr), (gpointer *) &self->item_mngr);
}
diff --git a/src/photos-offset-collections-controller.h b/src/photos-offset-collections-controller.h
index 345a292..293b2fd 100644
--- a/src/photos-offset-collections-controller.h
+++ b/src/photos-offset-collections-controller.h
@@ -35,36 +35,12 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsController))
-#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), \
- PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsControllerClass))
-
#define PHOTOS_IS_OFFSET_COLLECTIONS_CONTROLLER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER))
-#define PHOTOS_IS_OFFSET_COLLECTIONS_CONTROLLER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), \
- PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER))
-
-#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsControllerClass))
-
-typedef struct _PhotosOffsetCollectionsController PhotosOffsetCollectionsController;
-typedef struct _PhotosOffsetCollectionsControllerClass PhotosOffsetCollectionsControllerClass;
-typedef struct _PhotosOffsetCollectionsControllerPrivate PhotosOffsetCollectionsControllerPrivate;
-
-struct _PhotosOffsetCollectionsController
-{
- PhotosOffsetController parent_instance;
- PhotosOffsetCollectionsControllerPrivate *priv;
-};
-
-struct _PhotosOffsetCollectionsControllerClass
-{
- PhotosOffsetControllerClass parent_class;
-};
+typedef struct _PhotosOffsetCollectionsController PhotosOffsetCollectionsController;
+typedef struct _PhotosOffsetCollectionsControllerClass PhotosOffsetCollectionsControllerClass;
GType photos_offset_collections_controller_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]