From f2c7c41f6cc70e1d509967c7487aec5126495557 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 13 Jan 2011 11:59:23 -0700 Subject: remove the vestiges of Uzbl.run --- src/uzbl-core.c | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 6bbed3c..c6443cc 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -979,52 +979,6 @@ load_uri (WebKitWebView *web_view, GArray *argv, GString *result) { } /* Javascript*/ - -JSValueRef -js_run_command (JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, - size_t argumentCount, const JSValueRef arguments[], - JSValueRef* exception) { - (void) function; - (void) thisObject; - (void) exception; - - JSStringRef js_result_string; - GString *result = g_string_new(""); - - if (argumentCount >= 1) { - JSStringRef arg = JSValueToStringCopy(ctx, arguments[0], NULL); - size_t arg_size = JSStringGetMaximumUTF8CStringSize(arg); - char ctl_line[arg_size]; - JSStringGetUTF8CString(arg, ctl_line, arg_size); - - parse_cmd_line(ctl_line, result); - - JSStringRelease(arg); - } - js_result_string = JSStringCreateWithUTF8CString(result->str); - - g_string_free(result, TRUE); - - return JSValueMakeString(ctx, js_result_string); -} - -JSStaticFunction js_static_functions[] = { - {"run", js_run_command, kJSPropertyAttributeNone}, -}; - -void -js_init() { - /* This function creates the class and its definition, only once */ - if (!uzbl.js.initialized) { - /* it would be pretty cool to make this dynamic */ - uzbl.js.classdef = kJSClassDefinitionEmpty; - uzbl.js.classdef.staticFunctions = js_static_functions; - - uzbl.js.classref = JSClassCreate(&uzbl.js.classdef); - } -} - - void eval_js(WebKitWebView * web_view, gchar *script, GString *result, const char *file) { WebKitWebFrame *frame; @@ -1037,8 +991,6 @@ eval_js(WebKitWebView * web_view, gchar *script, GString *result, const char *fi JSStringRef js_result_string; size_t js_result_size; - js_init(); - frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(web_view)); context = webkit_web_frame_get_global_context(frame); globalobject = JSContextGetGlobalObject(context); -- cgit v1.2.3 From 3c1697ff57a8fb4b01969da16d66ed37f0652d9b Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Thu, 13 Jan 2011 17:44:40 -0700 Subject: don't make the window bigger to accomodate a long status_format --- src/uzbl-core.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index c6443cc..147a9ae 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1943,6 +1943,12 @@ create_window () { gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); gtk_widget_set_name (window, "Uzbl browser"); + /* if the window has been made small, it shouldn't try to resize itself due + * to a long statusbar. */ + GdkGeometry hints; + hints.min_width = 1; + gtk_window_set_geometry_hints (GTK_WINDOW (window), window, &hints, GDK_HINT_MIN_SIZE); + g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (window), "configure-event", G_CALLBACK (configure_event_cb), NULL); -- cgit v1.2.3 From 63f77587bcc44c0edef74690d82555425d59d79a Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 16 Jan 2011 12:23:58 -0700 Subject: explicitly set geometry min_height (fixes a bug in the last commit) --- src/uzbl-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/uzbl-core.c b/src/uzbl-core.c index 147a9ae..877dbda 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1946,7 +1946,8 @@ create_window () { /* if the window has been made small, it shouldn't try to resize itself due * to a long statusbar. */ GdkGeometry hints; - hints.min_width = 1; + hints.min_height = -1; + hints.min_width = 1; gtk_window_set_geometry_hints (GTK_WINDOW (window), window, &hints, GDK_HINT_MIN_SIZE); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); -- cgit v1.2.3 From 835f5d8d09b429a4776192dbe00be5ae20704b16 Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Sun, 16 Jan 2011 12:31:21 -0700 Subject: don't crash when a download content-type can't be found --- src/callbacks.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/callbacks.c b/src/callbacks.c index 7b06873..fa2ed1f 100644 --- a/src/callbacks.c +++ b/src/callbacks.c @@ -825,16 +825,19 @@ download_cb(WebKitWebView *web_view, WebKitDownload *download, gpointer user_dat g_object_get(download, "suggested-filename", &suggested_filename, NULL); /* get the mimetype of the download */ - const gchar *content_type; + const gchar *content_type = NULL; WebKitNetworkResponse *r = webkit_download_get_network_response(download); /* downloads can be initiated from the context menu, in that case there is no network response yet and trying to get one would crash. */ if(WEBKIT_IS_NETWORK_RESPONSE(r)) { - SoupMessage *m = webkit_network_response_get_message(r); - SoupMessageHeaders *h; + SoupMessage *m = webkit_network_response_get_message(r); + SoupMessageHeaders *h = NULL; g_object_get(m, "response-headers", &h, NULL); - content_type = soup_message_headers_get_one(h, "Content-Type"); - } else + if(h) /* some versions of libsoup don't have "response-headers" here */ + content_type = soup_message_headers_get_one(h, "Content-Type"); + } + + if(!content_type) content_type = "application/octet-stream"; /* get the filesize of the download, as given by the server. -- cgit v1.2.3