aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--e-util/e-activity.c12
-rw-r--r--widgets/misc/e-activity-bar.c9
-rw-r--r--widgets/misc/e-activity-proxy.c9
3 files changed, 19 insertions, 11 deletions
diff --git a/e-util/e-activity.c b/e-util/e-activity.c
index 1c1655f010..ae34366393 100644
--- a/e-util/e-activity.c
+++ b/e-util/e-activity.c
@@ -32,6 +32,10 @@
#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;
@@ -173,7 +177,7 @@ activity_dispose (GObject *object)
{
EActivityPrivate *priv;
- priv = E_ACTIVITY (object)->priv;
+ priv = E_ACTIVITY_GET_PRIVATE (object);
if (priv->alert_sink != NULL) {
g_object_unref (priv->alert_sink);
@@ -198,7 +202,7 @@ activity_finalize (GObject *object)
{
EActivityPrivate *priv;
- priv = E_ACTIVITY (object)->priv;
+ priv = E_ACTIVITY_GET_PRIVATE (object);
g_free (priv->icon_name);
g_free (priv->text);
@@ -353,9 +357,7 @@ e_activity_class_init (EActivityClass *class)
static void
e_activity_init (EActivity *activity)
{
- activity->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- activity, E_TYPE_ACTIVITY, EActivityPrivate);
-
+ activity->priv = E_ACTIVITY_GET_PRIVATE (activity);
activity->priv->warn_bogus_percent = TRUE;
}
diff --git a/widgets/misc/e-activity-bar.c b/widgets/misc/e-activity-bar.c
index 5407814ab6..f85b403bd7 100644
--- a/widgets/misc/e-activity-bar.c
+++ b/widgets/misc/e-activity-bar.c
@@ -22,6 +22,10 @@
#include "e-activity-bar.h"
+#define E_ACTIVITY_BAR_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ACTIVITY_BAR, EActivityBarPrivate))
+
#define FEEDBACK_PERIOD 1 /* seconds */
#define COMPLETED_ICON_NAME "emblem-default"
@@ -206,7 +210,7 @@ activity_bar_dispose (GObject *object)
{
EActivityBarPrivate *priv;
- priv = E_ACTIVITY_BAR (object)->priv;
+ priv = E_ACTIVITY_BAR_GET_PRIVATE (object);
if (priv->timeout_id > 0) {
g_source_remove (priv->timeout_id);
@@ -257,8 +261,7 @@ e_activity_bar_init (EActivityBar *bar)
GtkWidget *container;
GtkWidget *widget;
- bar->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- bar, E_TYPE_ACTIVITY_BAR, EActivityBarPrivate);
+ bar->priv = E_ACTIVITY_BAR_GET_PRIVATE (bar);
container = gtk_info_bar_get_content_area (GTK_INFO_BAR (bar));
diff --git a/widgets/misc/e-activity-proxy.c b/widgets/misc/e-activity-proxy.c
index f34807cba0..7547088aac 100644
--- a/widgets/misc/e-activity-proxy.c
+++ b/widgets/misc/e-activity-proxy.c
@@ -27,6 +27,10 @@
#include <glib/gi18n.h>
+#define E_ACTIVITY_PROXY_GET_PRIVATE(obj) \
+ (G_TYPE_INSTANCE_GET_PRIVATE \
+ ((obj), E_TYPE_ACTIVITY_PROXY, EActivityProxyPrivate))
+
#define FEEDBACK_PERIOD 1 /* seconds */
#define COMPLETED_ICON_NAME "emblem-default"
@@ -212,7 +216,7 @@ activity_proxy_dispose (GObject *object)
{
EActivityProxyPrivate *priv;
- priv = E_ACTIVITY_PROXY (object)->priv;
+ priv = E_ACTIVITY_PROXY_GET_PRIVATE (object);
if (priv->timeout_id > 0) {
g_source_remove (priv->timeout_id);
@@ -263,8 +267,7 @@ e_activity_proxy_init (EActivityProxy *proxy)
GtkWidget *container;
GtkWidget *widget;
- proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (
- proxy, E_TYPE_ACTIVITY_PROXY, EActivityProxyPrivate);
+ proxy->priv = E_ACTIVITY_PROXY_GET_PRIVATE (proxy);
gtk_frame_set_shadow_type (GTK_FRAME (proxy), GTK_SHADOW_IN);