netsurf: branch master updated. release/3.5-215-g78d45e9

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Tue Jul 12 00:31:01 BST 2016


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/78d45e9b828f74667a5e002b46a330fca893fb6d
...commit http://git.netsurf-browser.org/netsurf.git/commit/78d45e9b828f74667a5e002b46a330fca893fb6d
...tree http://git.netsurf-browser.org/netsurf.git/tree/78d45e9b828f74667a5e002b46a330fca893fb6d

The branch, master has been updated
       via  78d45e9b828f74667a5e002b46a330fca893fb6d (commit)
      from  6239b32d92069595da0ba788311a3f9e4e71e690 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=78d45e9b828f74667a5e002b46a330fca893fb6d
commit 78d45e9b828f74667a5e002b46a330fca893fb6d
Author: Vincent Sanders <vince at kyllikki.org>
Commit: Vincent Sanders <vince at kyllikki.org>

    fix gtk TLS certificate viewing with multiple queries

diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c
index 514c826..76894fa 100644
--- a/frontends/gtk/cookies.c
+++ b/frontends/gtk/cookies.c
@@ -129,7 +129,8 @@ nserror nsgtk_cookies_init(void)
 	cookies_treeview = nsgtk_treeview_create(TREE_COOKIES,
 						 wndCookies,
 						 scrolled,
-						 drawing_area);
+						 drawing_area,
+						 NULL);
 	if (cookies_treeview == NULL) {
 		return NSERROR_INIT_FAILED;
 	}
diff --git a/frontends/gtk/history.c b/frontends/gtk/history.c
index fb805d6..0148f37 100644
--- a/frontends/gtk/history.c
+++ b/frontends/gtk/history.c
@@ -144,7 +144,8 @@ nserror nsgtk_history_init(void)
 	global_history_window = nsgtk_treeview_create(TREE_HISTORY,
 						      window,
 						      scrolled,
-						      drawing_area);
+						      drawing_area,
+						      NULL);
 	if (global_history_window == NULL) {
 		return NSERROR_INIT_FAILED;
 	}
diff --git a/frontends/gtk/hotlist.c b/frontends/gtk/hotlist.c
index fa89956..fdc5be3 100644
--- a/frontends/gtk/hotlist.c
+++ b/frontends/gtk/hotlist.c
@@ -140,7 +140,7 @@ nserror nsgtk_hotlist_init(void)
 	
 	tree_hotlist_path = nsoption_charp(hotlist_path);
 	hotlist_treeview = nsgtk_treeview_create(TREE_HOTLIST, window,
-			scrolled, drawing_area);
+						 scrolled, drawing_area, NULL);
 	
 	if (hotlist_treeview == NULL) {
 		return NSERROR_INIT_FAILED;
diff --git a/frontends/gtk/ssl_cert.c b/frontends/gtk/ssl_cert.c
index 742029f..463f5cd 100644
--- a/frontends/gtk/ssl_cert.c
+++ b/frontends/gtk/ssl_cert.c
@@ -96,7 +96,6 @@ void gtk_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
 	gtk_builder_connect_signals(builder, NULL);
 
 	sslcert_viewer_create_session_data(num, url, cb, cbpw, certs, &data);
-	ssl_current_session = data;
 
 	dlg = GTK_DIALOG(gtk_builder_get_object(builder, "wndSSLProblem"));
 
@@ -107,9 +106,11 @@ void gtk_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
 	scrolled = GTK_SCROLLED_WINDOW(gtk_builder_get_object(builder, "SSLScrolled"));
 	drawing_area = GTK_DRAWING_AREA(gtk_builder_get_object(builder, "SSLDrawingArea"));
 
-	ssl_window = nsgtk_treeview_create(TREE_SSLCERT, GTK_WINDOW(dlg), scrolled,
-			drawing_area);
-
+	ssl_window = nsgtk_treeview_create(TREE_SSLCERT,
+					   GTK_WINDOW(dlg),
+					   scrolled,
+					   drawing_area,
+					   data);
 	if (ssl_window == NULL) {
 		free(session);
 		g_object_unref(G_OBJECT(dlg));
diff --git a/frontends/gtk/treeview.c b/frontends/gtk/treeview.c
index 829e87a..e2b1c42 100644
--- a/frontends/gtk/treeview.c
+++ b/frontends/gtk/treeview.c
@@ -52,10 +52,16 @@ struct nsgtk_treeview {
 	int last_x, last_y;
 	browser_mouse_state mouse_state;
 	struct tree *tree;
+	unsigned int tree_flags; /* flags used with tree creation */
+	struct sslcert_session_data *ssl_data; /**< SSL data when tree_flags are TREE_SSLCERT */
 };
 
 void nsgtk_treeview_destroy(struct nsgtk_treeview *tv)
 {
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
 	tree_delete(tv->tree);
 	g_object_unref(tv->input_method);
 	gtk_widget_destroy(GTK_WIDGET(tv->window));
@@ -156,7 +162,7 @@ static void nsgtk_tree_get_window_dimensions(int *width, int *height, void *data
 static gboolean 
 nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 {
-	struct tree *tree = (struct tree *)data;
+	struct nsgtk_treeview *tv = (struct nsgtk_treeview *)data;
 	struct redraw_context ctx = {
 		.interactive = true,
 		.background_images = true,
@@ -172,7 +178,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 	
 	cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
 
-	tree_draw(tree, 0, 0, x1, y1, x2 - x1, y2 - y1, &ctx);
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
+	tree_draw(tv->tree, 0, 0, x1, y1, x2 - x1, y2 - y1, &ctx);
 	
 	current_widget = NULL;
 	
@@ -183,9 +193,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 
 /* signal handler functions for a tree window */
 static gboolean 
-nsgtk_tree_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer g)
+nsgtk_tree_window_draw_event(GtkWidget *widget,
+			     GdkEventExpose *event,
+			     gpointer g)
 {
-	struct tree *tree = (struct tree *) g;
+	struct nsgtk_treeview *tv = (struct nsgtk_treeview *)g;
 	struct redraw_context ctx = {
 		.interactive = true,
 		.background_images = true,
@@ -201,7 +213,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer
 	current_widget = widget;
 	current_cr = gdk_cairo_create(nsgtk_widget_get_window(widget));
 	
-	tree_draw(tree, 0, 0, x, y, width, height, &ctx);
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
+	tree_draw(tv->tree, 0, 0, x, y, width, height, &ctx);
 	
 	current_widget = NULL;
 	cairo_destroy(current_cr);
@@ -220,8 +236,7 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 		GdkEventButton *event, gpointer g)
 {	
 	struct nsgtk_treeview *tw = g;
-	struct tree *tree = tw->tree;
-	
+
 	gtk_im_context_reset(tw->input_method);
 	gtk_widget_grab_focus(GTK_WIDGET(tw->drawing_area));
 
@@ -229,8 +244,9 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 	tw->mouse_pressed_x = event->x;
 	tw->mouse_pressed_y = event->y;
 
-	if (event->type == GDK_2BUTTON_PRESS)
+	if (event->type == GDK_2BUTTON_PRESS) {
 		tw->mouse_state = BROWSER_MOUSE_DOUBLE_CLICK;
+	}
 	
 	switch (event->button) {
 		case 1: tw->mouse_state |= BROWSER_MOUSE_PRESS_1; break;
@@ -249,7 +265,11 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 	tw->last_x = event->x;
 	tw->last_y = event->y;
 
-	tree_mouse_action(tree, tw->mouse_state, event->x, event->y);
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
+	tree_mouse_action(tw->tree, tw->mouse_state, event->x, event->y);
 	
 	return TRUE;
 }
@@ -299,6 +319,9 @@ nsgtk_tree_window_button_release_event(GtkWidget *widget,
 	if (tw->mouse_state & BROWSER_MOUSE_MOD_3 && !alt)
 		tw->mouse_state ^= BROWSER_MOUSE_MOD_3;
 
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
 
 	if (tw->mouse_state &
 			~(BROWSER_MOUSE_MOD_1 |
@@ -345,7 +368,11 @@ nsgtk_tree_window_motion_notify_event(GtkWidget *widget,
 		tw->last_x = INT_MIN;
 		tw->last_y = INT_MIN;
 	}
-	
+
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
 	if (tw->mouse_state & BROWSER_MOUSE_PRESS_1) {
 		/* Start button 1 drag */
 		tree_mouse_action(tree, BROWSER_MOUSE_DRAG_1,
@@ -402,8 +429,13 @@ nsgtk_tree_window_keypress_event(GtkWidget *widget, GdkEventKey *event,
 
 	nskey = gtk_gui_gdkkey_to_nskey(event);
 
-	if (tree_keypress(tree, nskey) == true)
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
+	if (tree_keypress(tree, nskey) == true) {
 		return TRUE;
+	}
 			
 	vscroll = gtk_scrolled_window_get_vadjustment(tw->scrolled);
 	hscroll =  gtk_scrolled_window_get_hadjustment(tw->scrolled);
@@ -508,6 +540,10 @@ nsgtk_tree_window_input_method_commit(GtkIMContext *ctx,
 	struct nsgtk_treeview *tw = (struct nsgtk_treeview *) data;
 	size_t len = strlen(str), offset = 0;
 
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
 	while (offset < len) {
 		uint32_t nskey = utf8_to_ucs4(str + offset, len - offset);
 
@@ -525,11 +561,14 @@ static const struct treeview_table nsgtk_tree_callbacks = {
 	.get_window_dimensions = nsgtk_tree_get_window_dimensions
 };
 
-struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
-		GtkWindow *window, GtkScrolledWindow *scrolled,
- 		GtkDrawingArea *drawing_area)
+struct nsgtk_treeview *
+nsgtk_treeview_create(unsigned int flags,
+		      GtkWindow *window,
+		      GtkScrolledWindow *scrolled,
+		      GtkDrawingArea *drawing_area,
+		      struct sslcert_session_data *ssl_data)
 {
-	struct nsgtk_treeview *tv;	
+	struct nsgtk_treeview *tv;
 	
 	assert(drawing_area != NULL);
 
@@ -539,6 +578,12 @@ struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
 		nsgtk_warning("NoMemory", 0);
 		return NULL;
 	}
+
+	tv->tree_flags = flags;
+	if (tv->tree_flags == TREE_SSLCERT) {
+		tv->ssl_data = ssl_data;
+		ssl_current_session = tv->ssl_data;
+	}
 	
 	tv->window = window;
 	tv->scrolled = scrolled;
@@ -552,7 +597,7 @@ struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
 					       GTK_STATE_NORMAL,
 					       0, 0xffff, 0xffff, 0xffff);
 
-	nsgtk_connect_draw_event(GTK_WIDGET(drawing_area), G_CALLBACK(nsgtk_tree_window_draw_event), tv->tree);
+	nsgtk_connect_draw_event(GTK_WIDGET(drawing_area), G_CALLBACK(nsgtk_tree_window_draw_event), tv);
 	
 #define CONNECT(obj, sig, callback, ptr) \
 	g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
diff --git a/frontends/gtk/treeview.h b/frontends/gtk/treeview.h
index ad8180f..70f2c53 100644
--- a/frontends/gtk/treeview.h
+++ b/frontends/gtk/treeview.h
@@ -25,10 +25,15 @@
 #define __NSGTK_TREEVIEW_H__
 
 struct nsgtk_treeview;
+struct sslcert_session_data;
+
+/**
+ * Create a treeview within a gtk widget.
+ *
+ * \param flags type of treeview.
+ */
+struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags, GtkWindow *window, GtkScrolledWindow *scrolled, GtkDrawingArea *drawing_area, struct sslcert_session_data *ssl_data);
 
-struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
-		GtkWindow *window, GtkScrolledWindow *scrolled,
- 		GtkDrawingArea *drawing_area);
 void nsgtk_treeview_destroy(struct nsgtk_treeview *tv);
 
 struct tree *nsgtk_treeview_get_tree(struct nsgtk_treeview *tv);


-----------------------------------------------------------------------

Summary of changes:
 frontends/gtk/cookies.c  |    3 +-
 frontends/gtk/history.c  |    3 +-
 frontends/gtk/hotlist.c  |    2 +-
 frontends/gtk/ssl_cert.c |    9 +++---
 frontends/gtk/treeview.c |   77 ++++++++++++++++++++++++++++++++++++----------
 frontends/gtk/treeview.h |   11 +++++--
 6 files changed, 79 insertions(+), 26 deletions(-)

diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c
index 514c826..76894fa 100644
--- a/frontends/gtk/cookies.c
+++ b/frontends/gtk/cookies.c
@@ -129,7 +129,8 @@ nserror nsgtk_cookies_init(void)
 	cookies_treeview = nsgtk_treeview_create(TREE_COOKIES,
 						 wndCookies,
 						 scrolled,
-						 drawing_area);
+						 drawing_area,
+						 NULL);
 	if (cookies_treeview == NULL) {
 		return NSERROR_INIT_FAILED;
 	}
diff --git a/frontends/gtk/history.c b/frontends/gtk/history.c
index fb805d6..0148f37 100644
--- a/frontends/gtk/history.c
+++ b/frontends/gtk/history.c
@@ -144,7 +144,8 @@ nserror nsgtk_history_init(void)
 	global_history_window = nsgtk_treeview_create(TREE_HISTORY,
 						      window,
 						      scrolled,
-						      drawing_area);
+						      drawing_area,
+						      NULL);
 	if (global_history_window == NULL) {
 		return NSERROR_INIT_FAILED;
 	}
diff --git a/frontends/gtk/hotlist.c b/frontends/gtk/hotlist.c
index fa89956..fdc5be3 100644
--- a/frontends/gtk/hotlist.c
+++ b/frontends/gtk/hotlist.c
@@ -140,7 +140,7 @@ nserror nsgtk_hotlist_init(void)
 	
 	tree_hotlist_path = nsoption_charp(hotlist_path);
 	hotlist_treeview = nsgtk_treeview_create(TREE_HOTLIST, window,
-			scrolled, drawing_area);
+						 scrolled, drawing_area, NULL);
 	
 	if (hotlist_treeview == NULL) {
 		return NSERROR_INIT_FAILED;
diff --git a/frontends/gtk/ssl_cert.c b/frontends/gtk/ssl_cert.c
index 742029f..463f5cd 100644
--- a/frontends/gtk/ssl_cert.c
+++ b/frontends/gtk/ssl_cert.c
@@ -96,7 +96,6 @@ void gtk_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
 	gtk_builder_connect_signals(builder, NULL);
 
 	sslcert_viewer_create_session_data(num, url, cb, cbpw, certs, &data);
-	ssl_current_session = data;
 
 	dlg = GTK_DIALOG(gtk_builder_get_object(builder, "wndSSLProblem"));
 
@@ -107,9 +106,11 @@ void gtk_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
 	scrolled = GTK_SCROLLED_WINDOW(gtk_builder_get_object(builder, "SSLScrolled"));
 	drawing_area = GTK_DRAWING_AREA(gtk_builder_get_object(builder, "SSLDrawingArea"));
 
-	ssl_window = nsgtk_treeview_create(TREE_SSLCERT, GTK_WINDOW(dlg), scrolled,
-			drawing_area);
-
+	ssl_window = nsgtk_treeview_create(TREE_SSLCERT,
+					   GTK_WINDOW(dlg),
+					   scrolled,
+					   drawing_area,
+					   data);
 	if (ssl_window == NULL) {
 		free(session);
 		g_object_unref(G_OBJECT(dlg));
diff --git a/frontends/gtk/treeview.c b/frontends/gtk/treeview.c
index 829e87a..e2b1c42 100644
--- a/frontends/gtk/treeview.c
+++ b/frontends/gtk/treeview.c
@@ -52,10 +52,16 @@ struct nsgtk_treeview {
 	int last_x, last_y;
 	browser_mouse_state mouse_state;
 	struct tree *tree;
+	unsigned int tree_flags; /* flags used with tree creation */
+	struct sslcert_session_data *ssl_data; /**< SSL data when tree_flags are TREE_SSLCERT */
 };
 
 void nsgtk_treeview_destroy(struct nsgtk_treeview *tv)
 {
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
 	tree_delete(tv->tree);
 	g_object_unref(tv->input_method);
 	gtk_widget_destroy(GTK_WIDGET(tv->window));
@@ -156,7 +162,7 @@ static void nsgtk_tree_get_window_dimensions(int *width, int *height, void *data
 static gboolean 
 nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 {
-	struct tree *tree = (struct tree *)data;
+	struct nsgtk_treeview *tv = (struct nsgtk_treeview *)data;
 	struct redraw_context ctx = {
 		.interactive = true,
 		.background_images = true,
@@ -172,7 +178,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 	
 	cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
 
-	tree_draw(tree, 0, 0, x1, y1, x2 - x1, y2 - y1, &ctx);
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
+	tree_draw(tv->tree, 0, 0, x1, y1, x2 - x1, y2 - y1, &ctx);
 	
 	current_widget = NULL;
 	
@@ -183,9 +193,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, cairo_t *cr, gpointer data)
 
 /* signal handler functions for a tree window */
 static gboolean 
-nsgtk_tree_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer g)
+nsgtk_tree_window_draw_event(GtkWidget *widget,
+			     GdkEventExpose *event,
+			     gpointer g)
 {
-	struct tree *tree = (struct tree *) g;
+	struct nsgtk_treeview *tv = (struct nsgtk_treeview *)g;
 	struct redraw_context ctx = {
 		.interactive = true,
 		.background_images = true,
@@ -201,7 +213,11 @@ nsgtk_tree_window_draw_event(GtkWidget *widget, GdkEventExpose *event, gpointer
 	current_widget = widget;
 	current_cr = gdk_cairo_create(nsgtk_widget_get_window(widget));
 	
-	tree_draw(tree, 0, 0, x, y, width, height, &ctx);
+	if (tv->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tv->ssl_data;
+	}
+
+	tree_draw(tv->tree, 0, 0, x, y, width, height, &ctx);
 	
 	current_widget = NULL;
 	cairo_destroy(current_cr);
@@ -220,8 +236,7 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 		GdkEventButton *event, gpointer g)
 {	
 	struct nsgtk_treeview *tw = g;
-	struct tree *tree = tw->tree;
-	
+
 	gtk_im_context_reset(tw->input_method);
 	gtk_widget_grab_focus(GTK_WIDGET(tw->drawing_area));
 
@@ -229,8 +244,9 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 	tw->mouse_pressed_x = event->x;
 	tw->mouse_pressed_y = event->y;
 
-	if (event->type == GDK_2BUTTON_PRESS)
+	if (event->type == GDK_2BUTTON_PRESS) {
 		tw->mouse_state = BROWSER_MOUSE_DOUBLE_CLICK;
+	}
 	
 	switch (event->button) {
 		case 1: tw->mouse_state |= BROWSER_MOUSE_PRESS_1; break;
@@ -249,7 +265,11 @@ nsgtk_tree_window_button_press_event(GtkWidget *widget,
 	tw->last_x = event->x;
 	tw->last_y = event->y;
 
-	tree_mouse_action(tree, tw->mouse_state, event->x, event->y);
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
+	tree_mouse_action(tw->tree, tw->mouse_state, event->x, event->y);
 	
 	return TRUE;
 }
@@ -299,6 +319,9 @@ nsgtk_tree_window_button_release_event(GtkWidget *widget,
 	if (tw->mouse_state & BROWSER_MOUSE_MOD_3 && !alt)
 		tw->mouse_state ^= BROWSER_MOUSE_MOD_3;
 
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
 
 	if (tw->mouse_state &
 			~(BROWSER_MOUSE_MOD_1 |
@@ -345,7 +368,11 @@ nsgtk_tree_window_motion_notify_event(GtkWidget *widget,
 		tw->last_x = INT_MIN;
 		tw->last_y = INT_MIN;
 	}
-	
+
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
 	if (tw->mouse_state & BROWSER_MOUSE_PRESS_1) {
 		/* Start button 1 drag */
 		tree_mouse_action(tree, BROWSER_MOUSE_DRAG_1,
@@ -402,8 +429,13 @@ nsgtk_tree_window_keypress_event(GtkWidget *widget, GdkEventKey *event,
 
 	nskey = gtk_gui_gdkkey_to_nskey(event);
 
-	if (tree_keypress(tree, nskey) == true)
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
+	if (tree_keypress(tree, nskey) == true) {
 		return TRUE;
+	}
 			
 	vscroll = gtk_scrolled_window_get_vadjustment(tw->scrolled);
 	hscroll =  gtk_scrolled_window_get_hadjustment(tw->scrolled);
@@ -508,6 +540,10 @@ nsgtk_tree_window_input_method_commit(GtkIMContext *ctx,
 	struct nsgtk_treeview *tw = (struct nsgtk_treeview *) data;
 	size_t len = strlen(str), offset = 0;
 
+	if (tw->tree_flags == TREE_SSLCERT) {
+		ssl_current_session = tw->ssl_data;
+	}
+
 	while (offset < len) {
 		uint32_t nskey = utf8_to_ucs4(str + offset, len - offset);
 
@@ -525,11 +561,14 @@ static const struct treeview_table nsgtk_tree_callbacks = {
 	.get_window_dimensions = nsgtk_tree_get_window_dimensions
 };
 
-struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
-		GtkWindow *window, GtkScrolledWindow *scrolled,
- 		GtkDrawingArea *drawing_area)
+struct nsgtk_treeview *
+nsgtk_treeview_create(unsigned int flags,
+		      GtkWindow *window,
+		      GtkScrolledWindow *scrolled,
+		      GtkDrawingArea *drawing_area,
+		      struct sslcert_session_data *ssl_data)
 {
-	struct nsgtk_treeview *tv;	
+	struct nsgtk_treeview *tv;
 	
 	assert(drawing_area != NULL);
 
@@ -539,6 +578,12 @@ struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
 		nsgtk_warning("NoMemory", 0);
 		return NULL;
 	}
+
+	tv->tree_flags = flags;
+	if (tv->tree_flags == TREE_SSLCERT) {
+		tv->ssl_data = ssl_data;
+		ssl_current_session = tv->ssl_data;
+	}
 	
 	tv->window = window;
 	tv->scrolled = scrolled;
@@ -552,7 +597,7 @@ struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
 					       GTK_STATE_NORMAL,
 					       0, 0xffff, 0xffff, 0xffff);
 
-	nsgtk_connect_draw_event(GTK_WIDGET(drawing_area), G_CALLBACK(nsgtk_tree_window_draw_event), tv->tree);
+	nsgtk_connect_draw_event(GTK_WIDGET(drawing_area), G_CALLBACK(nsgtk_tree_window_draw_event), tv);
 	
 #define CONNECT(obj, sig, callback, ptr) \
 	g_signal_connect(G_OBJECT(obj), (sig), G_CALLBACK(callback), (ptr))
diff --git a/frontends/gtk/treeview.h b/frontends/gtk/treeview.h
index ad8180f..70f2c53 100644
--- a/frontends/gtk/treeview.h
+++ b/frontends/gtk/treeview.h
@@ -25,10 +25,15 @@
 #define __NSGTK_TREEVIEW_H__
 
 struct nsgtk_treeview;
+struct sslcert_session_data;
+
+/**
+ * Create a treeview within a gtk widget.
+ *
+ * \param flags type of treeview.
+ */
+struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags, GtkWindow *window, GtkScrolledWindow *scrolled, GtkDrawingArea *drawing_area, struct sslcert_session_data *ssl_data);
 
-struct nsgtk_treeview *nsgtk_treeview_create(unsigned int flags,
-		GtkWindow *window, GtkScrolledWindow *scrolled,
- 		GtkDrawingArea *drawing_area);
 void nsgtk_treeview_destroy(struct nsgtk_treeview *tv);
 
 struct tree *nsgtk_treeview_get_tree(struct nsgtk_treeview *tv);


-- 
NetSurf Browser



More information about the netsurf-commits mailing list