[gnome-control-center/wip/rancell/g-define-type] phase 5
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/rancell/g-define-type] phase 5
- Date: Mon, 4 Sep 2017 09:59:13 +0000 (UTC)
commit f69352d7fd573622bceff17b29c57320f1dcac62
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Sep 4 21:58:52 2017 +1200
phase 5
panels/keyboard/cc-keyboard-item.c | 2 --
panels/printers/pp-ppd-option-widget.c | 3 ---
panels/printers/pp-printer.c | 27 ++++++++-------------------
3 files changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-item.c b/panels/keyboard/cc-keyboard-item.c
index 0d8b8e1..86eef1c 100644
--- a/panels/keyboard/cc-keyboard-item.c
+++ b/panels/keyboard/cc-keyboard-item.c
@@ -28,8 +28,6 @@
#include "cc-keyboard-item.h"
-#define CC_KEYBOARD_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_KEYBOARD_ITEM,
CcKeyboardItemPrivate))
-
#define CUSTOM_KEYS_SCHEMA "org.gnome.settings-daemon.plugins.media-keys.custom-keybinding"
struct _CcKeyboardItem
diff --git a/panels/printers/pp-ppd-option-widget.c b/panels/printers/pp-ppd-option-widget.c
index 370cc91..4404a3b 100644
--- a/panels/printers/pp-ppd-option-widget.c
+++ b/panels/printers/pp-ppd-option-widget.c
@@ -29,9 +29,6 @@
#include "pp-ppd-option-widget.h"
#include "pp-utils.h"
-#define PP_PPD_OPTION_WIDGET_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), PP_TYPE_PPD_OPTION_WIDGET, PpPPDOptionWidgetPrivate))
-
static void pp_ppd_option_widget_finalize (GObject *object);
static gboolean construct_widget (PpPPDOptionWidget *widget);
diff --git a/panels/printers/pp-printer.c b/panels/printers/pp-printer.c
index 79a6301..bd6cf49 100644
--- a/panels/printers/pp-printer.c
+++ b/panels/printers/pp-printer.c
@@ -22,21 +22,13 @@
#include "pp-job.h"
-typedef struct _PpPrinter PpPrinter;
-typedef struct _PpPrinterPrivate PpPrinterPrivate;
-
struct _PpPrinter
{
- GObject parent_instance;
- PpPrinterPrivate *priv;
+ GObject parent_instance;
+ gchar *printer_name;
};
-struct _PpPrinterPrivate
-{
- gchar *printer_name;
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE (PpPrinter, pp_printer, G_TYPE_OBJECT)
+G_DEFINE_TYPE (PpPrinter, pp_printer, G_TYPE_OBJECT)
enum
{
@@ -47,9 +39,9 @@ enum
static void
pp_printer_dispose (GObject *object)
{
- PpPrinterPrivate *priv = PP_PRINTER (object)->priv;
+ PpPrinter *self = PP_PRINTER (object);
- g_free (priv->printer_name);
+ g_free (self->printer_name);
G_OBJECT_CLASS (pp_printer_parent_class)->dispose (object);
}
@@ -71,7 +63,7 @@ pp_printer_get_property (GObject *object,
switch (property_id)
{
case PROP_NAME:
- g_value_set_string (value, self->priv->printer_name);
+ g_value_set_string (value, self->printer_name);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -90,8 +82,8 @@ pp_printer_set_property (GObject *object,
switch (property_id)
{
case PROP_NAME:
- g_free (self->priv->printer_name);
- self->priv->printer_name = g_value_dup_string (value);
+ g_free (self->printer_name);
+ self->printer_name = g_value_dup_string (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -121,9 +113,6 @@ pp_printer_class_init (PpPrinterClass *klass)
static void
pp_printer_init (PpPrinter *printer)
{
- printer->priv = G_TYPE_INSTANCE_GET_PRIVATE (printer,
- PP_TYPE_PRINTER,
- PpPrinterPrivate);
}
PpPrinter *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]