[network-manager-applet/aleksander/mobile-providers: 5/9] libnm-gtk, mobile-providers: use 'G_DEFINE_BOXED_TYPE' to create the types
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet/aleksander/mobile-providers: 5/9] libnm-gtk, mobile-providers: use 'G_DEFINE_BOXED_TYPE' to create the types
- Date: Fri, 23 Nov 2012 15:48:03 +0000 (UTC)
commit e42fd4642b35645d4361b05c5df4ace05bc3df94
Author: Aleksander Morgado <aleksander lanedo com>
Date: Fri Nov 23 12:34:49 2012 +0100
libnm-gtk,mobile-providers: use 'G_DEFINE_BOXED_TYPE' to create the types
src/libnm-gtk/nm-mobile-providers.c | 54 +++++++++-------------------------
1 files changed, 15 insertions(+), 39 deletions(-)
---
diff --git a/src/libnm-gtk/nm-mobile-providers.c b/src/libnm-gtk/nm-mobile-providers.c
index 9fdea77..5086531 100644
--- a/src/libnm-gtk/nm-mobile-providers.c
+++ b/src/libnm-gtk/nm-mobile-providers.c
@@ -81,6 +81,11 @@ mcc_mnc_free (NMAGsmMccMnc *m)
/******************************************************************************/
/* Access method type */
+G_DEFINE_BOXED_TYPE (NMAMobileAccessMethod,
+ nma_mobile_access_method,
+ nma_mobile_access_method_ref,
+ nma_mobile_access_method_unref)
+
struct _NMAMobileAccessMethod {
char *name;
/* maps lang (char *) -> name (char *) */
@@ -235,22 +240,14 @@ nma_mobile_access_method_get_method_type (NMAMobileAccessMethod *method)
return method->type;
}
-GType
-nma_mobile_access_method_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- type = g_boxed_type_register_static ("NMAMobileAccessMethod",
- (GBoxedCopyFunc) nma_mobile_access_method_ref,
- (GBoxedFreeFunc) nma_mobile_access_method_unref);
- }
- return type;
-}
-
/******************************************************************************/
/* Mobile provider type */
+G_DEFINE_BOXED_TYPE (NMAMobileProvider,
+ nma_mobile_provider,
+ nma_mobile_provider_ref,
+ nma_mobile_provider_unref)
+
struct _NMAMobileProvider {
char *name;
/* maps lang (char *) -> name (char *) */
@@ -363,22 +360,14 @@ nma_mobile_provider_get_cdma_sid (NMAMobileProvider *provider)
return provider->cdma_sid;
}
-GType
-nma_mobile_provider_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- type = g_boxed_type_register_static ("NMAMobileProvider",
- (GBoxedCopyFunc) nma_mobile_provider_ref,
- (GBoxedFreeFunc) nma_mobile_provider_unref);
- }
- return type;
-}
-
/******************************************************************************/
/* Country Info type */
+G_DEFINE_BOXED_TYPE (NMACountryInfo,
+ nma_country_info,
+ nma_country_info_ref,
+ nma_country_info_unref)
+
struct _NMACountryInfo {
char *country_code;
char *country_name;
@@ -460,19 +449,6 @@ nma_country_info_get_providers (NMACountryInfo *country_info)
return country_info->providers;
}
-GType
-nma_country_info_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0)) {
- type = g_boxed_type_register_static ("NMACountryInfo",
- (GBoxedCopyFunc) nma_country_info_ref,
- (GBoxedFreeFunc) nma_country_info_unref);
- }
- return type;
-}
-
/******************************************************************************/
/* XML Parser for iso_3166.xml */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]