summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-01-26 12:06:01 +0800
committerraveit65 <[email protected]>2019-01-31 12:24:30 +0100
commit9cd63d4532ec29f9ed133e4f6d8ae07b241de416 (patch)
treed8a02f94d7a24b8fd8ad49439ecce5159f0c19f3 /libcaja-private
parent419613671dcf6ec55d8dc49f7bbbb9d11c19d54c (diff)
downloadcaja-9cd63d4532ec29f9ed133e4f6d8ae07b241de416.tar.bz2
caja-9cd63d4532ec29f9ed133e4f6d8ae07b241de416.tar.xz
Avoid deprecated g_type_class_add_private under libcaja-private
Changed CajaClipboardMonitor, CajaColumnChooser and CajaDesktopIconFile
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-clipboard-monitor.c10
-rw-r--r--libcaja-private/caja-clipboard-monitor.h4
-rw-r--r--libcaja-private/caja-column-chooser.c8
-rw-r--r--libcaja-private/caja-column-chooser.h4
-rw-r--r--libcaja-private/caja-desktop-icon-file.c12
-rw-r--r--libcaja-private/caja-desktop-icon-file.h4
6 files changed, 15 insertions, 27 deletions
diff --git a/libcaja-private/caja-clipboard-monitor.c b/libcaja-private/caja-clipboard-monitor.c
index eabb7844..e9507a72 100644
--- a/libcaja-private/caja-clipboard-monitor.c
+++ b/libcaja-private/caja-clipboard-monitor.c
@@ -53,7 +53,7 @@ enum
LAST_SIGNAL
};
-struct CajaClipboardMonitorDetails
+struct _CajaClipboardMonitorPrivate
{
CajaClipboardInfo *info;
};
@@ -61,7 +61,7 @@ struct CajaClipboardMonitorDetails
static guint signals[LAST_SIGNAL] = { 0 };
static GdkAtom copied_files_atom;
-G_DEFINE_TYPE (CajaClipboardMonitor, caja_clipboard_monitor, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (CajaClipboardMonitor, caja_clipboard_monitor, G_TYPE_OBJECT);
static CajaClipboardMonitor *clipboard_monitor = NULL;
@@ -141,9 +141,7 @@ caja_clipboard_info_free (CajaClipboardInfo *info)
static void
caja_clipboard_monitor_init (CajaClipboardMonitor *monitor)
{
- monitor->details =
- G_TYPE_INSTANCE_GET_PRIVATE (monitor, CAJA_TYPE_CLIPBOARD_MONITOR,
- CajaClipboardMonitorDetails);
+ monitor->details = caja_clipboard_monitor_get_instance_private (monitor);
}
static void
@@ -189,8 +187,6 @@ caja_clipboard_monitor_class_init (CajaClipboardMonitorClass *klass)
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE,
1, G_TYPE_POINTER);
-
- g_type_class_add_private (klass, sizeof (CajaClipboardMonitorDetails));
}
void
diff --git a/libcaja-private/caja-clipboard-monitor.h b/libcaja-private/caja-clipboard-monitor.h
index 8ea4e686..b378a778 100644
--- a/libcaja-private/caja-clipboard-monitor.h
+++ b/libcaja-private/caja-clipboard-monitor.h
@@ -39,14 +39,14 @@
#define CAJA_CLIPBOARD_MONITOR_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_CLIPBOARD_MONITOR, CajaClipboardMonitorClass))
-typedef struct CajaClipboardMonitorDetails CajaClipboardMonitorDetails;
+typedef struct _CajaClipboardMonitorPrivate CajaClipboardMonitorPrivate;
typedef struct CajaClipboardInfo CajaClipboardInfo;
typedef struct
{
GObject parent_slot;
- CajaClipboardMonitorDetails *details;
+ CajaClipboardMonitorPrivate *details;
} CajaClipboardMonitor;
typedef struct
diff --git a/libcaja-private/caja-column-chooser.c b/libcaja-private/caja-column-chooser.c
index 0e2520a5..0c50f2d0 100644
--- a/libcaja-private/caja-column-chooser.c
+++ b/libcaja-private/caja-column-chooser.c
@@ -31,7 +31,7 @@
#include "caja-column-utilities.h"
-struct _CajaColumnChooserDetails
+struct _CajaColumnChooserPrivate
{
GtkTreeView *view;
GtkListStore *store;
@@ -65,7 +65,7 @@ enum
};
static guint signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE(CajaColumnChooser, caja_column_chooser, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_PRIVATE (CajaColumnChooser, caja_column_chooser, GTK_TYPE_BOX);
static void caja_column_chooser_constructed (GObject *object);
@@ -128,8 +128,6 @@ caja_column_chooser_class_init (CajaColumnChooserClass *chooser_class)
CAJA_TYPE_FILE,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_WRITABLE));
-
- g_type_class_add_private (chooser_class, sizeof (CajaColumnChooserDetails));
}
static void
@@ -463,7 +461,7 @@ caja_column_chooser_constructed (GObject *object)
static void
caja_column_chooser_init (CajaColumnChooser *chooser)
{
- chooser->details = G_TYPE_INSTANCE_GET_PRIVATE ((chooser), CAJA_TYPE_COLUMN_CHOOSER, CajaColumnChooserDetails);
+ chooser->details = caja_column_chooser_get_instance_private (chooser);
g_object_set (G_OBJECT (chooser),
"homogeneous", FALSE,
diff --git a/libcaja-private/caja-column-chooser.h b/libcaja-private/caja-column-chooser.h
index b0596623..3a25080e 100644
--- a/libcaja-private/caja-column-chooser.h
+++ b/libcaja-private/caja-column-chooser.h
@@ -40,13 +40,13 @@
#define CAJA_COLUMN_CHOOSER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_COLUMN_CHOOSER, CajaColumnChooserClass))
-typedef struct _CajaColumnChooserDetails CajaColumnChooserDetails;
+typedef struct _CajaColumnChooserPrivate CajaColumnChooserPrivate;
typedef struct
{
GtkBox parent;
- CajaColumnChooserDetails *details;
+ CajaColumnChooserPrivate *details;
} CajaColumnChooser;
typedef struct
diff --git a/libcaja-private/caja-desktop-icon-file.c b/libcaja-private/caja-desktop-icon-file.c
index ede7f2e1..a91b926d 100644
--- a/libcaja-private/caja-desktop-icon-file.c
+++ b/libcaja-private/caja-desktop-icon-file.c
@@ -40,12 +40,12 @@
#include <string.h>
#include <gio/gio.h>
-struct CajaDesktopIconFileDetails
+struct _CajaDesktopIconFilePrivate
{
CajaDesktopLink *link;
};
-G_DEFINE_TYPE(CajaDesktopIconFile, caja_desktop_icon_file, CAJA_TYPE_FILE)
+G_DEFINE_TYPE_WITH_PRIVATE (CajaDesktopIconFile, caja_desktop_icon_file, CAJA_TYPE_FILE)
static void
@@ -166,9 +166,7 @@ desktop_icon_file_get_where_string (CajaFile *file)
static void
caja_desktop_icon_file_init (CajaDesktopIconFile *desktop_file)
{
- desktop_file->details = G_TYPE_INSTANCE_GET_PRIVATE (desktop_file,
- CAJA_TYPE_DESKTOP_ICON_FILE,
- CajaDesktopIconFileDetails);
+ desktop_file->details = caja_desktop_icon_file_get_instance_private (desktop_file);
}
static void
@@ -384,10 +382,8 @@ caja_desktop_icon_file_set_metadata_as_list (CajaFile *file,
static void
caja_desktop_icon_file_class_init (CajaDesktopIconFileClass *klass)
{
- GObjectClass *object_class;
CajaFileClass *file_class;
- object_class = G_OBJECT_CLASS (klass);
file_class = CAJA_FILE_CLASS (klass);
file_class->default_file_type = G_FILE_TYPE_DIRECTORY;
@@ -405,6 +401,4 @@ caja_desktop_icon_file_class_init (CajaDesktopIconFileClass *klass)
file_class->set_metadata_as_list = caja_desktop_icon_file_set_metadata_as_list;
file_class->unmount = caja_desktop_icon_file_unmount;
file_class->eject = caja_desktop_icon_file_eject;
-
- g_type_class_add_private (object_class, sizeof(CajaDesktopIconFileDetails));
}
diff --git a/libcaja-private/caja-desktop-icon-file.h b/libcaja-private/caja-desktop-icon-file.h
index f65f82a0..280fbe81 100644
--- a/libcaja-private/caja-desktop-icon-file.h
+++ b/libcaja-private/caja-desktop-icon-file.h
@@ -41,12 +41,12 @@
#define CAJA_DESKTOP_ICON_FILE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_DESKTOP_ICON_FILE, CajaDesktopIconFileClass))
-typedef struct CajaDesktopIconFileDetails CajaDesktopIconFileDetails;
+typedef struct _CajaDesktopIconFilePrivate CajaDesktopIconFilePrivate;
typedef struct
{
CajaFile parent_slot;
- CajaDesktopIconFileDetails *details;
+ CajaDesktopIconFilePrivate *details;
} CajaDesktopIconFile;
typedef struct