summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-01-21 12:58:25 +0800
committerlukefromdc <[email protected]>2019-01-22 04:37:40 +0000
commitd373d6c83354d9c3169a5588da33372ecca4f75c (patch)
tree44220eabb12e1309a1a4614d0f963095fcd79bf0
parenta9211bd0f251b891ef506ed0af8b574ae8e3fee9 (diff)
downloadcaja-d373d6c83354d9c3169a5588da33372ecca4f75c.tar.bz2
caja-d373d6c83354d9c3169a5588da33372ecca4f75c.tar.xz
CajaApplication: avoid deprecated 'g_type_class_add_private'
-rw-r--r--src/caja-application.c10
-rw-r--r--src/caja-application.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/src/caja-application.c b/src/caja-application.c
index 94a1727b..ce9c57e1 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -105,8 +105,7 @@ static CajaFreedesktopDBus *fdb_manager = NULL;
static char * caja_application_get_session_data (CajaApplication *self);
void caja_application_quit (CajaApplication *self);
-G_DEFINE_TYPE (CajaApplication, caja_application, GTK_TYPE_APPLICATION);
-struct _CajaApplicationPriv {
+struct _CajaApplicationPrivate {
GVolumeMonitor *volume_monitor;
gboolean no_desktop;
gboolean force_desktop;
@@ -114,6 +113,8 @@ struct _CajaApplicationPriv {
gchar *geometry;
};
+G_DEFINE_TYPE_WITH_PRIVATE (CajaApplication, caja_application, GTK_TYPE_APPLICATION);
+
GList *
caja_application_get_spatial_window_list (void)
{
@@ -428,9 +429,7 @@ static void
caja_application_init (CajaApplication *application)
{
GSimpleAction *action;
- application->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (application, CAJA_TYPE_APPLICATION,
- CajaApplicationPriv);
+ application->priv = caja_application_get_instance_private (application);
action = g_simple_action_new ("quit", NULL);
g_action_map_add_action (G_ACTION_MAP (application), G_ACTION (action));
@@ -2479,7 +2478,6 @@ caja_application_class_init (CajaApplicationClass *class)
application_class->open = caja_application_open;
application_class->local_command_line = caja_application_local_command_line;
- g_type_class_add_private (class, sizeof (CajaApplicationPriv));
}
CajaApplication *
diff --git a/src/caja-application.h b/src/caja-application.h
index 7a191e90..7c72bb61 100644
--- a/src/caja-application.h
+++ b/src/caja-application.h
@@ -59,12 +59,12 @@ typedef struct CajaWindow CajaWindow;
typedef struct _CajaSpatialWindow CajaSpatialWindow;
#endif
-typedef struct _CajaApplicationPriv CajaApplicationPriv;
+typedef struct _CajaApplicationPrivate CajaApplicationPrivate;
typedef struct
{
GtkApplication parent;
- CajaApplicationPriv *priv;
+ CajaApplicationPrivate *priv;
EggSMClient* smclient;
GVolumeMonitor* volume_monitor;