[gnome-photos] organize-collection-dialog: Make it a final class
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] organize-collection-dialog: Make it a final class
- Date: Fri, 1 Apr 2016 20:36:06 +0000 (UTC)
commit a631f8386fb430aadae9d21bcfc959d9637c57da
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Mar 24 12:47:01 2016 +0100
organize-collection-dialog: Make it a final class
src/photos-organize-collection-dialog.c | 22 ++++++++++++----------
src/photos-organize-collection-dialog.h | 28 ++--------------------------
2 files changed, 14 insertions(+), 36 deletions(-)
---
diff --git a/src/photos-organize-collection-dialog.c b/src/photos-organize-collection-dialog.c
index 5ac153b..7c3f376 100644
--- a/src/photos-organize-collection-dialog.c
+++ b/src/photos-organize-collection-dialog.c
@@ -31,19 +31,25 @@
#include "photos-organize-collection-view.h"
-struct _PhotosOrganizeCollectionDialogPrivate
+struct _PhotosOrganizeCollectionDialog
{
+ GtkDialog parent_instance;
GtkWidget *coll_view;
};
+struct _PhotosOrganizeCollectionDialogClass
+{
+ GtkDialogClass parent_class;
+};
-G_DEFINE_TYPE_WITH_PRIVATE (PhotosOrganizeCollectionDialog, photos_organize_collection_dialog,
GTK_TYPE_DIALOG);
+
+G_DEFINE_TYPE (PhotosOrganizeCollectionDialog, photos_organize_collection_dialog, GTK_TYPE_DIALOG);
static gboolean
photos_organize_collection_dialog_button_press_event (PhotosOrganizeCollectionDialog *self, GdkEvent *event)
{
- photos_organize_collection_view_confirmed_choice (PHOTOS_ORGANIZE_COLLECTION_VIEW (self->priv->coll_view));
+ photos_organize_collection_view_confirmed_choice (PHOTOS_ORGANIZE_COLLECTION_VIEW (self->coll_view));
return FALSE;
}
@@ -56,21 +62,17 @@ photos_organize_collection_dialog_response (GtkDialog *dialog, gint response_id)
if (response_id != GTK_RESPONSE_ACCEPT)
return;
- photos_organize_collection_view_add_collection (PHOTOS_ORGANIZE_COLLECTION_VIEW (self->priv->coll_view));
+ photos_organize_collection_view_add_collection (PHOTOS_ORGANIZE_COLLECTION_VIEW (self->coll_view));
}
static void
photos_organize_collection_dialog_init (PhotosOrganizeCollectionDialog *self)
{
- PhotosOrganizeCollectionDialogPrivate *priv;
GtkWidget *content_area;
GtkWidget *ok_button;
GtkWidget *sw;
- self->priv = photos_organize_collection_dialog_get_instance_private (self);
- priv = self->priv;
-
gtk_dialog_add_button (GTK_DIALOG (self), _("_Add"), GTK_RESPONSE_ACCEPT);
ok_button = gtk_dialog_add_button (GTK_DIALOG (self), _("_OK"), GTK_RESPONSE_CLOSE);
gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_CLOSE);
@@ -82,8 +84,8 @@ photos_organize_collection_dialog_init (PhotosOrganizeCollectionDialog *self)
gtk_widget_set_margin_end (sw, 5);
gtk_widget_set_margin_bottom (sw, 3);
- priv->coll_view = photos_organize_collection_view_new ();
- gtk_container_add (GTK_CONTAINER (sw), priv->coll_view);
+ self->coll_view = photos_organize_collection_view_new ();
+ gtk_container_add (GTK_CONTAINER (sw), self->coll_view);
gtk_container_add (GTK_CONTAINER (content_area), sw);
/* HACK:
diff --git a/src/photos-organize-collection-dialog.h b/src/photos-organize-collection-dialog.h
index 4e6b56c..7397f56 100644
--- a/src/photos-organize-collection-dialog.h
+++ b/src/photos-organize-collection-dialog.h
@@ -35,36 +35,12 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
PHOTOS_TYPE_ORGANIZE_COLLECTION_DIALOG, PhotosOrganizeCollectionDialog))
-#define PHOTOS_ORGANIZE_COLLECTION_DIALOG_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), \
- PHOTOS_TYPE_ORGANIZE_COLLECTION_DIALOG, PhotosOrganizeCollectionDialogClass))
-
#define PHOTOS_IS_ORGANIZE_COLLECTION_DIALOG(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
PHOTOS_TYPE_ORGANIZE_COLLECTION_DIALOG))
-#define PHOTOS_IS_ORGANIZE_COLLECTION_DIALOG_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), \
- PHOTOS_TYPE_ORGANIZE_COLLECTION_DIALOG))
-
-#define PHOTOS_ORGANIZE_COLLECTION_DIALOG_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- PHOTOS_TYPE_ORGANIZE_COLLECTION_DIALOG, PhotosOrganizeCollectionDialogClass))
-
-typedef struct _PhotosOrganizeCollectionDialog PhotosOrganizeCollectionDialog;
-typedef struct _PhotosOrganizeCollectionDialogClass PhotosOrganizeCollectionDialogClass;
-typedef struct _PhotosOrganizeCollectionDialogPrivate PhotosOrganizeCollectionDialogPrivate;
-
-struct _PhotosOrganizeCollectionDialog
-{
- GtkDialog parent_instance;
- PhotosOrganizeCollectionDialogPrivate *priv;
-};
-
-struct _PhotosOrganizeCollectionDialogClass
-{
- GtkDialogClass parent_class;
-};
+typedef struct _PhotosOrganizeCollectionDialog PhotosOrganizeCollectionDialog;
+typedef struct _PhotosOrganizeCollectionDialogClass PhotosOrganizeCollectionDialogClass;
GType photos_organize_collection_dialog_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]