2006-09-23 [colin] 2.4.0cvs212
authorColin Leroy <colin@colino.net>
Sat, 23 Sep 2006 13:31:18 +0000 (13:31 +0000)
committerColin Leroy <colin@colino.net>
Sat, 23 Sep 2006 13:31:18 +0000 (13:31 +0000)
* src/gtk/inputdialog.c
Fix [ ] remember this appearing in normal
input dialogs after it's been used by
mimeview.
* src/folder.c
* src/folderview.c
* src/msgcache.c
* src/procmsg.c
* src/summaryview.c
* src/textview.c
* src/common/timing.h
Enable timings in debug mode and make it
look prettier.

ChangeLog
PATCHSETS
configure.ac
src/common/timing.h
src/folder.c
src/folderview.c
src/gtk/inputdialog.c
src/msgcache.c
src/procmsg.c
src/summaryview.c
src/textview.c

index 5cdb089..8970457 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2006-09-23 [colin]     2.4.0cvs212
+
+       * src/gtk/inputdialog.c
+               Fix [ ] remember this appearing in normal
+               input dialogs after it's been used by
+               mimeview.
+       * src/folder.c
+       * src/folderview.c
+       * src/msgcache.c
+       * src/procmsg.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/common/timing.h
+               Enable timings in debug mode and make it
+               look prettier.
+
 2006-09-22 [colin]     2.4.0cvs211
 
        * README
index bd540d1..0ca2daf 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.35 -r 1.1.2.36 src/wizard.c;  cvs diff -u -r 1.13.2.20 -r 1.13.2.21 src/common/plugin.c;  ) > 2.4.0cvs209.patchset
 ( cvs diff -u -r 1.8.2.14 -r 1.8.2.15 README;  ) > 2.4.0cvs210.patchset
 ( cvs diff -u -r 1.8.2.15 -r 1.8.2.16 README;  cvs diff -u -r 1.1.2.32 -r 1.1.2.33 commitHelper;  ) > 2.4.0cvs211.patchset
+( cvs diff -u -r 1.213.2.114 -r 1.213.2.115 src/folder.c;  cvs diff -u -r 1.207.2.122 -r 1.207.2.123 src/folderview.c;  cvs diff -u -r 1.16.2.39 -r 1.16.2.40 src/msgcache.c;  cvs diff -u -r 1.150.2.78 -r 1.150.2.79 src/procmsg.c;  cvs diff -u -r 1.395.2.253 -r 1.395.2.254 src/summaryview.c;  cvs diff -u -r 1.96.2.149 -r 1.96.2.150 src/textview.c;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/common/timing.h;  cvs diff -u -r 1.2.2.19 -r 1.2.2.20 src/gtk/inputdialog.c;  ) > 2.4.0cvs212.patchset
index b5d0603..66b1971 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=211
+EXTRA_VERSION=212
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 098c115..5748f3d 100644 (file)
 #  include "config.h"
 #endif
 
-#if 1 /* set to 0 to measure times at various places */
+#include "utils.h"
+# define mytimersub(a, b, result)                                             \
+  do {                                                                        \
+    (result)->tv_sec = (a)->tv_sec - (b)->tv_sec;                             \
+    (result)->tv_usec = (a)->tv_usec - (b)->tv_usec;                          \
+    if ((result)->tv_usec < 0) {                                              \
+      --(result)->tv_sec;                                                     \
+      (result)->tv_usec += 1000000;                                           \
+    }                                                                         \
+  } while (0)
+
+#if 0 /* set to 0 to measure times at various places */
 #define START_TIMING(str) do {} while(0);
 #define END_TIMING() do {} while(0);
 #else
        const char *timing_name=str;                                    \
        gettimeofday(&start, NULL);                                     \
 
+#ifdef __GLIBC__
 #define END_TIMING()                                                   \
        gettimeofday(&end, NULL);                                       \
-       timersub(&end, &start, &diff);                                  \
-       printf("%s: %ds%03dms\n",                                       \
+       mytimersub(&end, &start, &diff);                                \
+       debug_print("TIMING %s %s: %ds%03dms\n",                        \
+               __FUNCTION__,                                           \
                timing_name, (unsigned int)diff.tv_sec,                 \
-               (unsigned int)diff.tv_usec/1000);                               \
-
+               (unsigned int)diff.tv_usec/1000);                       
+#else
+#define END_TIMING()                                                   \
+       gettimeofday(&end, NULL);                                       \
+       mytimersub(&end, &start, &diff);                                \
+       debug_print("TIMING %s: %ds%03dms\n",                           \
+               timing_name, (unsigned int)diff.tv_sec,                 \
+               (unsigned int)diff.tv_usec/1000);                       
 #endif
 
 #endif 
+#endif 
index 4c3f8f8..810ab7e 100644 (file)
@@ -1589,7 +1589,7 @@ void folder_item_process_open (FolderItem *item,
 
 gint folder_item_open(FolderItem *item)
 {
-       START_TIMING("folder_item_open"); 
+       START_TIMING(""); 
        if (item->no_select)
                return -1;
 
@@ -2222,7 +2222,7 @@ void folder_clean_cache_memory(FolderItem *protected_item)
 void folder_item_read_cache(FolderItem *item)
 {
        gchar *cache_file, *mark_file;
-       START_TIMING("folder_item_read_cache");
+       START_TIMING("");
        g_return_if_fail(item != NULL);
 
        if (item->path != NULL) {
index 100b7a4..33af330 100644 (file)
@@ -2056,7 +2056,7 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
        FolderItem *item;
        gchar *buf;
        int res = 0;
-       START_TIMING("--- folderview_selected");
+       START_TIMING("");
        folderview->selected = row;
 
        if (folderview->opened == row) {
index 2161211..b7952ae 100644 (file)
@@ -104,6 +104,8 @@ gchar *input_dialog(const gchar *title, const gchar *message,
        gtk_widget_hide(combo);
        gtk_widget_show(entry);
 
+       gtk_widget_hide(remember_chkbtn);
+
        gtk_widget_show(icon_q);
        gtk_widget_hide(icon_p);
        is_pass = FALSE;
@@ -123,6 +125,7 @@ gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
        type = INPUT_DIALOG_INVISIBLE;
        gtk_widget_hide(combo);
        gtk_widget_show(entry);
+       gtk_widget_hide(remember_chkbtn);
 
        gtk_widget_hide(icon_q);
        gtk_widget_show(icon_p);
@@ -318,6 +321,12 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
        input_dialog_set(title, message, default_string);
        gtk_widget_show(dialog);
 
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_chkbtn), FALSE);
+       if (remember)
+               gtk_widget_show(remember_chkbtn);
+       else
+               gtk_widget_hide(remember_chkbtn);
+
        gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
        manage_window_set_transient(GTK_WINDOW(dialog));
 
index b17d2c4..fd37e87 100644 (file)
@@ -239,7 +239,7 @@ static void msgcache_get_msg_list_func(gpointer key, gpointer value, gpointer us
 MsgInfoList *msgcache_get_msg_list(MsgCache *cache)
 {
        MsgInfoList *msg_list = NULL;
-       START_TIMING("msgcache_get_msg_list");
+       START_TIMING("");
        g_return_val_if_fail(cache != NULL, NULL);
 
        g_hash_table_foreach((GHashTable *)cache->msgnum_table, msgcache_get_msg_list_func, (gpointer)&msg_list);       
@@ -946,7 +946,7 @@ gint msgcache_write(const gchar *cache_file, const gchar *mark_file, MsgCache *c
        gint map_len = -1;
        char *cache_data = NULL;
        char *mark_data = NULL;
-       START_TIMING("*** writing caches");
+       START_TIMING("");
        g_return_val_if_fail(cache_file != NULL, -1);
        g_return_val_if_fail(mark_file != NULL, -1);
        g_return_val_if_fail(cache != NULL, -1);
index 4a54d7d..9e44318 100644 (file)
@@ -249,7 +249,7 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
        MsgInfo *msginfo;
        const gchar *msgid;
         GSList *reflist;
-       START_TIMING("procmsg_get_thread_tree");
+       START_TIMING("");
        root = g_node_new(NULL);
        msgid_table = g_hash_table_new(g_str_hash, g_str_equal);
        
@@ -311,7 +311,7 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
        }
 
        if (prefs_common.thread_by_subject) {
-               START_TIMING("procmsg_get_thread_tree(1)");
+               START_TIMING("thread by subject");
                for (node = root->children; node && node != NULL;) {
                        next = node->next;
                        msginfo = (MsgInfo *) node->data;
index 7670525..7135d3f 100644 (file)
@@ -857,7 +857,7 @@ static gboolean summary_check_consistency(FolderItem *item, GSList *mlist)
 {
        int u = 0, n = 0, m = 0, t = 0;
        GSList *cur;
-       START_TIMING("consistency check");
+       START_TIMING("");
        for(cur = mlist ; cur != NULL && cur->data != NULL ; cur = g_slist_next(cur)) {
                MsgInfo * msginfo = (MsgInfo *) cur->data;
                t++;
@@ -900,7 +900,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
        if (!summaryview->mainwin)
                return FALSE;
-START_TIMING("--------- summary_show");
+       START_TIMING("");
        summaryview->last_displayed = NULL;
        summary_switch_from_to(summaryview, item);
 
@@ -2396,7 +2396,7 @@ void summary_sort(SummaryView *summaryview,
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCListCompareFunc cmp_func = NULL;
-       START_TIMING("summary_sort");
+       START_TIMING("");
        g_signal_handlers_block_by_func(G_OBJECT(summaryview->ctree),
                                       G_CALLBACK(summary_tree_expanded), summaryview);
        gtk_clist_freeze(GTK_CLIST(summaryview->ctree));
@@ -2536,7 +2536,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        GHashTable *msgid_table;
        GHashTable *subject_table;
        GSList * cur;
-       START_TIMING("summary_set_ctree_from_list");
+       START_TIMING("");
        
        if (!mlist) return;
 
@@ -2558,7 +2558,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        
        if (summaryview->threaded) {
                GNode *root, *gnode;
-               START_TIMING("summaryview_set_ctree_from_list(1)");
+               START_TIMING("threaded");
                root = procmsg_get_thread_tree(mlist);
 
                for (gnode = root->children; gnode != NULL;
@@ -2573,7 +2573,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                END_TIMING();
        } else {
                gchar *text[N_SUMMARY_COLS];
-               START_TIMING("summaryview_set_ctree_from_list(2)");
+               START_TIMING("unthreaded");
                cur = mlist;
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
@@ -2628,7 +2628,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
        if (prefs_common.bold_unread) {
-               START_TIMING("summaryview_set_ctree_from_list(3)");
+               START_TIMING("bold_unread");
                while (node) {
                        GtkCTreeNode *next = GTK_CTREE_NODE_NEXT(node);
                        if (GTK_CTREE_ROW(node)->children)
@@ -2913,7 +2913,7 @@ static void summary_display_msg_full(SummaryView *summaryview,
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        MsgInfo *msginfo;
        gint val;
-       START_TIMING("summary_display_msg_full");
+       START_TIMING("");
        if (!new_window) {
                if (summaryview->displayed == row)
                        return;
@@ -4435,7 +4435,7 @@ static void summary_thread_init(SummaryView *summaryview)
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCTreeNode *node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
        GtkCTreeNode *next;
-       START_TIMING("summary_thread_init");
+       START_TIMING("");
        if (!summaryview->thread_collapsed) {
                g_signal_handlers_block_by_func(G_OBJECT(ctree),
                                       G_CALLBACK(summary_tree_expanded), summaryview);
@@ -5601,7 +5601,7 @@ static void summary_sort_by_column_click(SummaryView *summaryview,
                                         FolderSortKey sort_key)
 {
        GtkCTreeNode *node = NULL;
-       START_TIMING("summary_sort_by_column_click");
+       START_TIMING("");
        if (summaryview->sort_key == sort_key)
                summary_sort(summaryview, sort_key,
                             summaryview->sort_type == SORT_ASCENDING
index 440b8b8..39da93e 100644 (file)
@@ -566,7 +566,7 @@ void textview_show_message(TextView *textview, MimeInfo *mimeinfo,
 
 void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
 {
-       START_TIMING("textview_show_part");
+       START_TIMING("");
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
 
@@ -632,7 +632,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo)
        const gchar *name;
        gchar *content_type;
        gint charcount;
-       START_TIMING("textview_add_part");
+       START_TIMING("");
 
        g_return_if_fail(mimeinfo != NULL);
        text = GTK_TEXT_VIEW(textview->text);
@@ -766,7 +766,7 @@ static void recursive_add_parts(TextView *textview, GNode *node)
 {
         GNode * iter;
        MimeInfo *mimeinfo;
-        START_TIMING("recursive_add_parts");
+        START_TIMING("");
 
         mimeinfo = (MimeInfo *) node->data;