Skip to content

Commit

Permalink
Avoid deprecated g_type_class_add_private under libcaja-private
Browse files Browse the repository at this point in the history
Changed CajaClipboardMonitor, CajaColumnChooser and CajaDesktopIconFile
  • Loading branch information
yetist authored and raveit65 committed Jan 31, 2019
1 parent 4196136 commit 9cd63d4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
10 changes: 3 additions & 7 deletions libcaja-private/caja-clipboard-monitor.c
Expand Up @@ -53,15 +53,15 @@ enum
LAST_SIGNAL
};

struct CajaClipboardMonitorDetails
struct _CajaClipboardMonitorPrivate
{
CajaClipboardInfo *info;
};

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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions libcaja-private/caja-clipboard-monitor.h
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions libcaja-private/caja-column-chooser.c
Expand Up @@ -31,7 +31,7 @@

#include "caja-column-utilities.h"

struct _CajaColumnChooserDetails
struct _CajaColumnChooserPrivate
{
GtkTreeView *view;
GtkListStore *store;
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions libcaja-private/caja-column-chooser.h
Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions libcaja-private/caja-desktop-icon-file.c
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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));
}
4 changes: 2 additions & 2 deletions libcaja-private/caja-desktop-icon-file.h
Expand Up @@ -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
Expand Down

0 comments on commit 9cd63d4

Please sign in to comment.