[libgweather/ebassi/gtk4] Use G_DEFINE_BOXED_TYPE for GWeatherTimezone
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/gtk4] Use G_DEFINE_BOXED_TYPE for GWeatherTimezone
- Date: Tue, 12 Oct 2021 17:16:06 +0000 (UTC)
commit aea3fc3f63700f7637279a2fff5f229e4a99d2ca
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Oct 12 18:05:41 2021 +0100
Use G_DEFINE_BOXED_TYPE for GWeatherTimezone
Instead of writing the get_type() function ourselves.
libgweather/gweather-timezone.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
---
diff --git a/libgweather/gweather-timezone.c b/libgweather/gweather-timezone.c
index afb04589..7b4327cc 100644
--- a/libgweather/gweather-timezone.c
+++ b/libgweather/gweather-timezone.c
@@ -243,20 +243,7 @@ gweather_timezone_unref (GWeatherTimezone *zone)
}
}
-GType
-gweather_timezone_get_type (void)
-{
- static gsize type_volatile = 0;
-
- if (g_once_init_enter (&type_volatile)) {
- GType type = g_boxed_type_register_static (
- g_intern_static_string ("GWeatherTimezone"),
- (GBoxedCopyFunc) gweather_timezone_ref,
- (GBoxedFreeFunc) gweather_timezone_unref);
- g_once_init_leave (&type_volatile, type);
- }
- return type_volatile;
-}
+G_DEFINE_BOXED_TYPE (GWeatherTimezone, gweather_timezone, gweather_timezone_ref, gweather_timezone_unref)
/**
* gweather_timezone_get_utc:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]