0.8.6claws77
authorChristoph Hohmann <reboot@gmx.ch>
Sun, 8 Dec 2002 14:35:05 +0000 (14:35 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Sun, 8 Dec 2002 14:35:05 +0000 (14:35 +0000)
* src/folderview.c
* src/statusbar.c
* src/summaryview.c
* src/common/hooks.[ch]
        hook functions now have a gboolean return value, if a hook
        returns TRUE it will stop executing of any more hooks in
        the same hooklist for this invokation

ChangeLog.claws
configure.in
src/common/hooks.c
src/common/hooks.h
src/common/version.h
src/folderview.c
src/statusbar.c
src/summaryview.c

index 2dc1745..74c7faf 100644 (file)
@@ -1,3 +1,13 @@
+2002-12-08 [christoph] 0.8.6claws77
+
+       * src/folderview.c
+       * src/statusbar.c
+       * src/summaryview.c
+       * src/common/hooks.[ch]
+               hook functions now have a gboolean return value, if a hook
+               returns TRUE it will stop executing of any more hooks in
+               the same hooklist for this invokation
+
 2002-12-08 [colin]     0.8.6claws76
        
        * src/main.c
index e3dcc01..7430544 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws76
+EXTRA_VERSION=claws77
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index e9d7544..634f705 100644 (file)
@@ -74,23 +74,36 @@ void hooks_unregister_hook(gchar *hooklist_name,
 {
 }
 
-static void hooks_marshal(GHook *hook, gpointer source)
+struct MarshalData
+{
+       gpointer        source;
+       gboolean        abort;
+};
+
+static void hooks_marshal(GHook *hook, gpointer data)
 {
        gboolean (*func) (gpointer source, gpointer data);
-       
-       func = hook->func;
-       func(source, hook->data);
+       struct MarshalData *marshal_data = (struct MarshalData *)data;
+
+       if (!marshal_data->abort) {
+               func = hook->func;
+               marshal_data->abort = func(marshal_data->source, hook->data);
+       }
 }
 
 void hooks_invoke(gchar *hooklist_name,
                  gpointer source)
 {
        GHookList *hooklist;
+       struct MarshalData marshal_data;
        
        g_return_if_fail(hooklist_name != NULL);
 
        hooklist = hooks_get_hooklist(hooklist_name);
        g_return_if_fail(hooklist != NULL);
 
-       g_hook_list_marshal(hooklist, TRUE, hooks_marshal, source);
+       marshal_data.source = source;
+       marshal_data.abort = FALSE;
+
+       g_hook_list_marshal(hooklist, TRUE, hooks_marshal, &marshal_data);
 }
index 0e5d31a..e8cfb13 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef HOOKS_H
 #define HOOKS_H
 
-typedef void (*SylpheedHookFunction)   (gpointer source,
-                                        gpointer userdata);
+typedef gboolean (*SylpheedHookFunction)       (gpointer source,
+                                                gpointer userdata);
 
 gint hooks_register_hook       (gchar                  *hooklist_name,
                                 SylpheedHookFunction    hook_func,
index c188c52..a1e8567 100644 (file)
@@ -21,7 +21,7 @@
 #define __VERSION_H__
 
 #define PACKAGE                        "sylpheed"
-#define VERSION                        "0.8.6claws75"
+#define VERSION                        "0.8.6claws77"
 #define PROG_VERSION           "Sylpheed version "VERSION
 
 #endif /* __VERSION_H__ */
index f36e1be..590ae6d 100644 (file)
@@ -260,7 +260,7 @@ static void folderview_drag_data_get     (GtkWidget        *widget,
 
 void folderview_create_folder_node       (FolderView       *folderview, 
                                          FolderItem       *item);
-void folderview_update_item             (gpointer          source,
+gboolean folderview_update_item                 (gpointer          source,
                                          gpointer          data);
 
 static void folderview_scoring_cb(FolderView *folderview, guint action,
@@ -1261,16 +1261,16 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                folderview_update_node(folderview, node);
 }
 
-void folderview_update_item(gpointer source, gpointer data)
+gboolean folderview_update_item(gpointer source, gpointer data)
 {
        FolderItemUpdateData *update_info = (FolderItemUpdateData *)source;
        FolderView *folderview = (FolderView *)data;
        GtkCTree *ctree;
        GtkCTreeNode *node;
 
-       g_return_if_fail(update_info != NULL);
-       g_return_if_fail(update_info->item != NULL);
-       g_return_if_fail(folderview != NULL);
+       g_return_val_if_fail(update_info != NULL, TRUE);
+       g_return_val_if_fail(update_info->item != NULL, TRUE);
+       g_return_val_if_fail(folderview != NULL, TRUE);
 
        ctree = GTK_CTREE(folderview->ctree);
 
@@ -1280,6 +1280,8 @@ void folderview_update_item(gpointer source, gpointer data)
                if (update_info->content_change && folderview->opened == node)
                        summary_show(folderview->summaryview, update_info->item);
        }
+       
+       return FALSE;
 }
 
 static gboolean folderview_gnode_func(GtkCTree *ctree, guint depth,
index 6cb3e78..7f4cc8e 100644 (file)
@@ -35,7 +35,7 @@
 #define BUFFSIZE 1024
 
 static GList *statusbar_list = NULL;
-void statusbar_puts_all_hook (gpointer source, gpointer data);
+gboolean statusbar_puts_all_hook (gpointer source, gpointer data);
 
 GtkWidget *statusbar_create(void)
 {
@@ -51,10 +51,15 @@ GtkWidget *statusbar_create(void)
        return statusbar;
 }
 
-void statusbar_puts_all_hook (gpointer source, gpointer data)
+gboolean statusbar_puts_all_hook (gpointer source, gpointer data)
 {
        LogText *logtext = (LogText *) source;
+
+       g_return_val_if_fail(logtext != NULL, NULL);
+
        statusbar_puts_all(logtext->text);
+
+       return FALSE;
 }
 
 void statusbar_puts(GtkStatusbar *statusbar, const gchar *str)
index 0b7310a..9a2e7b6 100644 (file)
@@ -380,7 +380,7 @@ static void news_flag_crosspost             (MsgInfo *msginfo);
 static void tog_searchbar_cb           (GtkWidget      *w,
                                         gpointer        data);
 
-static void summary_update_msg         (gpointer source, gpointer data);
+static gboolean summary_update_msg     (gpointer source, gpointer data);
 
 GtkTargetEntry summary_drag_types[1] =
 {
@@ -5416,18 +5416,20 @@ void summary_save_prefs_to_folderitem(SummaryView *summaryview, FolderItem *item
        item->threaded = summaryview->threaded;
 }
 
-static void summary_update_msg(gpointer source, gpointer data) {
+static gboolean summary_update_msg(gpointer source, gpointer data) {
        MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
        SummaryView *summaryview = (SummaryView *)data;
        GtkCTreeNode *node;
 
-       g_return_if_fail(msginfo_update != NULL);
-       g_return_if_fail(summaryview != NULL);
+       g_return_val_if_fail(msginfo_update != NULL, TRUE);
+       g_return_val_if_fail(summaryview != NULL, TRUE);
 
        node = gtk_ctree_find_by_row_data(GTK_CTREE(summaryview->ctree), NULL, msginfo_update->msginfo);
        
        if (node) 
                summary_set_row_marks(summaryview, node);
+
+       return FALSE;
 }
 
 /*