aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-folder.c17
-rw-r--r--camel/camel-folder.h3
-rw-r--r--camel/providers/mbox/camel-mbox-folder.c3
-rw-r--r--camel/providers/mbox/camel-mbox-summary.c5
5 files changed, 29 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 0eac71a00a..4ed6f015e9 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -27,6 +27,8 @@
(index_folder): Make sure we index using a decimal uid, since
thats what everything else indexes off (oops).
Upped SUMMARY_VERSION as a result.
+ (camel_mbox_summary_expunge): Oops, my wrong, use the string uid
+ to unindex on.
* providers/mbox/camel-mbox-folder.c (_get_message_by_uid):
Connect to the message_changed signal.
@@ -36,6 +38,8 @@
flags in the summary.
(mbox_expunge): Implement the expunge.
(camel_mbox_folder_class_init): Renamed all leading _'s to mbox_'s
+ (mbox_expunge): Emit a folder_changed signal on expunge (uh, even
+ if it didn't ...)
* camel-folder.c (_finalize): Uh, dont free permanent_flags
anymore (this wouldn't failed anyway, it was a GList !!!)
@@ -43,6 +47,7 @@
(camel_folder_search_cancel): Removed.
(camel_folder_expunge): Changed to only allow expunge on an open
folder. It doesn't make sense for mbox, otherwise (?)
+ (camel_folder_class_init): Added a folder_changed signal.
* camel-folder.h (struct _CamelFolder): Change permanent_flags to
a bitfield.
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index fdf0817a90..c979c3278b 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -35,6 +35,12 @@ static GtkObjectClass *parent_class=NULL;
#define CF_CLASS(so) CAMEL_FOLDER_CLASS (GTK_OBJECT (so)->klass)
+enum SIGNALS {
+ FOLDER_CHANGED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
static void _init (CamelFolder *folder, CamelStore *parent_store,
@@ -186,6 +192,17 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
/* virtual method overload */
gtk_object_class->finalize = _finalize;
+
+ signals[FOLDER_CHANGED] =
+ gtk_signal_new ("folder_changed",
+ GTK_RUN_LAST,
+ gtk_object_class->type,
+ GTK_SIGNAL_OFFSET (CamelFolderClass, folder_changed),
+ gtk_marshal_NONE__INT,
+ GTK_TYPE_NONE, 1, GTK_TYPE_INT);
+
+ gtk_object_class_add_signals (gtk_object_class, signals, LAST_SIGNAL);
+
}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index f7bfc8a490..713b3ced5c 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -127,6 +127,9 @@ struct _CamelFolder
typedef struct {
GtkObjectClass parent_class;
+
+ /* signals */
+ void (*folder_changed) (CamelFolder *, int type);
/* Virtual methods */
void (*init) (CamelFolder *folder, CamelStore *parent_store,
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c
index 7e55610cf8..8c45d64fd7 100644
--- a/camel/providers/mbox/camel-mbox-folder.c
+++ b/camel/providers/mbox/camel-mbox-folder.c
@@ -260,6 +260,9 @@ mbox_expunge (CamelFolder *folder, CamelException *ex)
camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID, /* FIXME: right error code */
"Could not expunge: %s", strerror(errno));
}
+
+ /* TODO: check it actually changed */
+ gtk_signal_emit_by_name((GtkObject *)folder, "folder_changed", 0);
}
diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c
index b4b341fd40..754f211dfe 100644
--- a/camel/providers/mbox/camel-mbox-summary.c
+++ b/camel/providers/mbox/camel-mbox-summary.c
@@ -1429,10 +1429,7 @@ camel_mbox_summary_expunge(CamelMboxSummary *s)
/* remove this message from the index */
if (s->index) {
- char name[32];
-
- sprintf(name, "%x", info->info.uid);
- ibex_unindex(s->index, name);
+ ibex_unindex(s->index, info->info.uid);
}
camel_mbox_summary_remove_uid(s, info->info.uid);