aboutsummaryrefslogtreecommitdiffstats
path: root/src/session.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2003-09-02 07:20:17 +0800
committerChristian Persch <chpe@src.gnome.org>2003-09-02 07:20:17 +0800
commit73a95385f4034998cc78199dc8bb9ee22d90d6aa (patch)
tree499d78ab52e8937f672e3659105dda083a34c988 /src/session.c
parent3375c1878c4c0ebf4f5067d128024ea484208f62 (diff)
downloadgsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.gz
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.bz2
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.lz
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.xz
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.tar.zst
gsoc2013-epiphany-73a95385f4034998cc78199dc8bb9ee22d90d6aa.zip
Mega-patch, changelog too long to paste here.
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/session.c b/src/session.c
index 7718586b3..647d9f939 100644
--- a/src/session.c
+++ b/src/session.c
@@ -14,6 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Id$
*/
#ifdef HAVE_CONFIG_H
@@ -62,6 +64,8 @@ static void session_dispose (GObject *object);
static GObjectClass *parent_class = NULL;
+#define EPHY_SESSION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SESSION, SessionPrivate))
+
struct SessionPrivate
{
GList *windows;
@@ -137,6 +141,8 @@ session_class_init (SessionClass *klass)
G_TYPE_NONE,
1,
G_TYPE_OBJECT);
+
+ g_type_class_add_private (object_class, sizeof(SessionPrivate));
}
static char *
@@ -347,7 +353,8 @@ gnome_session_init (Session *session)
static void
session_init (Session *session)
{
- session->priv = g_new0 (SessionPrivate, 1);
+ session->priv = EPHY_SESSION_GET_PRIVATE (session);
+
session->priv->windows = NULL;
session->priv->dont_remove_crashed = FALSE;
@@ -393,7 +400,7 @@ session_delete (Session *session,
static void
session_dispose (GObject *object)
{
- Session *session = SESSION(object);
+ Session *session = EPHY_SESSION(object);
if (!session->priv->dont_remove_crashed)
{
@@ -404,19 +411,10 @@ session_dispose (GObject *object)
static void
session_finalize (GObject *object)
{
- Session *t;
-
- g_return_if_fail (object != NULL);
- g_return_if_fail (IS_SESSION (object));
-
- t = SESSION (object);
-
- g_return_if_fail (t->priv != NULL);
+ Session *t = EPHY_SESSION (object);
g_list_free (t->priv->windows);
- g_free (t->priv);
-
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -432,9 +430,7 @@ session_new (void)
{
Session *t;
- t = SESSION (g_object_new (SESSION_TYPE, NULL));
-
- g_return_val_if_fail (t->priv != NULL, NULL);
+ t = EPHY_SESSION (g_object_new (EPHY_TYPE_SESSION, NULL));
return t;
}
@@ -646,7 +642,7 @@ session_load (Session *session,
const GList *
session_get_windows (Session *session)
{
- g_return_val_if_fail (IS_SESSION (session), NULL);
+ g_return_val_if_fail (EPHY_IS_SESSION (session), NULL);
return session->priv->windows;
}