aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-autocompletion.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 /lib/ephy-autocompletion.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 'lib/ephy-autocompletion.c')
-rw-r--r--lib/ephy-autocompletion.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ephy-autocompletion.c b/lib/ephy-autocompletion.c
index 17fc052b7..6c28eaf78 100644
--- a/lib/ephy-autocompletion.c
+++ b/lib/ephy-autocompletion.c
@@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
- *
*/
#include <string.h>
@@ -45,6 +44,8 @@ typedef struct {
#define ACMA_BASE_SIZE 10240
+#define EPHY_AUTOCOMPLETION_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_AUTOCOMPLETION, EphyAutocompletionPrivate))
+
struct _EphyAutocompletionPrivate {
GSList *sources;
@@ -125,9 +126,12 @@ ephy_autocompletion_get_type (void)
static void
ephy_autocompletion_class_init (EphyAutocompletionClass *klass)
{
- G_OBJECT_CLASS (klass)->finalize = ephy_autocompletion_finalize_impl;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
g_object_class = g_type_class_peek_parent (klass);
+ object_class->finalize = ephy_autocompletion_finalize_impl;
+
EphyAutocompletionSignals[EPHY_AUTOCOMPLETION_SOURCES_CHANGED] = g_signal_new (
"sources-changed", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST | G_SIGNAL_RUN_CLEANUP,
@@ -135,12 +139,14 @@ ephy_autocompletion_class_init (EphyAutocompletionClass *klass)
NULL, NULL,
ephy_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+
+ g_type_class_add_private (object_class, sizeof (EphyAutocompletionPrivate));
}
static void
ephy_autocompletion_init (EphyAutocompletion *ac)
{
- EphyAutocompletionPrivate *p = g_new0 (EphyAutocompletionPrivate, 1);
+ EphyAutocompletionPrivate *p = EPHY_AUTOCOMPLETION_GET_PRIVATE (ac);
ac->priv = p;
p->sources = NULL;
acma_init (&p->matches);
@@ -184,8 +190,6 @@ ephy_autocompletion_finalize_impl (GObject *o)
g_strfreev (p->prefixes);
g_free (p->prefix_lengths);
- g_free (p);
-
G_OBJECT_CLASS (g_object_class)->finalize (o);
}