aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-history.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 /embed/ephy-history.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 'embed/ephy-history.c')
-rw-r--r--embed/ephy-history.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/embed/ephy-history.c b/embed/ephy-history.c
index 18092876f..3a00a9c98 100644
--- a/embed/ephy-history.c
+++ b/embed/ephy-history.c
@@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
- *
*/
#ifdef HAVE_CONFIG_H
@@ -42,6 +41,8 @@
#define HISTORY_PAGE_OBSOLETE_DAYS 10
+#define EPHY_HISTORY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_HISTORY, EphyHistoryPrivate))
+
struct EphyHistoryPrivate
{
char *xml_file;
@@ -197,6 +198,8 @@ ephy_history_class_init (EphyHistoryClass *klass)
G_TYPE_NONE,
1,
G_TYPE_STRING);
+
+ g_type_class_add_private (object_class, sizeof(EphyHistoryPrivate));
}
static void
@@ -415,7 +418,7 @@ ephy_history_init (EphyHistory *eb)
GValue value = { 0, };
EphyNodeDb *db;
- eb->priv = g_new0 (EphyHistoryPrivate, 1);
+ eb->priv = EPHY_HISTORY_GET_PRIVATE (eb);
db = ephy_node_db_new (EPHY_NODE_DB_HISTORY);
eb->priv->db = db;
@@ -492,13 +495,7 @@ ephy_history_init (EphyHistory *eb)
static void
ephy_history_finalize (GObject *object)
{
- EphyHistory *eb;
-
- g_return_if_fail (IS_EPHY_HISTORY (object));
-
- eb = EPHY_HISTORY (object);
-
- g_return_if_fail (eb->priv != NULL);
+ EphyHistory *eb = EPHY_HISTORY (object);
ephy_history_save (eb);
@@ -514,8 +511,6 @@ ephy_history_finalize (GObject *object)
g_source_remove (eb->priv->autosave_timeout);
- g_free (eb->priv);
-
LOG ("Global history finalized");
G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -524,11 +519,11 @@ ephy_history_finalize (GObject *object)
EphyHistory *
ephy_history_new ()
{
- EphyHistory *tab;
+ EphyHistory *eh;
- tab = EPHY_HISTORY (g_object_new (EPHY_HISTORY_TYPE, NULL));
+ eh = EPHY_HISTORY (g_object_new (EPHY_TYPE_HISTORY, NULL));
- return tab;
+ return eh;
}
static void