Skip to content

Commit 4196136

Browse files
yetistraveit65
authored and
raveit65
committed
Avoid deprecated g_type_class_add_private under src
Changed CajaConnectServerOperation, CajaDesktopWindow and CajaImagePropertiesPage
1 parent 328d820 commit 4196136

6 files changed

+24
-31
lines changed

src/caja-connect-server-operation.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828

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

31-
G_DEFINE_TYPE (CajaConnectServerOperation,
32-
caja_connect_server_operation, GTK_TYPE_MOUNT_OPERATION);
33-
3431
enum {
3532
PROP_DIALOG = 1,
3633
NUM_PROPERTIES
3734
};
3835

39-
struct _CajaConnectServerOperationDetails {
36+
struct _CajaConnectServerOperationPrivate {
4037
CajaConnectServerDialog *dialog;
4138
};
4239

40+
G_DEFINE_TYPE_WITH_PRIVATE (CajaConnectServerOperation,
41+
caja_connect_server_operation, GTK_TYPE_MOUNT_OPERATION);
42+
4343
static void
4444
fill_details_async_cb (GObject *source,
4545
GAsyncResult *result,
@@ -119,16 +119,12 @@ caja_connect_server_operation_class_init (CajaConnectServerOperationClass *klass
119119
CAJA_TYPE_CONNECT_SERVER_DIALOG,
120120
G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
121121
g_object_class_install_property (object_class, PROP_DIALOG, pspec);
122-
123-
g_type_class_add_private (klass, sizeof (CajaConnectServerOperationDetails));
124122
}
125123

126124
static void
127125
caja_connect_server_operation_init (CajaConnectServerOperation *self)
128126
{
129-
self->details = G_TYPE_INSTANCE_GET_PRIVATE (self,
130-
CAJA_TYPE_CONNECT_SERVER_OPERATION,
131-
CajaConnectServerOperationDetails);
127+
self->details = caja_connect_server_operation_get_instance_private (self);
132128
}
133129

134130
GMountOperation *

src/caja-connect-server-operation.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@
4242
#define CAJA_IS_CONNECT_SERVER_OPERATION(obj)\
4343
(G_TYPE_INSTANCE_CHECK_TYPE ((obj), CAJA_TYPE_CONNECT_SERVER_OPERATION)
4444

45-
typedef struct _CajaConnectServerOperationDetails
46-
CajaConnectServerOperationDetails;
45+
typedef struct _CajaConnectServerOperationPrivate
46+
CajaConnectServerOperationPrivate;
4747

4848
typedef struct {
4949
GtkMountOperation parent;
50-
CajaConnectServerOperationDetails *details;
50+
CajaConnectServerOperationPrivate *details;
5151
} CajaConnectServerOperation;
5252

5353
typedef struct {

src/caja-desktop-window.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ caja_desktop_window_accessible_class_init (CajaDesktopWindowAccessibleClass *kla
7272
aclass->get_attributes = desktop_get_attributes;
7373
}
7474

75-
struct CajaDesktopWindowDetails
75+
struct _CajaDesktopWindowPrivate
7676
{
7777
gulong size_changed_id;
7878

7979
gboolean loaded;
8080
};
8181

82-
G_DEFINE_TYPE (CajaDesktopWindow, caja_desktop_window,
82+
G_DEFINE_TYPE_WITH_PRIVATE (CajaDesktopWindow, caja_desktop_window,
8383
CAJA_TYPE_SPATIAL_WINDOW);
8484

8585
static void
@@ -88,8 +88,7 @@ caja_desktop_window_init (CajaDesktopWindow *window)
8888
GtkAction *action;
8989
AtkObject *accessible;
9090

91-
window->details = G_TYPE_INSTANCE_GET_PRIVATE (window, CAJA_TYPE_DESKTOP_WINDOW,
92-
CajaDesktopWindowDetails);
91+
window->details = caja_desktop_window_get_instance_private (window);
9392

9493
GtkStyleContext *context;
9594

@@ -222,7 +221,7 @@ static void
222221
unrealize (GtkWidget *widget)
223222
{
224223
CajaDesktopWindow *window;
225-
CajaDesktopWindowDetails *details;
224+
CajaDesktopWindowPrivate *details;
226225
GdkWindow *root_window;
227226

228227
window = CAJA_DESKTOP_WINDOW (widget);
@@ -280,7 +279,7 @@ static void
280279
realize (GtkWidget *widget)
281280
{
282281
CajaDesktopWindow *window;
283-
CajaDesktopWindowDetails *details;
282+
CajaDesktopWindowPrivate *details;
284283
window = CAJA_DESKTOP_WINDOW (widget);
285284
details = window->details;
286285

@@ -339,8 +338,6 @@ caja_desktop_window_class_init (CajaDesktopWindowClass *klass)
339338
nclass->window_type = CAJA_WINDOW_DESKTOP;
340339
nclass->get_title = real_get_title;
341340
nclass->get_icon = real_get_icon;
342-
343-
g_type_class_add_private (klass, sizeof (CajaDesktopWindowDetails));
344341
}
345342

346343
gboolean

src/caja-desktop-window.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
#define CAJA_DESKTOP_WINDOW_GET_CLASS(obj) \
4747
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_DESKTOP_WINDOW, CajaDesktopWindowClass))
4848

49-
typedef struct CajaDesktopWindowDetails CajaDesktopWindowDetails;
49+
typedef struct _CajaDesktopWindowPrivate CajaDesktopWindowPrivate;
5050

5151
typedef struct
5252
{
5353
CajaSpatialWindow parent_spot;
54-
CajaDesktopWindowDetails *details;
54+
CajaDesktopWindowPrivate *details;
5555
gboolean affect_desktop_on_next_location_change;
5656
} CajaDesktopWindow;
5757

src/caja-image-properties-page.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
#define LOAD_BUFFER_SIZE 8192
4848

49-
struct CajaImagePropertiesPageDetails
49+
struct _CajaImagePropertiesPagePrivate
5050
{
5151
GCancellable *cancellable;
5252
GtkWidget *vbox;
@@ -93,7 +93,7 @@ typedef struct
9393
static GType caja_image_properties_page_provider_get_type (void);
9494
static void property_page_provider_iface_init (CajaPropertyPageProviderIface *iface);
9595

96-
G_DEFINE_TYPE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_BOX);
96+
G_DEFINE_TYPE_WITH_PRIVATE (CajaImagePropertiesPage, caja_image_properties_page, GTK_TYPE_BOX);
9797

9898
G_DEFINE_TYPE_WITH_CODE (CajaImagePropertiesPageProvider, caja_image_properties_page_provider, G_TYPE_OBJECT,
9999
G_IMPLEMENT_INTERFACE (CAJA_TYPE_PROPERTY_PAGE_PROVIDER,
@@ -635,16 +635,12 @@ caja_image_properties_page_class_init (CajaImagePropertiesPageClass *class)
635635
object_class = G_OBJECT_CLASS (class);
636636

637637
object_class->finalize = caja_image_properties_page_finalize;
638-
639-
g_type_class_add_private (object_class, sizeof(CajaImagePropertiesPageDetails));
640638
}
641639

642640
static void
643641
caja_image_properties_page_init (CajaImagePropertiesPage *page)
644642
{
645-
page->details = G_TYPE_INSTANCE_GET_PRIVATE (page,
646-
CAJA_TYPE_IMAGE_PROPERTIES_PAGE,
647-
CajaImagePropertiesPageDetails);
643+
page->details = caja_image_properties_page_get_instance_private (page);
648644

649645
gtk_orientable_set_orientation (GTK_ORIENTABLE (page), GTK_ORIENTATION_VERTICAL);
650646

src/caja-image-properties-page.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#include <gtk/gtk.h>
2828

29+
G_BEGIN_DECLS
30+
2931
#define CAJA_TYPE_IMAGE_PROPERTIES_PAGE caja_image_properties_page_get_type()
3032
#define CAJA_IMAGE_PROPERTIES_PAGE(obj) \
3133
(G_TYPE_CHECK_INSTANCE_CAST ((obj), CAJA_TYPE_IMAGE_PROPERTIES_PAGE, CajaImagePropertiesPage))
@@ -38,12 +40,12 @@
3840
#define CAJA_IMAGE_PROPERTIES_PAGE_GET_CLASS(obj) \
3941
(G_TYPE_INSTANCE_GET_CLASS ((obj), CAJA_TYPE_IMAGE_PROPERTIES_PAGE, CajaImagePropertiesPageClass))
4042

41-
typedef struct CajaImagePropertiesPageDetails CajaImagePropertiesPageDetails;
43+
typedef struct _CajaImagePropertiesPagePrivate CajaImagePropertiesPagePrivate;
4244

4345
typedef struct
4446
{
4547
GtkBox parent;
46-
CajaImagePropertiesPageDetails *details;
48+
CajaImagePropertiesPagePrivate *details;
4749
} CajaImagePropertiesPage;
4850

4951
typedef struct
@@ -54,4 +56,6 @@ typedef struct
5456
GType caja_image_properties_page_get_type (void);
5557
void caja_image_properties_page_register (void);
5658

59+
G_END_DECLS
60+
5761
#endif /* CAJA_IMAGE_PROPERTIES_PAGE_H */

0 commit comments

Comments
 (0)