|
Revision 3666
(checked in by jdapena, 7 months ago)
|
* Use GOnce registering all types in tinymail to make
registering thread-safe.
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
#include <config.h> |
|---|
| 30 |
|
|---|
| 31 |
#include <tny-account-store-view.h> |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
void |
|---|
| 45 |
tny_account_store_view_set_account_store (TnyAccountStoreView *self, TnyAccountStore *account_store) |
|---|
| 46 |
{ |
|---|
| 47 |
#ifdef DBC |
|---|
| 48 |
g_assert (TNY_IS_ACCOUNT_STORE_VIEW (self)); |
|---|
| 49 |
g_assert (TNY_ACCOUNT_STORE_VIEW_GET_IFACE (self)->set_account_store!= NULL); |
|---|
| 50 |
#endif |
|---|
| 51 |
|
|---|
| 52 |
TNY_ACCOUNT_STORE_VIEW_GET_IFACE (self)->set_account_store(self, account_store); |
|---|
| 53 |
|
|---|
| 54 |
return; |
|---|
| 55 |
} |
|---|
| 56 |
|
|---|
| 57 |
static void |
|---|
| 58 |
tny_account_store_view_base_init (gpointer g_class) |
|---|
| 59 |
{ |
|---|
| 60 |
static gboolean initialized = FALSE; |
|---|
| 61 |
|
|---|
| 62 |
if (!initialized) { |
|---|
| 63 |
|
|---|
| 64 |
initialized = TRUE; |
|---|
| 65 |
} |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
static gpointer |
|---|
| 69 |
tny_account_store_view_register_type (gpointer notused) |
|---|
| 70 |
{ |
|---|
| 71 |
GType type = 0; |
|---|
| 72 |
|
|---|
| 73 |
static const GTypeInfo info = |
|---|
| 74 |
{ |
|---|
| 75 |
sizeof (TnyAccountStoreViewIface), |
|---|
| 76 |
tny_account_store_view_base_init, |
|---|
| 77 |
NULL, |
|---|
| 78 |
NULL, |
|---|
| 79 |
NULL, |
|---|
| 80 |
NULL, |
|---|
| 81 |
0, |
|---|
| 82 |
0, |
|---|
| 83 |
NULL |
|---|
| 84 |
}; |
|---|
| 85 |
type = g_type_register_static (G_TYPE_INTERFACE, |
|---|
| 86 |
"TnyAccountStoreView", &info, 0); |
|---|
| 87 |
|
|---|
| 88 |
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT); |
|---|
| 89 |
|
|---|
| 90 |
return GUINT_TO_POINTER (type); |
|---|
| 91 |
} |
|---|
| 92 |
|
|---|
| 93 |
GType |
|---|
| 94 |
tny_account_store_view_get_type (void) |
|---|
| 95 |
{ |
|---|
| 96 |
static GOnce once = G_ONCE_INIT; |
|---|
| 97 |
g_once (&once, tny_account_store_view_register_type, NULL); |
|---|
| 98 |
return GPOINTER_TO_UINT (once.retval); |
|---|
| 99 |
} |
|---|