aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-idle.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-05-06 04:34:41 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-05-06 04:34:41 +0800
commit1557095113a3c0f5baadcfb1e953d73762e5263e (patch)
tree6af706fb1f4f673120981e033768a09169544c11 /libempathy/empathy-idle.c
parent62828fac680bd53e0047d9ae2a281c864075c809 (diff)
downloadgsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.gz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.bz2
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.lz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.xz
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.tar.zst
gsoc2013-empathy-1557095113a3c0f5baadcfb1e953d73762e5263e.zip
Keep a priv pointer in the object struct instead of using G_TYPE_INSTANCE_GET_PRIVATE all the time.
svn path=/trunk/; revision=1082
Diffstat (limited to 'libempathy/empathy-idle.c')
-rw-r--r--libempathy/empathy-idle.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c
index 7da1a00e6..3363c5046 100644
--- a/libempathy/empathy-idle.c
+++ b/libempathy/empathy-idle.c
@@ -36,21 +36,11 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include "empathy-debug.h"
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- EMPATHY_TYPE_IDLE, EmpathyIdlePriv))
-
/* Number of seconds before entering extended autoaway. */
#define EXT_AWAY_TIME (30*60)
-typedef enum {
- NM_STATE_UNKNOWN,
- NM_STATE_ASLEEP,
- NM_STATE_CONNECTING,
- NM_STATE_CONNECTED,
- NM_STATE_DISCONNECTED
-} NMState;
-
-struct _EmpathyIdlePriv {
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyIdle)
+typedef struct {
MissionControl *mc;
DBusGProxy *gs_proxy;
DBusGProxy *nm_proxy;
@@ -69,10 +59,16 @@ struct _EmpathyIdlePriv {
gboolean is_idle;
gboolean nm_connected;
guint ext_away_timeout;
-};
+} EmpathyIdlePriv;
+
+typedef enum {
+ NM_STATE_UNKNOWN,
+ NM_STATE_ASLEEP,
+ NM_STATE_CONNECTING,
+ NM_STATE_CONNECTED,
+ NM_STATE_DISCONNECTED
+} NMState;
-static void empathy_idle_class_init (EmpathyIdleClass *klass);
-static void empathy_idle_init (EmpathyIdle *idle);
static void idle_finalize (GObject *object);
static void idle_get_property (GObject *object,
guint param_id,
@@ -162,12 +158,12 @@ empathy_idle_class_init (EmpathyIdleClass *klass)
static void
empathy_idle_init (EmpathyIdle *idle)
{
- EmpathyIdlePriv *priv;
DBusGConnection *system_bus;
GError *error = NULL;
+ EmpathyIdlePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (idle,
+ EMPATHY_TYPE_IDLE, EmpathyIdlePriv);
- priv = GET_PRIV (idle);
-
+ idle->priv = priv;
priv->is_idle = FALSE;
priv->mc = empathy_mission_control_new ();
priv->state = mission_control_get_presence_actual (priv->mc, NULL);