Commit 179a8e59 authored by Zeeshan Ali's avatar Zeeshan Ali

Drop use of deprecated g_type_class_add_private()

Use the G_ADD_PRIVATE() macro instead.

This doesn't fix the issue in geocode-glib but that's not an issue since
we plan to drop geocode-glib (#88).

Fixes #98.
parent ccbcbb79
......@@ -40,18 +40,19 @@ gclue_service_agent_agent_iface_init (GClueAgentIface *iface);
static void
gclue_service_agent_constructed (GObject *object);
G_DEFINE_TYPE_WITH_CODE (GClueServiceAgent,
gclue_service_agent,
GCLUE_TYPE_AGENT_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_TYPE_AGENT,
gclue_service_agent_agent_iface_init))
struct _GClueServiceAgentPrivate
{
GDBusConnection *connection;
GDBusProxy *manager_proxy;
};
G_DEFINE_TYPE_WITH_CODE (GClueServiceAgent,
gclue_service_agent,
GCLUE_TYPE_AGENT_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_TYPE_AGENT,
gclue_service_agent_agent_iface_init)
G_ADD_PRIVATE (GClueServiceAgent))
enum
{
PROP_0,
......@@ -119,8 +120,6 @@ gclue_service_agent_class_init (GClueServiceAgentClass *klass)
object_class->set_property = gclue_service_agent_set_property;
object_class->constructed = gclue_service_agent_constructed;
g_type_class_add_private (object_class, sizeof (GClueServiceAgentPrivate));
gParamSpecs[PROP_CONNECTION] = g_param_spec_object ("connection",
"Connection",
"DBus Connection",
......
......@@ -52,12 +52,6 @@
static void
gclue_simple_async_initable_init (GAsyncInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueSimple,
gclue_simple,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
gclue_simple_async_initable_init));
struct _GClueSimplePrivate
{
char *desktop_id;
......@@ -72,6 +66,13 @@ struct _GClueSimplePrivate
GCancellable *cancellable;
};
G_DEFINE_TYPE_WITH_CODE (GClueSimple,
gclue_simple,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
gclue_simple_async_initable_init)
G_ADD_PRIVATE (GClueSimple));
enum
{
PROP_0,
......@@ -159,8 +160,6 @@ gclue_simple_class_init (GClueSimpleClass *klass)
object_class->get_property = gclue_simple_get_property;
object_class->set_property = gclue_simple_set_property;
g_type_class_add_private (object_class, sizeof (GClueSimplePrivate));
/**
* GClueSimple:desktop-id:
*
......
......@@ -45,7 +45,10 @@ struct _GClue3GPrivate {
GClue3GTower *tower;
};
G_DEFINE_TYPE (GClue3G, gclue_3g, GCLUE_TYPE_WEB_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GClue3G,
gclue_3g,
GCLUE_TYPE_WEB_SOURCE,
G_ADD_PRIVATE (GClue3G))
static gboolean
gclue_3g_start (GClueLocationSource *source);
......@@ -142,8 +145,6 @@ gclue_3g_class_init (GClue3GClass *klass)
web_class->parse_response = gclue_3g_parse_response;
web_class->get_available_accuracy_level =
gclue_3g_get_available_accuracy_level;
g_type_class_add_private (klass, sizeof (GClue3GPrivate));
}
static void
......
......@@ -42,8 +42,10 @@ struct _GClueCDMAPrivate {
gulong cdma_notify_id;
};
G_DEFINE_TYPE (GClueCDMA, gclue_cdma, GCLUE_TYPE_LOCATION_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GClueCDMA,
gclue_cdma,
GCLUE_TYPE_LOCATION_SOURCE,
G_ADD_PRIVATE (GClueCDMA))
static gboolean
gclue_cdma_start (GClueLocationSource *source);
......@@ -132,8 +134,6 @@ gclue_cdma_class_init (GClueCDMAClass *klass)
source_class->start = gclue_cdma_start;
source_class->stop = gclue_cdma_stop;
g_type_class_add_private (klass, sizeof (GClueCDMAPrivate));
}
static void
......
......@@ -29,12 +29,6 @@
static void
gclue_client_info_async_initable_init (GAsyncInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueClientInfo,
gclue_client_info,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
gclue_client_info_async_initable_init));
struct _GClueClientInfoPrivate
{
char *bus_name;
......@@ -46,6 +40,13 @@ struct _GClueClientInfoPrivate
char *xdg_id;
};
G_DEFINE_TYPE_WITH_CODE (GClueClientInfo,
gclue_client_info,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE,
gclue_client_info_async_initable_init)
G_ADD_PRIVATE (GClueClientInfo));
enum
{
PROP_0,
......@@ -135,8 +136,6 @@ gclue_client_info_class_init (GClueClientInfoClass *klass)
object_class->get_property = gclue_client_info_get_property;
object_class->set_property = gclue_client_info_set_property;
g_type_class_add_private (object_class, sizeof (GClueClientInfoPrivate));
gParamSpecs[PROP_PEER] = g_param_spec_string ("bus-name",
"BusName",
"Bus name of client",
......
......@@ -30,8 +30,6 @@
* @include: gclue-glib/gclue-compass.h
**/
G_DEFINE_TYPE (GClueCompass, gclue_compass, G_TYPE_OBJECT)
struct _GClueCompassPrivate
{
Compass *proxy;
......@@ -39,6 +37,11 @@ struct _GClueCompassPrivate
GCancellable *cancellable;
};
G_DEFINE_TYPE_WITH_CODE (GClueCompass,
gclue_compass,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GClueCompass))
enum
{
PROP_0,
......@@ -100,7 +103,6 @@ gclue_compass_class_init (GClueCompassClass *klass)
object_class = G_OBJECT_CLASS (klass);
object_class->get_property = gclue_compass_get_property;
object_class->finalize = gclue_compass_finalize;
g_type_class_add_private (object_class, sizeof (GClueCompassPrivate));
/**
* GClueCompass:heading
......
......@@ -29,25 +29,6 @@
/* This class will be responsible for fetching configuration. */
G_DEFINE_TYPE (GClueConfig, gclue_config, G_TYPE_OBJECT)
typedef struct
{
char *id;
gboolean allowed;
gboolean system;
int* users;
gsize num_users;
} AppConfig;
static void
app_config_free (AppConfig *app_config)
{
g_free (app_config->id);
g_free (app_config->users);
g_slice_free (AppConfig, app_config);
}
struct _GClueConfigPrivate
{
GKeyFile *key_file;
......@@ -68,6 +49,28 @@ struct _GClueConfigPrivate
GList *app_configs;
};
G_DEFINE_TYPE_WITH_CODE (GClueConfig,
gclue_config,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GClueConfig))
typedef struct
{
char *id;
gboolean allowed;
gboolean system;
int* users;
gsize num_users;
} AppConfig;
static void
app_config_free (AppConfig *app_config)
{
g_free (app_config->id);
g_free (app_config->users);
g_slice_free (AppConfig, app_config);
}
static void
gclue_config_finalize (GObject *object)
{
......@@ -93,7 +96,6 @@ gclue_config_class_init (GClueConfigClass *klass)
object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gclue_config_finalize;
g_type_class_add_private (object_class, sizeof (GClueConfigPrivate));
}
static void
......
......@@ -36,8 +36,6 @@ start_source (GClueLocationSource *source);
static gboolean
stop_source (GClueLocationSource *source);
G_DEFINE_ABSTRACT_TYPE (GClueLocationSource, gclue_location_source, G_TYPE_OBJECT)
struct _GClueLocationSourcePrivate
{
GClueLocation *location;
......@@ -55,6 +53,11 @@ struct _GClueLocationSourcePrivate
guint heading_changed_id;
};
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GClueLocationSource,
gclue_location_source,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GClueLocationSource))
enum
{
PROP_0,
......@@ -205,7 +208,6 @@ gclue_location_source_class_init (GClueLocationSourceClass *klass)
object_class->get_property = gclue_location_source_get_property;
object_class->set_property = gclue_location_source_set_property;
object_class->finalize = gclue_location_source_finalize;
g_type_class_add_private (object_class, sizeof (GClueLocationSourcePrivate));
gParamSpecs[PROP_LOCATION] = g_param_spec_object ("location",
"Location",
......
......@@ -42,7 +42,10 @@ enum {
PROP_HEADING,
};
G_DEFINE_TYPE (GClueLocation, gclue_location, GEOCODE_TYPE_LOCATION);
G_DEFINE_TYPE_WITH_CODE (GClueLocation,
gclue_location,
GEOCODE_TYPE_LOCATION,
G_ADD_PRIVATE (GClueLocation));
static void
gclue_location_get_property (GObject *object,
......@@ -112,8 +115,6 @@ gclue_location_class_init (GClueLocationClass *klass)
glocation_class->get_property = gclue_location_get_property;
glocation_class->set_property = gclue_location_set_property;
g_type_class_add_private (klass, sizeof (GClueLocationPrivate));
/**
* GClueLocation:speed
*
......
......@@ -54,8 +54,6 @@ gclue_locator_start (GClueLocationSource *source);
static gboolean
gclue_locator_stop (GClueLocationSource *source);
G_DEFINE_TYPE (GClueLocator, gclue_locator, GCLUE_TYPE_LOCATION_SOURCE)
struct _GClueLocatorPrivate
{
GList *sources;
......@@ -66,6 +64,11 @@ struct _GClueLocatorPrivate
guint time_threshold;
};
G_DEFINE_TYPE_WITH_CODE (GClueLocator,
gclue_locator,
GCLUE_TYPE_LOCATION_SOURCE,
G_ADD_PRIVATE (GClueLocator))
enum
{
PROP_0,
......@@ -409,7 +412,6 @@ gclue_locator_class_init (GClueLocatorClass *klass)
object_class->set_property = gclue_locator_set_property;
object_class->finalize = gclue_locator_finalize;
object_class->constructed = gclue_locator_constructed;
g_type_class_add_private (object_class, sizeof (GClueLocatorPrivate));
gParamSpecs[PROP_ACCURACY_LEVEL] = g_param_spec_enum ("accuracy-level",
"AccuracyLevel",
......
......@@ -33,8 +33,6 @@
* by different applications.
**/
G_DEFINE_TYPE (GClueMinUINT, gclue_min_uint, G_TYPE_OBJECT)
struct _GClueMinUINTPrivate
{
GHashTable *all_values;
......@@ -42,6 +40,11 @@ struct _GClueMinUINTPrivate
gboolean notify_value;
};
G_DEFINE_TYPE_WITH_CODE (GClueMinUINT,
gclue_min_uint,
G_TYPE_OBJECT,
G_ADD_PRIVATE (GClueMinUINT))
enum
{
PROP_0,
......@@ -116,8 +119,6 @@ gclue_min_uint_class_init (GClueMinUINTClass *klass)
object_class->finalize = gclue_min_uint_finalize;
object_class->get_property = gclue_min_uint_get_property;
g_type_class_add_private (object_class, sizeof (GClueMinUINTPrivate));
gParamSpecs[PROP_VALUE] = g_param_spec_uint ("value",
"Value",
"The minimum value",
......
......@@ -43,7 +43,10 @@ struct _GClueModemGPSPrivate {
};
G_DEFINE_TYPE (GClueModemGPS, gclue_modem_gps, GCLUE_TYPE_LOCATION_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GClueModemGPS,
gclue_modem_gps,
GCLUE_TYPE_LOCATION_SOURCE,
G_ADD_PRIVATE (GClueModemGPS))
static gboolean
gclue_modem_gps_start (GClueLocationSource *source);
......@@ -144,8 +147,6 @@ gclue_modem_gps_class_init (GClueModemGPSClass *klass)
source_class->start = gclue_modem_gps_start;
source_class->stop = gclue_modem_gps_stop;
g_type_class_add_private (klass, sizeof (GClueModemGPSPrivate));
}
static void
......
......@@ -37,10 +37,6 @@
static void
gclue_modem_interface_init (GClueModemInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueModemManager, gclue_modem_manager, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GCLUE_TYPE_MODEM,
gclue_modem_interface_init))
struct _GClueModemManagerPrivate {
MMManager *manager;
MMObject *mm_object;
......@@ -56,6 +52,11 @@ struct _GClueModemManagerPrivate {
guint time_threshold;
};
G_DEFINE_TYPE_WITH_CODE (GClueModemManager, gclue_modem_manager, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (GCLUE_TYPE_MODEM,
gclue_modem_interface_init)
G_ADD_PRIVATE (GClueModemManager))
enum
{
PROP_0,
......@@ -210,8 +211,6 @@ gclue_modem_manager_class_init (GClueModemManagerClass *klass)
gmodem_class->finalize = gclue_modem_manager_finalize;
gmodem_class->constructed = gclue_modem_manager_constructed;
g_type_class_add_private (klass, sizeof (GClueModemManagerPrivate));
g_object_class_override_property (gmodem_class,
PROP_IS_3G_AVAILABLE,
"is-3g-available");
......
......@@ -51,7 +51,10 @@ struct _GClueNMEASourcePrivate {
GList *all_services;
};
G_DEFINE_TYPE (GClueNMEASource, gclue_nmea_source, GCLUE_TYPE_LOCATION_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GClueNMEASource,
gclue_nmea_source,
GCLUE_TYPE_LOCATION_SOURCE,
G_ADD_PRIVATE (GClueNMEASource))
static gboolean
gclue_nmea_source_start (GClueLocationSource *source);
......@@ -612,8 +615,6 @@ gclue_nmea_source_class_init (GClueNMEASourceClass *klass)
source_class->start = gclue_nmea_source_start;
source_class->stop = gclue_nmea_source_stop;
g_type_class_add_private (klass, sizeof (GClueNMEASourcePrivate));
}
static void
......
......@@ -36,14 +36,6 @@ gclue_service_client_client_iface_init (GClueDBusClientIface *iface);
static void
gclue_service_client_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueServiceClient,
gclue_service_client,
GCLUE_DBUS_TYPE_CLIENT_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_CLIENT,
gclue_service_client_client_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_client_initable_iface_init));
typedef struct _StartData StartData;
struct _GClueServiceClientPrivate
......@@ -68,6 +60,15 @@ struct _GClueServiceClientPrivate
gboolean agent_stopped; /* Agent stopped client, not the app */
};
G_DEFINE_TYPE_WITH_CODE (GClueServiceClient,
gclue_service_client,
GCLUE_DBUS_TYPE_CLIENT_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_CLIENT,
gclue_service_client_client_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_client_initable_iface_init)
G_ADD_PRIVATE (GClueServiceClient));
enum
{
PROP_0,
......@@ -882,8 +883,6 @@ gclue_service_client_class_init (GClueServiceClientClass *klass)
skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
skeleton_class->get_vtable = gclue_service_client_get_vtable;
g_type_class_add_private (object_class, sizeof (GClueServiceClientPrivate));
gParamSpecs[PROP_CLIENT_INFO] = g_param_spec_object ("client-info",
"ClientInfo",
"Information on client",
......
......@@ -27,12 +27,6 @@
static void
gclue_service_location_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueServiceLocation,
gclue_service_location,
GCLUE_DBUS_TYPE_LOCATION_SKELETON,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_location_initable_iface_init));
struct _GClueServiceLocationPrivate
{
GClueClientInfo *client_info;
......@@ -40,6 +34,13 @@ struct _GClueServiceLocationPrivate
GDBusConnection *connection;
};
G_DEFINE_TYPE_WITH_CODE (GClueServiceLocation,
gclue_service_location,
GCLUE_DBUS_TYPE_LOCATION_SKELETON,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_location_initable_iface_init)
G_ADD_PRIVATE (GClueServiceLocation));
enum
{
PROP_0,
......@@ -306,8 +307,6 @@ gclue_service_location_class_init (GClueServiceLocationClass *klass)
skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
skeleton_class->get_vtable = gclue_service_location_get_vtable;
g_type_class_add_private (object_class, sizeof (GClueServiceLocationPrivate));
gParamSpecs[PROP_CLIENT_INFO] = g_param_spec_object ("client-info",
"ClientInfo",
"Information on client",
......
......@@ -41,14 +41,6 @@ gclue_service_manager_manager_iface_init (GClueDBusManagerIface *iface);
static void
gclue_service_manager_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueServiceManager,
gclue_service_manager,
GCLUE_DBUS_TYPE_MANAGER_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_MANAGER,
gclue_service_manager_manager_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_manager_initable_iface_init))
struct _GClueServiceManagerPrivate
{
GDBusConnection *connection;
......@@ -62,6 +54,15 @@ struct _GClueServiceManagerPrivate
GClueLocator *locator;
};
G_DEFINE_TYPE_WITH_CODE (GClueServiceManager,
gclue_service_manager,
GCLUE_DBUS_TYPE_MANAGER_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_MANAGER,
gclue_service_manager_manager_iface_init)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
gclue_service_manager_initable_iface_init)
G_ADD_PRIVATE (GClueServiceManager))
enum
{
PROP_0,
......@@ -615,8 +616,6 @@ gclue_service_manager_class_init (GClueServiceManagerClass *klass)
object_class->set_property = gclue_service_manager_set_property;
object_class->constructed = gclue_service_manager_constructed;
g_type_class_add_private (object_class, sizeof (GClueServiceManagerPrivate));
gParamSpecs[PROP_CONNECTION] = g_param_spec_object ("connection",
"Connection",
"DBus Connection",
......
......@@ -52,7 +52,10 @@ struct _GClueWebSourcePrivate {
gboolean internet_available;
};
G_DEFINE_ABSTRACT_TYPE (GClueWebSource, gclue_web_source, GCLUE_TYPE_LOCATION_SOURCE)
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GClueWebSource,
gclue_web_source,
GCLUE_TYPE_LOCATION_SOURCE,
G_ADD_PRIVATE (GClueWebSource))
static void
query_callback (SoupSession *session,
......@@ -250,8 +253,6 @@ gclue_web_source_class_init (GClueWebSourceClass *klass)
gsource_class->finalize = gclue_web_source_finalize;
gsource_class->constructed = gclue_web_source_constructed;
g_type_class_add_private (klass, sizeof (GClueWebSourcePrivate));
}
static void
......
......@@ -86,7 +86,10 @@ static GClueAccuracyLevel
gclue_wifi_get_available_accuracy_level (GClueWebSource *source,
gboolean net_available);
G_DEFINE_TYPE (GClueWifi, gclue_wifi, GCLUE_TYPE_WEB_SOURCE)
G_DEFINE_TYPE_WITH_CODE (GClueWifi,
gclue_wifi,
GCLUE_TYPE_WEB_SOURCE,
G_ADD_PRIVATE (GClueWifi))
static void
disconnect_bss_signals (GClueWifi *wifi);
......@@ -171,8 +174,6 @@ gclue_wifi_class_init (GClueWifiClass *klass)
gwifi_class->finalize = gclue_wifi_finalize;
gwifi_class->constructed = gclue_wifi_constructed;
g_type_class_add_private (klass, sizeof (GClueWifiPrivate));
gParamSpecs[PROP_ACCURACY_LEVEL] = g_param_spec_enum ("accuracy-level",
"AccuracyLevel",
"Max accuracy level",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment