2009-12-04 [pawel] 3.7.3cvs32
authorPaweł Pękala <c0rn@gazeta.pl>
Fri, 4 Dec 2009 19:43:38 +0000 (19:43 +0000)
committerPaweł Pękala <c0rn@gazeta.pl>
Fri, 4 Dec 2009 19:43:38 +0000 (19:43 +0000)
* src/messageview.c
Use case insensitive comparison in search for
duplicate urls
* src/uri_opener.c
Refresh scrollbars on every window open

ChangeLog
PATCHSETS
configure.ac
src/messageview.c
src/uri_opener.c

index 035501c..56a71ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-04 [pawel]     3.7.3cvs32
+
+       * src/messageview.c
+               Use case insensitive comparison in search for
+               duplicate urls
+       * src/uri_opener.c
+               Refresh scrollbars on every window open
+
 2009-12-04 [pawel]     3.7.3cvs31
 
        * src/compose.c
index 9b3b913..3b3d37e 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.528 -r 1.382.2.529 src/compose.c;  ) > 3.7.3cvs29.patchset
 ( cvs diff -u -r 1.382.2.529 -r 1.382.2.530 src/compose.c;  ) > 3.7.3cvs30.patchset
 ( cvs diff -u -r 1.382.2.530 -r 1.382.2.531 src/compose.c;  ) > 3.7.3cvs31.patchset
+( cvs diff -u -r 1.94.2.205 -r 1.94.2.206 src/messageview.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/uri_opener.c;  ) > 3.7.3cvs32.patchset
index 40ad0ea..dbc9ba1 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=32
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 915ab38..24f92cd 100644 (file)
@@ -2802,7 +2802,9 @@ void messageview_list_urls (MessageView   *msgview)
 {
        GSList *cur = msgview->mimeview->textview->uri_list;
        GSList *newlist = NULL;
-       GHashTable *uri_hashtable = g_hash_table_new(g_str_hash, g_str_equal); 
+       GHashTable *uri_hashtable = g_hash_table_new(g_str_hash, g_str_equal);
+       gchar *tmp;
+       
        for (; cur; cur = cur->next) {
                ClickableText *uri = (ClickableText *)cur->data;
                if (uri->uri &&
@@ -2812,12 +2814,17 @@ void messageview_list_urls (MessageView *msgview)
                     !g_ascii_strncasecmp(uri->uri, "http:", 5) ||
                     !g_ascii_strncasecmp(uri->uri, "https:", 6)))
                {
-                       if(g_hash_table_lookup(uri_hashtable, uri->uri))
+                       tmp = g_utf8_strdown(uri->uri, -1);
+                       
+                       if (g_hash_table_lookup(uri_hashtable, tmp)) {
+                               g_free(tmp);
                                continue;
+                       }
                        
                        newlist = g_slist_prepend(newlist, uri);
-                       g_hash_table_insert(uri_hashtable, uri->uri,
-                                           GUINT_TO_POINTER(g_str_hash(uri->uri)));
+                       g_hash_table_insert(uri_hashtable, tmp,
+                                           GUINT_TO_POINTER(g_str_hash(tmp)));
+                       g_free(tmp);
                }
        }
        newlist = g_slist_reverse(newlist);
index 263f0bc..252872a 100644 (file)
@@ -47,6 +47,7 @@ enum {
 static struct URIOpener
 {
        GtkWidget *window;
+       GtkWidget *hbox_scroll;
        GtkWidget *hbox1;
        GtkWidget *vbox1;
        GtkWidget *label;
@@ -71,8 +72,6 @@ static void uri_opener_double_clicked(GtkTreeView             *list_view,
 static void uri_opener_create(void);
 void uri_opener_open(MessageView *msgview, GSList *uris)
 {
-       GtkAdjustment *hadj, *vadj;
-       
        cm_return_if_fail(msgview);
        cm_return_if_fail(msgview->mimeview);
        cm_return_if_fail(msgview->mimeview->textview);
@@ -95,14 +94,6 @@ void uri_opener_open(MessageView *msgview, GSList *uris)
        gtk_widget_show(opener.window);
        gtk_widget_grab_focus(opener.urilist);
        gtk_window_set_modal(GTK_WINDOW(opener.window), TRUE);
-       
-       vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(
-                                                  opener.scrolledwin));
-       gtk_adjustment_set_value(vadj, 0);
-       hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(
-                                                  opener.scrolledwin));
-       gtk_adjustment_set_value(hadj, 0);
-
 }
 
 static GtkListStore* uri_opener_create_data_store(void)
@@ -153,9 +144,26 @@ static GtkWidget *uri_opener_list_view_create      (void)
 
 }
 
+static GtkWidget *uri_opener_scrolled_win_create(void)
+{
+       GtkWidget *scrolledwin;
+
+       scrolledwin = gtk_scrolled_window_new(NULL, NULL);
+       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
+                                           GTK_SHADOW_ETCHED_IN);
+       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
+                                      GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+                                      
+       gtk_widget_set_size_request(scrolledwin, 500, 250);
+       gtk_widget_show(scrolledwin);
+       
+       return scrolledwin;
+}
+
 static void uri_opener_create(void) 
 {
        GtkWidget *window;
+       GtkWidget *hbox_scroll;
        GtkWidget *hbox;
        GtkWidget *hbox1;
        GtkWidget *vbox1;
@@ -197,14 +205,10 @@ static void uri_opener_create(void)
        gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
        gtk_box_pack_start(GTK_BOX(vbox1), label, FALSE, TRUE, 0);
        
-       scrolledwin = gtk_scrolled_window_new(NULL, NULL);
-       gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwin),
-                                           GTK_SHADOW_ETCHED_IN);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwin),
-                                      GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-                                      
-       gtk_widget_set_size_request(scrolledwin, 500, 250);
-
+       scrolledwin = uri_opener_scrolled_win_create();
+       hbox_scroll = gtk_hbox_new(FALSE, 0);
+       gtk_box_pack_start(GTK_BOX(hbox_scroll), scrolledwin, TRUE, TRUE, 0);
+       
        select_all_btn = gtk_button_new_with_label(_("Select All"));
        g_signal_connect(G_OBJECT(select_all_btn), "clicked",
                         G_CALLBACK(uri_opener_select_all_cb), NULL);   
@@ -214,7 +218,7 @@ static void uri_opener_create(void)
        gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(""), TRUE, TRUE, 0);
        
        gtk_container_add(GTK_CONTAINER(scrolledwin), urilist);
-       gtk_box_pack_start(GTK_BOX(vbox1), scrolledwin, TRUE, TRUE, 0);
+       gtk_box_pack_start(GTK_BOX(vbox1), hbox_scroll, TRUE, TRUE, 0);
        gtk_box_pack_start(GTK_BOX(vbox1), hbox, FALSE, FALSE, 0);
        gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
        
@@ -222,6 +226,7 @@ static void uri_opener_create(void)
        gtk_container_add(GTK_CONTAINER (window), vbox1);
 
        opener.window = window;
+       opener.hbox_scroll = hbox_scroll;
        opener.hbox1 = hbox1;
        opener.vbox1 = vbox1;
        opener.label = label;
@@ -285,6 +290,16 @@ static void uri_opener_load_uris (void)
                uri_opener_list_view_insert_uri(opener.urilist, NULL, uri);
        }
        
+       g_object_ref(opener.urilist);
+       gtk_container_remove(GTK_CONTAINER(opener.scrolledwin), opener.urilist);
+       gtk_widget_destroy(opener.scrolledwin);
+       
+       opener.scrolledwin = uri_opener_scrolled_win_create();
+       gtk_container_add(GTK_CONTAINER(opener.scrolledwin), opener.urilist);
+       gtk_box_pack_start(GTK_BOX(opener.hbox_scroll),
+                          opener.scrolledwin, TRUE, TRUE, 0);
+       g_object_unref(opener.urilist);
+       
        model = gtk_tree_view_get_model(GTK_TREE_VIEW(opener.urilist));
        gtk_tree_model_get_iter_first(model, &iter);
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(opener.urilist));