aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-02-25 23:20:41 +0800
committerMilan Crha <mcrha@redhat.com>2011-02-25 23:20:41 +0800
commit1301cf02efdacd20fb5ce3e2554ae15b8f146e8a (patch)
tree8d5f3985a82ec7d330af27ee0a29a79a2f0ecfa3 /e-util
parent1a4be6c521d674c4a60e54203521e2721b81b921 (diff)
downloadgsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.gz
gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.tar.zst
gsoc2013-evolution-1301cf02efdacd20fb5ce3e2554ae15b8f146e8a.zip
Bug #614480 - Avoid using G_TYPE_INSTANCE_GET_PRIVATE repeatedly
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-activity.c10
-rw-r--r--e-util/e-alert-dialog.c8
-rw-r--r--e-util/e-alert.c10
-rw-r--r--e-util/e-config.c6
-rw-r--r--e-util/e-event.c6
-rw-r--r--e-util/e-extension.c8
-rw-r--r--e-util/e-module.c12
-rw-r--r--e-util/e-plugin-ui.c10
-rw-r--r--e-util/e-signature-list.c6
-rw-r--r--e-util/e-signature.c8
-rw-r--r--e-util/e-ui-manager.c6
11 files changed, 23 insertions, 67 deletions
diff --git a/e-util/e-activity.c b/e-util/e-activity.c
index 98ee4d1c0b..0b4089cca2 100644
--- a/e-util/e-activity.c
+++ b/e-util/e-activity.c
@@ -28,10 +28,6 @@
#include "e-util/e-util.h"
#include "e-util/e-util-enumtypes.h"
-#define E_ACTIVITY_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_ACTIVITY, EActivityPrivate))
-
struct _EActivityPrivate {
GCancellable *cancellable;
EAlertSink *alert_sink;
@@ -169,7 +165,7 @@ activity_dispose (GObject *object)
{
EActivityPrivate *priv;
- priv = E_ACTIVITY_GET_PRIVATE (object);
+ priv = E_ACTIVITY (object)->priv;
if (priv->alert_sink != NULL) {
g_object_unref (priv->alert_sink);
@@ -194,7 +190,7 @@ activity_finalize (GObject *object)
{
EActivityPrivate *priv;
- priv = E_ACTIVITY_GET_PRIVATE (object);
+ priv = E_ACTIVITY (object)->priv;
g_free (priv->icon_name);
g_free (priv->text);
@@ -336,7 +332,7 @@ e_activity_class_init (EActivityClass *class)
static void
e_activity_init (EActivity *activity)
{
- activity->priv = E_ACTIVITY_GET_PRIVATE (activity);
+ activity->priv = G_TYPE_INSTANCE_GET_PRIVATE (activity, E_TYPE_ACTIVITY, EActivityPrivate);
}
EActivity *
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index e9fea52052..4f399d351e 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -25,10 +25,6 @@
#include "e-util.h"
-#define E_ALERT_DIALOG_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_ALERT_DIALOG, EAlertDialogPrivate))
-
struct _EAlertDialogPrivate {
GtkWindow *parent;
EAlert *alert;
@@ -93,7 +89,7 @@ alert_dialog_dispose (GObject *object)
{
EAlertDialogPrivate *priv;
- priv = E_ALERT_DIALOG_GET_PRIVATE (object);
+ priv = E_ALERT_DIALOG (object)->priv;
if (priv->alert) {
g_signal_handlers_disconnect_matched (
@@ -261,7 +257,7 @@ e_alert_dialog_class_init (EAlertDialogClass *class)
static void
e_alert_dialog_init (EAlertDialog *dialog)
{
- dialog->priv = E_ALERT_DIALOG_GET_PRIVATE (dialog);
+ dialog->priv = G_TYPE_INSTANCE_GET_PRIVATE (dialog, E_TYPE_ALERT_DIALOG, EAlertDialogPrivate);
}
GtkWidget *
diff --git a/e-util/e-alert.c b/e-util/e-alert.c
index cccc3225e5..7df5ca9fe1 100644
--- a/e-util/e-alert.c
+++ b/e-util/e-alert.c
@@ -42,10 +42,6 @@
#define d(x)
-#define E_ALERT_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_ALERT, EAlertPrivate))
-
typedef struct _EAlertButton EAlertButton;
struct _e_alert {
@@ -491,7 +487,7 @@ alert_dispose (GObject *object)
{
EAlertPrivate *priv;
- priv = E_ALERT_GET_PRIVATE (object);
+ priv = E_ALERT (object)->priv;
while (!g_queue_is_empty (&priv->actions)) {
GtkAction *action = g_queue_pop_head (&priv->actions);
@@ -510,7 +506,7 @@ alert_finalize (GObject *object)
{
EAlertPrivate *priv;
- priv = E_ALERT_GET_PRIVATE (object);
+ priv = E_ALERT (object)->priv;
g_free (priv->tag);
g_free (priv->primary_text);
@@ -655,7 +651,7 @@ e_alert_class_init (EAlertClass *class)
static void
e_alert_init (EAlert *alert)
{
- alert->priv = E_ALERT_GET_PRIVATE (alert);
+ alert->priv = G_TYPE_INSTANCE_GET_PRIVATE (alert, E_TYPE_ALERT, EAlertPrivate);
g_queue_init (&alert->priv->actions);
}
diff --git a/e-util/e-config.c b/e-util/e-config.c
index 3c1aeb4c21..17646e00f8 100644
--- a/e-util/e-config.c
+++ b/e-util/e-config.c
@@ -34,10 +34,6 @@
#include <glib/gi18n.h>
-#define E_CONFIG_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_CONFIG, EConfigPrivate))
-
#define d(x)
typedef GtkWidget * (*EConfigItemSectionFactoryFunc)(EConfig *ec, EConfigItem *, GtkWidget *parent, GtkWidget *old, gpointer data, GtkWidget **real_frame);
@@ -191,7 +187,7 @@ e_config_class_init (EConfigClass *class)
static void
e_config_init (EConfig *config)
{
- config->priv = E_CONFIG_GET_PRIVATE (config);
+ config->priv = G_TYPE_INSTANCE_GET_PRIVATE (config, E_TYPE_CONFIG, EConfigPrivate);
}
/**
diff --git a/e-util/e-event.c b/e-util/e-event.c
index 5e4a2b6c09..4127a9c930 100644
--- a/e-util/e-event.c
+++ b/e-util/e-event.c
@@ -33,10 +33,6 @@
#include <glib/gi18n.h>
-#define E_EVENT_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_EVENT, EEventPrivate))
-
#define d(x)
struct _event_node {
@@ -113,7 +109,7 @@ e_event_class_init (EEventClass *class)
static void
e_event_init (EEvent *event)
{
- event->priv = E_EVENT_GET_PRIVATE (event);
+ event->priv = G_TYPE_INSTANCE_GET_PRIVATE (event, E_TYPE_EVENT, EEventPrivate);
g_queue_init (&event->priv->events);
}
diff --git a/e-util/e-extension.c b/e-util/e-extension.c
index d7d95c9496..9c61110911 100644
--- a/e-util/e-extension.c
+++ b/e-util/e-extension.c
@@ -41,10 +41,6 @@
#include "e-extension.h"
-#define E_EXTENSION_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_EXTENSION, EExtensionPrivate))
-
struct _EExtensionPrivate {
gpointer extensible; /* weak pointer */
};
@@ -126,7 +122,7 @@ extension_dispose (GObject *object)
{
EExtensionPrivate *priv;
- priv = E_EXTENSION_GET_PRIVATE (object);
+ priv = E_EXTENSION (object)->priv;
if (priv->extensible != NULL) {
g_object_remove_weak_pointer (
@@ -165,7 +161,7 @@ e_extension_class_init (EExtensionClass *class)
static void
e_extension_init (EExtension *extension)
{
- extension->priv = E_EXTENSION_GET_PRIVATE (extension);
+ extension->priv = G_TYPE_INSTANCE_GET_PRIVATE (extension, E_TYPE_EXTENSION, EExtensionPrivate);
}
/**
diff --git a/e-util/e-module.c b/e-util/e-module.c
index 7b4801df47..56add2b27f 100644
--- a/e-util/e-module.c
+++ b/e-util/e-module.c
@@ -35,10 +35,6 @@
/* This is the symbol we call when unloading a module. */
#define UNLOAD_SYMBOL "e_module_unload"
-#define E_MODULE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_MODULE, EModulePrivate))
-
struct _EModulePrivate {
GModule *module;
gchar *filename;
@@ -105,7 +101,7 @@ module_finalize (GObject *object)
{
EModulePrivate *priv;
- priv = E_MODULE_GET_PRIVATE (object);
+ priv = E_MODULE (object)->priv;
g_free (priv->filename);
@@ -119,7 +115,7 @@ module_load (GTypeModule *type_module)
EModulePrivate *priv;
gpointer symbol;
- priv = E_MODULE_GET_PRIVATE (type_module);
+ priv = E_MODULE (type_module)->priv;
g_return_val_if_fail (priv->filename != NULL, FALSE);
priv->module = g_module_open (priv->filename, 0);
@@ -155,7 +151,7 @@ module_unload (GTypeModule *type_module)
{
EModulePrivate *priv;
- priv = E_MODULE_GET_PRIVATE (type_module);
+ priv = E_MODULE (type_module)->priv;
priv->unload (type_module);
@@ -203,7 +199,7 @@ e_module_class_init (EModuleClass *class)
static void
e_module_init (EModule *module)
{
- module->priv = E_MODULE_GET_PRIVATE (module);
+ module->priv = G_TYPE_INSTANCE_GET_PRIVATE (module, E_TYPE_MODULE, EModulePrivate);
}
/**
diff --git a/e-util/e-plugin-ui.c b/e-util/e-plugin-ui.c
index 60ad884d25..e606e713f6 100644
--- a/e-util/e-plugin-ui.c
+++ b/e-util/e-plugin-ui.c
@@ -22,10 +22,6 @@
#include <string.h>
-#define E_PLUGIN_UI_HOOK_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_PLUGIN_UI_HOOK, EPluginUIHookPrivate))
-
#define E_PLUGIN_UI_DEFAULT_FUNC "e_plugin_ui_init"
#define E_PLUGIN_UI_HOOK_CLASS_ID "org.gnome.evolution.ui:1.0"
@@ -399,7 +395,7 @@ plugin_ui_hook_finalize (GObject *object)
GHashTableIter iter;
gpointer ui_manager;
- priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (object);
+ priv = E_PLUGIN_UI_HOOK (object)->priv;
/* Remove weak reference callbacks to GtkUIManagers. */
g_hash_table_iter_init (&iter, priv->registry);
@@ -423,7 +419,7 @@ plugin_ui_hook_construct (EPluginHook *hook,
{
EPluginUIHookPrivate *priv;
- priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (hook);
+ priv = E_PLUGIN_UI_HOOK (hook)->priv;
/* XXX The EPlugin should be a property of EPluginHookClass.
* Then it could be passed directly to g_object_new() and
@@ -524,7 +520,7 @@ e_plugin_ui_hook_init (EPluginUIHook *hook)
registry = g_hash_table_new (g_direct_hash, g_direct_equal);
- hook->priv = E_PLUGIN_UI_HOOK_GET_PRIVATE (hook);
+ hook->priv = G_TYPE_INSTANCE_GET_PRIVATE (hook, E_TYPE_PLUGIN_UI_HOOK, EPluginUIHookPrivate);
hook->priv->ui_definitions = ui_definitions;
hook->priv->callbacks = callbacks;
hook->priv->registry = registry;
diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c
index 7a58e8fea4..7b8a320782 100644
--- a/e-util/e-signature-list.c
+++ b/e-util/e-signature-list.c
@@ -28,10 +28,6 @@
#include <libedataserver/e-uid.h>
-#define E_SIGNATURE_LIST_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_SIGNATURE_LIST, ESignatureListPrivate))
-
struct _ESignatureListPrivate {
GConfClient *gconf;
guint notify_id;
@@ -113,7 +109,7 @@ e_signature_list_class_init (ESignatureListClass *class)
static void
e_signature_list_init (ESignatureList *signature_list)
{
- signature_list->priv = E_SIGNATURE_LIST_GET_PRIVATE (signature_list);
+ signature_list->priv = G_TYPE_INSTANCE_GET_PRIVATE (signature_list, E_TYPE_SIGNATURE_LIST, ESignatureListPrivate);
}
static GSList *
diff --git a/e-util/e-signature.c b/e-util/e-signature.c
index 07e4b2ea33..7bd2b74bf0 100644
--- a/e-util/e-signature.c
+++ b/e-util/e-signature.c
@@ -36,10 +36,6 @@
#include "e-signature.h"
-#define E_SIGNATURE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_SIGNATURE, ESignaturePrivate))
-
struct _ESignaturePrivate {
gchar *filename;
gchar *name;
@@ -231,7 +227,7 @@ signature_finalize (GObject *object)
{
ESignaturePrivate *priv;
- priv = E_SIGNATURE_GET_PRIVATE (object);
+ priv = E_SIGNATURE (object)->priv;
g_free (priv->filename);
g_free (priv->name);
@@ -323,7 +319,7 @@ e_signature_class_init (ESignatureClass *class)
static void
e_signature_init (ESignature *signature)
{
- signature->priv = E_SIGNATURE_GET_PRIVATE (signature);
+ signature->priv = G_TYPE_INSTANCE_GET_PRIVATE (signature, E_TYPE_SIGNATURE, ESignaturePrivate);
}
/**
diff --git a/e-util/e-ui-manager.c b/e-util/e-ui-manager.c
index 8b2d0ff9f6..238df39e9f 100644
--- a/e-util/e-ui-manager.c
+++ b/e-util/e-ui-manager.c
@@ -30,10 +30,6 @@
#include <string.h>
-#define E_UI_MANAGER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), E_TYPE_UI_MANAGER, EUIManagerPrivate))
-
/*
* --- NOTE TO SELF ---
*
@@ -163,7 +159,7 @@ e_ui_manager_class_init (EUIManagerClass *class)
static void
e_ui_manager_init (EUIManager *ui_manager)
{
- ui_manager->priv = E_UI_MANAGER_GET_PRIVATE (ui_manager);
+ ui_manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (ui_manager, E_TYPE_UI_MANAGER, EUIManagerPrivate);
}
/**