aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-07-19 02:24:18 +0800
committerXan Lopez <xan@igalia.com>2012-07-19 02:24:18 +0800
commit10f4eef8321f857a6d305d1368877fcd0112e12c (patch)
tree1a158ba71ae855cc5816d48de8a7367f9d5e5ca0
parent028b27e0d152fa439ee84d9f3b26e4a09ff5ea27 (diff)
downloadgsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar.gz
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar.bz2
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar.lz
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar.xz
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.tar.zst
gsoc2013-epiphany-10f4eef8321f857a6d305d1368877fcd0112e12c.zip
Use G_DEFINE_BOXED_TYPE to define boxed types
EphyNode is missing, but trying to migrate it gives some obscure error I need to figure out.
-rw-r--r--embed/ephy-permission-manager.c18
-rw-r--r--src/ephy-password-info.c17
2 files changed, 5 insertions, 30 deletions
diff --git a/embed/ephy-permission-manager.c b/embed/ephy-permission-manager.c
index ec222ee33..19bdace60 100644
--- a/embed/ephy-permission-manager.c
+++ b/embed/ephy-permission-manager.c
@@ -19,25 +19,13 @@
*/
#include "config.h"
-
#include "ephy-permission-manager.h"
+
#include "ephy-embed-type-builtins.h"
#include "ephy-debug.h"
-GType
-ephy_permission_info_get_type (void)
-{
- static GType type = 0;
-
- if (G_UNLIKELY (type == 0))
- {
- type = g_boxed_type_register_static ("EphyPermissionInfo",
- (GBoxedCopyFunc) ephy_permission_info_copy,
- (GBoxedFreeFunc) ephy_permission_info_free);
- }
-
- return type;
-}
+G_DEFINE_BOXED_TYPE (EphyPermissionInfo, ephy_permission_info,
+ ephy_permission_info_copy, ephy_permission_info_free)
/**
* ephy_permission_info_new:
diff --git a/src/ephy-password-info.c b/src/ephy-password-info.c
index 09591d505..0487110b2 100644
--- a/src/ephy-password-info.c
+++ b/src/ephy-password-info.c
@@ -17,12 +17,10 @@
*
*/
#include "config.h"
-
#include "ephy-password-info.h"
#include <gnome-keyring-memory.h>
-
static EphyPasswordInfo*
password_info_copy (EphyPasswordInfo *info)
{
@@ -40,19 +38,8 @@ password_info_free (EphyPasswordInfo *info)
g_slice_free (EphyPasswordInfo, info);
}
-GType
-ephy_password_info_get_type (void)
-{
- static volatile gsize type_volatile = 0;
- if (g_once_init_enter (&type_volatile)) {
- GType type = g_boxed_type_register_static(
- g_intern_static_string ("EphyTypePasswordInfo"),
- (GBoxedCopyFunc) password_info_copy,
- (GBoxedFreeFunc) password_info_free);
- g_once_init_leave (&type_volatile, type);
- }
- return type_volatile;
-}
+G_DEFINE_BOXED_TYPE (EphyPasswordInfo, ephy_password_info,
+ password_info_copy, password_info_free)
EphyPasswordInfo
*ephy_password_info_new (guint32 key_id)