aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-folder.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-11 01:30:50 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-11 01:30:50 +0800
commit8cb514d6dd9497893a35a089d07a132d51263ee7 (patch)
tree9f4e5d1f929da7e0be900919753d419fe4c9c61a /camel/providers/imap/camel-imap-folder.c
parentbcbb63c59f80eb4e684036c5ef58ab141fb01b03 (diff)
downloadgsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.gz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.bz2
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.lz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.xz
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.tar.zst
gsoc2013-evolution-8cb514d6dd9497893a35a089d07a132d51263ee7.zip
Merge with camel-async.
svn path=/trunk/; revision=4687
Diffstat (limited to 'camel/providers/imap/camel-imap-folder.c')
-rw-r--r--camel/providers/imap/camel-imap-folder.c73
1 files changed, 37 insertions, 36 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 9ab729d218..87554b120d 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -55,7 +55,7 @@
#define d(x) x
-#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (GTK_OBJECT (o)->klass))
+#define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
static CamelFolderClass *parent_class = NULL;
@@ -64,8 +64,6 @@ static void imap_init (CamelFolder *folder, CamelStore *parent_store,
gchar *separator, gboolean path_begns_with_sep,
CamelException *ex);
-static void imap_finalize (GtkObject *object);
-
static void imap_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
static void imap_expunge (CamelFolder *folder, CamelException *ex);
@@ -88,6 +86,8 @@ static const CamelMessageInfo *imap_get_message_info (CamelFolder *folder, const
static GPtrArray *imap_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex);
+static void imap_finalize (CamelObject *object);
+
/* flag methods */
static guint32 imap_get_message_flags (CamelFolder *folder, const char *uid);
static void imap_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
@@ -100,9 +100,8 @@ static void
camel_imap_folder_class_init (CamelImapFolderClass *camel_imap_folder_class)
{
CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_imap_folder_class);
- GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_folder_class);
- parent_class = gtk_type_class (camel_folder_get_type ());
+ parent_class = CAMEL_FOLDER_CLASS(camel_type_get_global_classfuncs (camel_folder_get_type ()));
/* virtual method definition */
@@ -133,8 +132,6 @@ camel_imap_folder_class_init (CamelImapFolderClass *camel_imap_folder_class)
camel_folder_class->set_message_flags = imap_set_message_flags;
camel_folder_class->get_message_user_flag = imap_get_message_user_flag;
camel_folder_class->set_message_user_flag = imap_set_message_user_flag;
-
- gtk_object_class->finalize = imap_finalize;
}
static void
@@ -153,25 +150,19 @@ camel_imap_folder_init (gpointer object, gpointer klass)
imap_folder->lsub = NULL;
}
-GtkType
+CamelType
camel_imap_folder_get_type (void)
{
- static GtkType camel_imap_folder_type = 0;
-
- if (!camel_imap_folder_type) {
- GtkTypeInfo camel_imap_folder_info =
- {
- "CamelImapFolder",
- sizeof (CamelImapFolder),
- sizeof (CamelImapFolderClass),
- (GtkClassInitFunc) camel_imap_folder_class_init,
- (GtkObjectInitFunc) camel_imap_folder_init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL,
- };
-
- camel_imap_folder_type = gtk_type_unique (CAMEL_FOLDER_TYPE, &camel_imap_folder_info);
+ static CamelType camel_imap_folder_type = CAMEL_INVALID_TYPE;
+
+ if (camel_imap_folder_type == CAMEL_INVALID_TYPE) {
+ camel_imap_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelImapFolder",
+ sizeof (CamelImapFolder),
+ sizeof (CamelImapFolderClass),
+ (CamelObjectClassInitFunc) camel_imap_folder_class_init,
+ NULL,
+ (CamelObjectInitFunc) camel_imap_folder_init,
+ (CamelObjectFinalizeFunc) imap_finalize);
}
return camel_imap_folder_type;
@@ -180,7 +171,7 @@ camel_imap_folder_get_type (void)
CamelFolder *
camel_imap_folder_new (CamelStore *parent, char *folder_name, CamelException *ex)
{
- CamelFolder *folder = CAMEL_FOLDER (gtk_object_new (camel_imap_folder_get_type (), NULL));
+ CamelFolder *folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ()));
CamelURL *url = CAMEL_SERVICE (parent)->url;
char *dir_sep;
@@ -238,7 +229,7 @@ imap_folder_summary_free (CamelImapFolder *imap_folder)
}
static void
-imap_finalize (GtkObject *object)
+imap_finalize (CamelObject *object)
{
/* TODO: do we need to do more cleanup here? */
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (object);
@@ -964,9 +955,9 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
camel_stream_filter_remove (f_stream, id);
camel_stream_close (CAMEL_STREAM (f_stream));
#endif
- gtk_object_unref (GTK_OBJECT (msgstream));
- /*gtk_object_unref (GTK_OBJECT (f_stream));*/
-
+ camel_object_unref (CAMEL_OBJECT (msgstream));
+ /*camel_object_unref (CAMEL_OBJECT (f_stream));*/
+
d(fprintf (stderr, "*** We're returning... ***\n"));
return msg;
@@ -991,7 +982,7 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
/* Temp hack - basically we read in the entire message instead of getting a part as it's needed */
msgstream = camel_stream_mem_new ();
camel_stream_write_to_stream (CAMEL_STREAM (imap_stream), msgstream);
- gtk_object_unref (GTK_OBJECT (imap_stream));
+ camel_object_unref (CAMEL_OBJECT (imap_stream));
f_stream = camel_stream_filter_new_with_stream (msgstream);
filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, CAMEL_MIME_FILTER_CRLF_MODE_CRLF_DOTS);
@@ -1005,13 +996,13 @@ imap_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex)
camel_stream_filter_remove (f_stream, id);
camel_stream_close (CAMEL_STREAM (f_stream));
- gtk_object_unref (GTK_OBJECT (msgstream));
- gtk_object_unref (GTK_OBJECT (f_stream));
+ camel_object_unref (CAMEL_OBJECT (msgstream));
+ camel_object_unref (CAMEL_OBJECT (f_stream));
/*camel_data_wrapper_set_mime_type (cdw, "text/plain");*/
/*camel_medium_set_content_object (CAMEL_MEDIUM (msg), CAMEL_DATA_WRAPPER (cdw));*/
- /*gtk_object_unref (GTK_OBJECT (cdw));*/
+ /*camel_object_unref (CAMEL_OBJECT (cdw));*/
return msg;
#endif
@@ -1493,6 +1484,13 @@ imap_search_by_expression (CamelFolder *folder, const char *expression, CamelExc
}
static guint32
+imap_get_permanent_flags (CamelFolder *folder, CamelException *ex)
+{
+ /* return permamnant flags */
+ return folder->permanent_flags;
+}
+
+static guint32
imap_get_message_flags (CamelFolder *folder, const char *uid)
{
const CamelMessageInfo *info;
@@ -1513,7 +1511,8 @@ imap_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, gui
info->flags = (info->flags & ~flags) | (set & flags) | CAMEL_MESSAGE_FOLDER_FLAGGED;
- gtk_signal_emit_by_name (GTK_OBJECT (folder), "message_changed", uid);
+ /*gtk_signal_emit_by_name (GTK_OBJECT (folder), "message_changed", uid);*/
+ camel_object_trigger_event (CAMEL_OBJECT (folder), "message_changed", uid);
}
static gboolean
@@ -1525,7 +1524,8 @@ imap_get_message_user_flag (CamelFolder *folder, const char *uid, const char *na
static void
imap_set_message_user_flag (CamelFolder *folder, const char *uid, const char *name, gboolean value)
{
- gtk_signal_emit_by_name (GTK_OBJECT (folder), "message_changed", uid);
+ /*gtk_signal_emit_by_name (GTK_OBJECT (folder), "message_changed", uid);*/
+ camel_object_trigger_event (CAMEL_OBJECT (folder), "message_changed", uid);
}
void
@@ -1561,5 +1561,6 @@ camel_imap_folder_changed (CamelFolder *folder, gint recent, CamelException *ex)
}
}
- gtk_signal_emit_by_name (GTK_OBJECT (folder), "folder_changed", 0);
+ /*gtk_signal_emit_by_name (GTK_OBJECT (folder), "folder_changed", 0);*/
+ camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", GINT_TO_POINTER (0));
}