aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas/pas-backend-summary.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-05 19:09:59 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-05 19:09:59 +0800
commit8e9511af0e47355211e189d5cba5dcd9ae97584c (patch)
treee85c07a8fa9537b996ee82b48ec3652247a82278 /addressbook/backend/pas/pas-backend-summary.c
parent02e66b1085341d95377d3f2173a1900102f20b9b (diff)
downloadgsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar.gz
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar.bz2
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar.lz
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar.xz
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.tar.zst
gsoc2013-evolution-8e9511af0e47355211e189d5cba5dcd9ae97584c.zip
port to gnome 2.
2002-11-05 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.[ch]: port to gnome 2. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-file.[ch]: same. * backend/pas/pas-backend-ldap.[ch]: same. * backend/pas/pas-backend-summary.[ch]: same. * backend/pas/pas-backend.[ch]: same. * backend/pas/pas-book-factory.[ch]: same. * backend/pas/pas-book-view.[ch]: same. * backend/pas/pas-book.[ch]: same. * backend/pas/pas-card-cursor.[ch]: same. * backend/pas/pas-marshal.list: list of marshallers. * backend/pas/Makefile.am (libpas_a_SOURCES): add pas-marshal.c also add the marshal building foo. * backend/pas/.cvsignore: ignore pas-marshal.[ch] svn path=/trunk/; revision=18544
Diffstat (limited to 'addressbook/backend/pas/pas-backend-summary.c')
-rw-r--r--addressbook/backend/pas/pas-backend-summary.c55
1 files changed, 28 insertions, 27 deletions
diff --git a/addressbook/backend/pas/pas-backend-summary.c b/addressbook/backend/pas/pas-backend-summary.c
index fb91718b9b..9161ef7ffb 100644
--- a/addressbook/backend/pas/pas-backend-summary.c
+++ b/addressbook/backend/pas/pas-backend-summary.c
@@ -37,7 +37,7 @@
#include "pas-backend-summary.h"
#include "e-util/e-sexp.h"
-static GtkObjectClass *parent_class;
+static GObjectClass *parent_class;
struct _PASBackendSummaryPrivate {
char *summary_path;
@@ -136,7 +136,7 @@ clear_items (PASBackendSummary *summary)
PASBackendSummary*
pas_backend_summary_new (const char *summary_path, int flush_timeout_millis)
{
- PASBackendSummary *summary = gtk_type_new (PAS_BACKEND_SUMMARY_TYPE);
+ PASBackendSummary *summary = g_object_new (PAS_TYPE_BACKEND_SUMMARY, NULL);
summary->priv->summary_path = g_strdup (summary_path);
summary->priv->flush_timeout_millis = flush_timeout_millis;
@@ -146,7 +146,7 @@ pas_backend_summary_new (const char *summary_path, int flush_timeout_millis)
}
static void
-pas_backend_summary_destroy (GtkObject *object)
+pas_backend_summary_dispose (GObject *object)
{
PASBackendSummary *summary = PAS_BACKEND_SUMMARY (object);
@@ -154,7 +154,7 @@ pas_backend_summary_destroy (GtkObject *object)
g_warning ("Destroying dirty summary");
if (summary->priv->flush_timeout) {
- gtk_timeout_remove (summary->priv->flush_timeout);
+ g_source_remove (summary->priv->flush_timeout);
summary->priv->flush_timeout = 0;
}
@@ -169,19 +169,19 @@ pas_backend_summary_destroy (GtkObject *object)
g_free (summary->priv);
- GTK_OBJECT_CLASS (parent_class)->destroy (object);
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
pas_backend_summary_class_init (PASBackendSummaryClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *) klass;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
- parent_class = gtk_type_class (gtk_object_get_type ());
+ parent_class = g_type_class_ref (G_TYPE_OBJECT);
/* Set the virtual methods. */
- object_class->destroy = pas_backend_summary_destroy;
+ object_class->dispose = pas_backend_summary_dispose;
}
static void
@@ -209,24 +209,25 @@ pas_backend_summary_init (PASBackendSummary *summary)
/**
* pas_backend_summary_get_type:
*/
-GtkType
+GType
pas_backend_summary_get_type (void)
{
- static GtkType type = 0;
+ static GType type = 0;
if (! type) {
- GtkTypeInfo info = {
- "PASBackendSummary",
- sizeof (PASBackendSummary),
+ GTypeInfo info = {
sizeof (PASBackendSummaryClass),
- (GtkClassInitFunc) pas_backend_summary_class_init,
- (GtkObjectInitFunc) pas_backend_summary_init,
- NULL, /* reserved 1 */
- NULL, /* reserved 2 */
- (GtkClassInitFunc) NULL
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) pas_backend_summary_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (PASBackendSummary),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) pas_backend_summary_init
};
- type = gtk_type_unique (gtk_object_get_type (), &info);
+ type = g_type_register_static (G_TYPE_OBJECT, "PASBackendSummary", &info, 0);
}
return type;
@@ -654,7 +655,7 @@ pas_backend_summary_save (PASBackendSummary *summary)
/* if we have a queued flush, clear it (since we just flushed) */
if (summary->priv->flush_timeout) {
- gtk_timeout_remove (summary->priv->flush_timeout);
+ g_source_remove (summary->priv->flush_timeout);
summary->priv->flush_timeout = 0;
}
@@ -712,8 +713,8 @@ pas_backend_summary_add_card (PASBackendSummary *summary, const char *vcard)
g_ptr_array_add (summary->priv->items, new_item);
g_hash_table_insert (summary->priv->id_to_item, new_item->id, new_item);
- gtk_object_unref (GTK_OBJECT (simple));
- gtk_object_unref (GTK_OBJECT (card));
+ g_object_unref (simple);
+ g_object_unref (card);
#ifdef SUMMARY_STATS
summary->priv->size += sizeof (PASBackendSummaryItem);
@@ -746,7 +747,7 @@ pas_backend_summary_remove_card (PASBackendSummary *summary, const char *id)
g_warning ("pas_backend_summary_remove_card: unable to locate id `%s'", id);
}
-static int
+static gboolean
summary_flush_func (gpointer data)
{
PASBackendSummary *summary = PAS_BACKEND_SUMMARY (data);
@@ -778,8 +779,8 @@ pas_backend_summary_touch (PASBackendSummary *summary)
summary->priv->dirty = TRUE;
if (!summary->priv->flush_timeout
&& summary->priv->flush_timeout_millis)
- summary->priv->flush_timeout = gtk_timeout_add (summary->priv->flush_timeout_millis,
- summary_flush_func, summary);
+ summary->priv->flush_timeout = g_timeout_add (summary->priv->flush_timeout_millis,
+ summary_flush_func, summary);
}
gboolean
@@ -1074,8 +1075,8 @@ pas_backend_summary_get_summary_vcard(PASBackendSummary *summary, const char *id
vcard = e_card_simple_get_vcard (simple);
- gtk_object_unref (GTK_OBJECT (simple));
- gtk_object_unref (GTK_OBJECT (card));
+ g_object_unref (simple);
+ g_object_unref (card);
return vcard;
}