[evince/wip/chpe/export-print-portal-custom-options: 7/12] libview: Use GObject:constructed instead of constructor




commit 7162c3bfcfbc4f068d9da6fdc462873e63504448
Author: Christian Persch <chpe src gnome org>
Date:   Wed Nov 24 18:48:50 2021 +0100

    libview: Use GObject:constructed instead of constructor

 libview/ev-print-operation.c | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c
index 239829432..f2055d9f6 100644
--- a/libview/ev-print-operation.c
+++ b/libview/ev-print-operation.c
@@ -104,7 +104,7 @@ ev_print_operation_finalize (GObject *object)
                op->status = NULL;
        }
 
-       (* G_OBJECT_CLASS (ev_print_operation_parent_class)->finalize) (object);
+       G_OBJECT_CLASS (ev_print_operation_parent_class)->finalize (object);
 }
 
 static void
@@ -1488,7 +1488,7 @@ ev_print_operation_export_finalize (GObject *object)
                export->printer = NULL;
        }
 
-       (* G_OBJECT_CLASS (ev_print_operation_export_parent_class)->finalize) (object);
+       G_OBJECT_CLASS (ev_print_operation_export_parent_class)->finalize (object);
 }
 
 static void
@@ -1498,23 +1498,15 @@ ev_print_operation_export_init (EvPrintOperationExport *export)
        export->sheet = 1;
 }
 
-static GObject *
-ev_print_operation_export_constructor (GType                  type,
-                                      guint                  n_construct_properties,
-                                      GObjectConstructParam *construct_params)
-{
-       GObject                *object;
-       EvPrintOperationExport *export;
-       EvPrintOperation       *op;
-
-       object = G_OBJECT_CLASS (ev_print_operation_export_parent_class)->constructor (type,
-                                                                                      n_construct_properties,
-                                                                                      construct_params);
-       export = EV_PRINT_OPERATION_EXPORT (object);
-       op = EV_PRINT_OPERATION (object);
-       export->n_pages = ev_document_get_n_pages (op->document);
+static void
+ev_print_operation_export_constructed (GObject *object)
+{
+        EvPrintOperation *op = EV_PRINT_OPERATION (object);
+        EvPrintOperationExport *export = EV_PRINT_OPERATION_EXPORT (object);
+
+        G_OBJECT_CLASS (ev_print_operation_export_parent_class)->constructed (object);
 
-       return object;
+       export->n_pages = ev_document_get_n_pages (op->document);
 }
 
 static void
@@ -1536,7 +1528,7 @@ ev_print_operation_export_class_init (EvPrintOperationExportClass *klass)
        ev_print_op_class->set_embed_page_setup = ev_print_operation_export_set_embed_page_setup;
        ev_print_op_class->get_embed_page_setup = ev_print_operation_export_get_embed_page_setup;
 
-       g_object_class->constructor = ev_print_operation_export_constructor;
+       g_object_class->constructed = ev_print_operation_export_constructed;
        g_object_class->finalize = ev_print_operation_export_finalize;
 }
 
@@ -2084,7 +2076,7 @@ ev_print_operation_print_finalize (GObject *object)
                print->job_print = NULL;
        }
 
-       (* G_OBJECT_CLASS (ev_print_operation_print_parent_class)->finalize) (object);
+       G_OBJECT_CLASS (ev_print_operation_print_parent_class)->finalize (object);
 
         application = g_application_get_default ();
         if (application)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]