From f898a185862d25afe60f06aa07b0992dc649d0ce Mon Sep 17 00:00:00 2001 From: Christoph Hohmann Date: Fri, 14 Sep 2001 22:17:03 +0000 Subject: [PATCH 1/1] comment out menu entry not existing in claws add debug output for non existing menu entries fix next/prev unread message for ignored threads add sourcefile and line number to debug output --- ChangeLog.claws | 13 +++++++++++++ src/mainwindow.c | 2 +- src/menu.c | 6 +++++- src/summaryview.c | 4 ++-- src/utils.c | 4 +++- src/utils.h | 4 +++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 932bf2de5..0cf5c1829 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,16 @@ +2001-09-15 [christoph] + + * src/mainwindow.c + comment out menu entry not existing in claws + * src/menu.c + add debug output for non existing menu entries + * src/summaryview.c + fix next/prev unread message for ignored threads + * src/utils.[ch] + add sourcefile and line number to debug output + otherwise it is sometimes hard to find the + source code part if debug messages are translated + 2001-09-14 [darko] * src/folderview.c diff --git a/src/mainwindow.c b/src/mainwindow.c index ff38950ed..6a554f109 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -1310,7 +1310,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin) {"/Message/Get new mail" , M_HAVE_ACCOUNT|M_UNLOCKED}, {"/Message/Get from all accounts", M_HAVE_ACCOUNT|M_UNLOCKED}, - {"/Message/Compose new message" , M_HAVE_ACCOUNT}, +/* {"/Message/Compose new message" , M_HAVE_ACCOUNT}, */ {"/Message/Reply" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST}, {"/Message/Reply to sender" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST}, {"/Message/Reply to all" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST}, diff --git a/src/menu.c b/src/menu.c index 0906a1e75..efb77b76b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -29,9 +29,9 @@ #include #include - #include "intl.h" #include "menu.h" +#include "utils.h" static gchar *menu_translate(const gchar *path, gpointer data); @@ -80,6 +80,10 @@ void menu_set_sensitive(GtkItemFactory *ifactory, const gchar *path, g_return_if_fail(ifactory != NULL); widget = gtk_item_factory_get_item(ifactory, path); + if(widget == NULL) { + debug_print(_("unknown menu entry %s"), path); + return; + } gtk_widget_set_sensitive(widget, sensitive); } diff --git a/src/summaryview.c b/src/summaryview.c index 353f46857..ba3c52bac 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -1333,7 +1333,7 @@ static GtkCTreeNode *summary_find_prev_unread_msg(SummaryView *summaryview, for (; node != NULL; node = GTK_CTREE_NODE_PREV(node)) { msginfo = gtk_ctree_node_get_row_data(ctree, node); - if (MSG_IS_UNREAD(msginfo->flags)) break; + if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break; } return node; @@ -1353,7 +1353,7 @@ static GtkCTreeNode *summary_find_next_unread_msg(SummaryView *summaryview, for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) { msginfo = gtk_ctree_node_get_row_data(ctree, node); - if (MSG_IS_UNREAD(msginfo->flags)) break; + if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) break; } return node; diff --git a/src/utils.c b/src/utils.c index 70a8fce1d..9c5333f48 100644 --- a/src/utils.c +++ b/src/utils.c @@ -2033,13 +2033,15 @@ void log_verbosity_set(gboolean verbose) log_verbosity_count--; } -void debug_print(const gchar *format, ...) +void debug_print_real(const gchar *file, const guint line, const gchar *format, ...) { va_list args; gchar buf[BUFFSIZE]; if (!debug_mode) return; + printf("%s:%d:", file, line); + va_start(args, format); g_vsnprintf(buf, sizeof(buf), format, args); va_end(args); diff --git a/src/utils.h b/src/utils.h index eb7034e4b..e8b52ae6c 100644 --- a/src/utils.h +++ b/src/utils.h @@ -117,6 +117,8 @@ perror(func); \ } +#define debug_print(format, data...) debug_print_real(__FILE__, __LINE__, format , ##data) + /* for macro expansion */ #define Str(x) #x #define Xstr(x) Str(x) @@ -300,7 +302,7 @@ void get_rfc822_date (gchar *buf, void set_log_file (const gchar *filename); void close_log_file (void); void log_verbosity_set (gboolean verbose); -void debug_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2); +void debug_print_real (const gchar *file, const guint line, const gchar *format, ...) G_GNUC_PRINTF(3, 4); void log_print (const gchar *format, ...) G_GNUC_PRINTF(1, 2); void log_message (const gchar *format, ...) G_GNUC_PRINTF(1, 2); void log_warning (const gchar *format, ...) G_GNUC_PRINTF(1, 2); -- 2.25.1