[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/01: Replace more deprecated g_type_class_add_private
noreply at xfce.org
noreply at xfce.org
Sun Mar 29 01:41:05 CET 2020
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-clipman-plugin.
commit 03b88b10e342dec1ea44b43ab1ccfa6168dac0fc
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Mar 29 01:40:42 2020 +0100
Replace more deprecated g_type_class_add_private
---
panel-plugin/actions.c | 10 +++-------
panel-plugin/collector.c | 10 +++-------
panel-plugin/history.c | 10 +++-------
panel-plugin/menu.c | 10 +++-------
4 files changed, 12 insertions(+), 28 deletions(-)
diff --git a/panel-plugin/actions.c b/panel-plugin/actions.c
index 7943c57..b49c50b 100644
--- a/panel-plugin/actions.c
+++ b/panel-plugin/actions.c
@@ -47,10 +47,6 @@
* GObject declarations
*/
-G_DEFINE_TYPE (ClipmanActions, clipman_actions, G_TYPE_OBJECT)
-
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLIPMAN_TYPE_ACTIONS, ClipmanActionsPrivate))
-
struct _ClipmanActionsPrivate
{
GFile *file;
@@ -60,6 +56,8 @@ struct _ClipmanActionsPrivate
gboolean skip_action_on_key_down;
};
+G_DEFINE_TYPE_WITH_PRIVATE (ClipmanActions, clipman_actions, G_TYPE_OBJECT)
+
enum
{
SKIP_ACTION_ON_KEY_DOWN = 1,
@@ -932,8 +930,6 @@ clipman_actions_class_init (ClipmanActionsClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (ClipmanActionsPrivate));
-
clipman_actions_parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
@@ -954,7 +950,7 @@ clipman_actions_init (ClipmanActions *actions)
{
gchar *filename;
- actions->priv = GET_PRIVATE (actions);
+ actions->priv = clipman_actions_get_instance_private (actions);
/* Actions file */
filename = g_strdup_printf ("%s/xfce4/panel/xfce4-clipman-actions.xml", g_get_user_config_dir ());
diff --git a/panel-plugin/collector.c b/panel-plugin/collector.c
index bf6d924..0d4b0ad 100644
--- a/panel-plugin/collector.c
+++ b/panel-plugin/collector.c
@@ -33,10 +33,6 @@
* GObject declarations
*/
-G_DEFINE_TYPE (ClipmanCollector, clipman_collector, G_TYPE_OBJECT)
-
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLIPMAN_TYPE_COLLECTOR, ClipmanCollectorPrivate))
-
struct _ClipmanCollectorPrivate
{
ClipmanActions *actions;
@@ -51,6 +47,8 @@ struct _ClipmanCollectorPrivate
gboolean inhibit;
};
+G_DEFINE_TYPE_WITH_PRIVATE (ClipmanCollector, clipman_collector, G_TYPE_OBJECT)
+
enum
{
ADD_PRIMARY_CLIPBOARD = 1,
@@ -295,8 +293,6 @@ clipman_collector_class_init (ClipmanCollectorClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (ClipmanCollectorPrivate));
-
clipman_collector_parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
@@ -337,7 +333,7 @@ clipman_collector_class_init (ClipmanCollectorClass *klass)
static void
clipman_collector_init (ClipmanCollector *collector)
{
- collector->priv = GET_PRIVATE (collector);
+ collector->priv = clipman_collector_get_instance_private (collector);
/* This bit is set to TRUE when a clipboard has to be set from within clipman
* while avoiding to re-add it to the history. */
diff --git a/panel-plugin/history.c b/panel-plugin/history.c
index abec3bc..fc314cf 100644
--- a/panel-plugin/history.c
+++ b/panel-plugin/history.c
@@ -33,10 +33,6 @@
* GObject declarations
*/
-G_DEFINE_TYPE (ClipmanHistory, clipman_history, G_TYPE_OBJECT)
-
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLIPMAN_TYPE_HISTORY, ClipmanHistoryPrivate))
-
struct _ClipmanHistoryPrivate
{
GSList *items;
@@ -47,6 +43,8 @@ struct _ClipmanHistoryPrivate
gboolean reorder_items;
};
+G_DEFINE_TYPE_WITH_PRIVATE (ClipmanHistory, clipman_history, G_TYPE_OBJECT)
+
enum
{
MAX_TEXTS_IN_HISTORY = 1,
@@ -428,8 +426,6 @@ clipman_history_class_init (ClipmanHistoryClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (ClipmanHistoryPrivate));
-
clipman_history_parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
@@ -485,7 +481,7 @@ clipman_history_class_init (ClipmanHistoryClass *klass)
static void
clipman_history_init (ClipmanHistory *history)
{
- history->priv = GET_PRIVATE (history);
+ history->priv = clipman_history_get_instance_private (history);
history->priv->item_to_restore = NULL;
}
diff --git a/panel-plugin/menu.c b/panel-plugin/menu.c
index 8ce4e1e..0aead1d 100644
--- a/panel-plugin/menu.c
+++ b/panel-plugin/menu.c
@@ -40,10 +40,6 @@
* GObject declarations
*/
-G_DEFINE_TYPE (ClipmanMenu, clipman_menu, GTK_TYPE_MENU)
-
-#define GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CLIPMAN_TYPE_MENU, ClipmanMenuPrivate))
-
struct _ClipmanMenuPrivate
{
GtkWidget *mi_clear_history;
@@ -58,6 +54,8 @@ struct _ClipmanMenuPrivate
gboolean never_confirm_history_clear;
};
+G_DEFINE_TYPE_WITH_PRIVATE (ClipmanMenu, clipman_menu, GTK_TYPE_MENU)
+
enum
{
REVERSE_ORDER = 1,
@@ -442,8 +440,6 @@ clipman_menu_class_init (ClipmanMenuClass *klass)
{
GObjectClass *object_class;
- g_type_class_add_private (klass, sizeof (ClipmanMenuPrivate));
-
clipman_menu_parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
@@ -495,7 +491,7 @@ clipman_menu_init (ClipmanMenu *menu)
GtkWidget *mi;
GtkWidget *image;
- menu->priv = GET_PRIVATE (menu);
+ menu->priv = clipman_menu_get_instance_private (menu);
/* ClipmanHistory */
menu->priv->history = clipman_history_get ();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list