Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid deprecated g_type_class_add_private under src
Changed CajaConnectServerOperation, CajaDesktopWindow and CajaImagePropertiesPage
  • Loading branch information
yetist authored and raveit65 committed Jan 31, 2019
1 parent 328d820 commit 4196136
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
14 changes: 5 additions & 9 deletions src/caja-connect-server-operation.c
Expand Up @@ -28,18 +28,18 @@

#include "caja-connect-server-dialog.h"

G_DEFINE_TYPE (CajaConnectServerOperation,
caja_connect_server_operation, GTK_TYPE_MOUNT_OPERATION);

enum {
PROP_DIALOG = 1,
NUM_PROPERTIES
};

struct _CajaConnectServerOperationDetails {
struct _CajaConnectServerOperationPrivate {
CajaConnectServerDialog *dialog;
};

G_DEFINE_TYPE_WITH_PRIVATE (CajaConnectServerOperation,
caja_connect_server_operation, GTK_TYPE_MOUNT_OPERATION);

static void
fill_details_async_cb (GObject *source,
GAsyncResult *result,
Expand Down Expand Up @@ -119,16 +119,12 @@ caja_connect_server_operation_class_init (CajaConnectServerOperationClass *klass
CAJA_TYPE_CONNECT_SERVER_DIALOG,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_DIALOG, pspec);

g_type_class_add_private (klass, sizeof (CajaConnectServerOperationDetails));
}

static void
caja_connect_server_operation_init (CajaConnectServerOperation *self)
{
self->details = G_TYPE_INSTANCE_GET_PRIVATE (self,
CAJA_TYPE_CONNECT_SERVER_OPERATION,
CajaConnectServerOperationDetails);
self->details = caja_connect_server_operation_get_instance_private (self);
}

GMountOperation *
Expand Down
6 changes: 3 additions & 3 deletions src/caja-connect-server-operation.h
Expand Up @@ -42,12 +42,12 @@
#define CAJA_IS_CONNECT_SERVER_OPERATION(obj)\
(G_TYPE_INSTANCE_CHECK_TYPE ((obj), CAJA_TYPE_CONNECT_SERVER_OPERATION)

typedef struct _CajaConnectServerOperationDetails
CajaConnectServerOperationDetails;
typedef struct _CajaConnectServerOperationPrivate
CajaConnectServerOperationPrivate;

typedef struct {
GtkMountOperation parent;
CajaConnectServerOperationDetails *details;
CajaConnectServerOperationPrivate *details;
} CajaConnectServerOperation;

typedef struct {
Expand Down
13 changes: 5 additions & 8 deletions src/caja-desktop-window.c
Expand Up @@ -72,14 +72,14 @@ caja_desktop_window_accessible_class_init (CajaDesktopWindowAccessibleClass *kla
aclass->get_attributes = desktop_get_attributes;
}

struct CajaDesktopWindowDetails
struct _CajaDesktopWindowPrivate
{
gulong size_changed_id;

gboolean loaded;
};

G_DEFINE_TYPE (CajaDesktopWindow, caja_desktop_window,
G_DEFINE_TYPE_WITH_PRIVATE (CajaDesktopWindow, caja_desktop_window,
CAJA_TYPE_SPATIAL_WINDOW);

static void
Expand All @@ -88,8 +88,7 @@ caja_desktop_window_init (CajaDesktopWindow *window)
GtkAction *action;
AtkObject *accessible;

window->details = G_TYPE_INSTANCE_GET_PRIVATE (window, CAJA_TYPE_DESKTOP_WINDOW,
CajaDesktopWindowDetails);
window->details = caja_desktop_window_get_instance_private (window);

GtkStyleContext *context;

Expand Down Expand Up @@ -222,7 +221,7 @@ static void
unrealize (GtkWidget *widget)
{
CajaDesktopWindow *window;
CajaDesktopWindowDetails *details;
CajaDesktopWindowPrivate *details;
GdkWindow *root_window;

window = CAJA_DESKTOP_WINDOW (widget);
Expand Down Expand Up @@ -280,7 +279,7 @@ static void
realize (GtkWidget *widget)
{
CajaDesktopWindow *window;
CajaDesktopWindowDetails *details;
CajaDesktopWindowPrivate *details;
window = CAJA_DESKTOP_WINDOW (widget);
details = window->details;

Expand Down Expand Up @@ -339,8 +338,6 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass)
nclass->window_type = CAJA_WINDOW_DESKTOP;
nclass->get_title = real_get_title;
nclass->get_icon = real_get_icon;

g_type_class_add_private (klass, sizeof (CajaDesktopWindowDetails));
}

gboolean
Expand Down
4 changes: 2 additions & 2 deletions src/caja-desktop-window.h
Expand Up @@ -46,12 +46,12 @@
#define CAJA_DESKTOP_WINDOW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_DESKTOP_WINDOW, CajaDesktopWindowClass))

typedef struct CajaDesktopWindowDetails CajaDesktopWindowDetails;
typedef struct _CajaDesktopWindowPrivate CajaDesktopWindowPrivate;

typedef struct
{
CajaSpatialWindow parent_spot;
CajaDesktopWindowDetails *details;
CajaDesktopWindowPrivate *details;
gboolean affect_desktop_on_next_location_change;
} CajaDesktopWindow;

Expand Down
10 changes: 3 additions & 7 deletions src/caja-image-properties-page.c
Expand Up @@ -46,7 +46,7 @@

#define LOAD_BUFFER_SIZE 8192

struct CajaImagePropertiesPageDetails
struct _CajaImagePropertiesPagePrivate
{
GCancellable *cancellable;
GtkWidget *vbox;
Expand Down Expand Up @@ -93,7 +93,7 @@ typedef struct
static GType caja_image_properties_page_provider_get_type (void);
static void property_page_provider_iface_init (CajaPropertyPageProviderIface *iface);

G_DEFINE_TYPE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_BOX);
G_DEFINE_TYPE_WITH_PRIVATE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_BOX);

G_DEFINE_TYPE_WITH_CODE (CajaImagePropertiesPageProvider, caja_image_properties_page_provider, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
Expand Down Expand Up @@ -635,16 +635,12 @@ caja_image_properties_page_class_init (CajaImagePropertiesPageClass *class)
object_class = G_OBJECT_CLASS (class);

object_class->finalize = caja_image_properties_page_finalize;

g_type_class_add_private (object_class, sizeof(CajaImagePropertiesPageDetails));
}

static void
caja_image_properties_page_init (CajaImagePropertiesPage *page)
{
page->details = G_TYPE_INSTANCE_GET_PRIVATE (page,
CAJA_TYPE_IMAGE_PROPERTIES_PAGE,
CajaImagePropertiesPageDetails);
page->details = caja_image_properties_page_get_instance_private (page);

gtk_orientable_set_orientation (GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);

Expand Down
8 changes: 6 additions & 2 deletions src/caja-image-properties-page.h
Expand Up @@ -26,6 +26,8 @@

#include <gtk/gtk.h>

G_BEGIN_DECLS

#define CAJA_TYPE_IMAGE_PROPERTIES_PAGE caja_image_properties_page_get_type()
#define CAJA_IMAGE_PROPERTIES_PAGE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_IMAGE_PROPERTIES_PAGE, CajaImagePropertiesPage))
Expand All @@ -38,12 +40,12 @@
#define CAJA_IMAGE_PROPERTIES_PAGE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_IMAGE_PROPERTIES_PAGE, CajaImagePropertiesPageClass))

typedef struct CajaImagePropertiesPageDetails CajaImagePropertiesPageDetails;
typedef struct _CajaImagePropertiesPagePrivate CajaImagePropertiesPagePrivate;

typedef struct
{
GtkBox parent;
CajaImagePropertiesPageDetails *details;
CajaImagePropertiesPagePrivate *details;
} CajaImagePropertiesPage;

typedef struct
Expand All @@ -54,4 +56,6 @@ typedef struct
GType caja_image_properties_page_get_type (void);
void caja_image_properties_page_register (void);

G_END_DECLS

#endif /* CAJA_IMAGE_PROPERTIES_PAGE_H */

0 comments on commit 4196136

Please sign in to comment.