Merge lp:~kalikiana/midori/webkit1.8.3 into lp:midori
- webkit1.8.3
- Merge into trunk
Proposed by
Cris Dywan
Status: | Merged |
---|---|
Approved by: | Paweł Forysiuk |
Approved revision: | 6226 |
Merged at revision: | 6220 |
Proposed branch: | lp:~kalikiana/midori/webkit1.8.3 |
Merge into: | lp:midori |
Diff against target: |
1887 lines (+13/-1126) 20 files modified
README (+1/-1) extensions/formhistory/formhistory-frontend.h (+0/-11) extensions/formhistory/formhistory-gdom-frontend.c (+0/-4) extensions/formhistory/formhistory-js-frontend.c (+0/-141) extensions/formhistory/formhistory.c (+0/-13) extensions/nsplugin-manager.vala (+0/-6) extensions/web-cache.c (+0/-475) katze/katze-item.c (+0/-17) katze/katze-net.c (+0/-35) katze/katze-net.h (+0/-7) katze/midori-paths.vala (+3/-32) midori/midori-browser.c (+0/-33) midori/midori-frontend.c (+0/-2) midori/midori-preferences.c (+0/-10) midori/midori-privatedata.c (+0/-8) midori/midori-searchaction.c (+0/-4) midori/midori-session.c (+0/-11) midori/midori-view.c (+2/-260) midori/midori-websettings.c (+3/-50) wscript (+4/-6) |
To merge this branch: | bzr merge lp:~kalikiana/midori/webkit1.8.3 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paweł Forysiuk | Approve | ||
Review via email:
|
Commit message
Bump WebKit requirement to 1.8.3 and drop support for earlier versions
Description of the change
Bump WebKit requirement to 1.8.3 and drop support for earlier versions
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'README' |
2 | --- README 2013-05-30 11:08:14 +0000 |
3 | +++ README 2013-06-19 20:32:28 +0000 |
4 | @@ -11,7 +11,7 @@ |
5 | * Straightforward bookmark management. |
6 | * Customizable interface, extensions written in C and Vala. |
7 | |
8 | -Requirements: GLib 2.22, GTK+ 2.16, WebkitGTK+ 1.1.17, libXML2, |
9 | +Requirements: GLib 2.22, GTK+ 2.16, WebkitGTK+ 1.8.3, libXML2, |
10 | libsoup 2.27.90, sqlite 3.0, Vala 0.14, libnotify |
11 | |
12 | Optional: GTK+ 3.0, Unique 0.9, gcr, Granite 0.2, WebKit2GTK+ 1.11.91/ 2.0.0 |
13 | |
14 | === modified file 'extensions/formhistory/formhistory-frontend.h' |
15 | --- extensions/formhistory/formhistory-frontend.h 2012-02-19 22:18:41 +0000 |
16 | +++ extensions/formhistory/formhistory-frontend.h 2013-06-19 20:32:28 +0000 |
17 | @@ -18,17 +18,11 @@ |
18 | #include <unistd.h> |
19 | #endif |
20 | |
21 | -#if WEBKIT_CHECK_VERSION (1, 3, 1) |
22 | - #define FORMHISTORY_USE_GDOM 1 |
23 | -#else |
24 | - #define FORMHISTORY_USE_JS 1 |
25 | -#endif |
26 | #define MAXPASSSIZE 64 |
27 | |
28 | typedef struct |
29 | { |
30 | sqlite3* db; |
31 | - #ifdef FORMHISTORY_USE_GDOM |
32 | WebKitDOMElement* element; |
33 | int completion_timeout; |
34 | GtkTreeModel* completion_model; |
35 | @@ -36,9 +30,6 @@ |
36 | GtkWidget* popup; |
37 | gchar* oldkeyword; |
38 | glong selection_index; |
39 | - #else |
40 | - gchar* jsforms; |
41 | - #endif |
42 | gchar* master_password; |
43 | int master_password_canceled; |
44 | } FormHistoryPriv; |
45 | @@ -64,11 +55,9 @@ |
46 | JSContextRef js_context, |
47 | MidoriExtension* extension); |
48 | |
49 | -#ifdef FORMHISTORY_USE_GDOM |
50 | void |
51 | formhistory_suggestions_hide_cb (WebKitDOMElement* element, |
52 | WebKitDOMEvent* dom_event, |
53 | FormHistoryPriv* priv); |
54 | -#endif |
55 | |
56 | #endif |
57 | |
58 | === modified file 'extensions/formhistory/formhistory-gdom-frontend.c' |
59 | --- extensions/formhistory/formhistory-gdom-frontend.c 2012-12-08 02:30:39 +0000 |
60 | +++ extensions/formhistory/formhistory-gdom-frontend.c 2013-06-19 20:32:28 +0000 |
61 | @@ -8,7 +8,6 @@ |
62 | version 2.1 of the License, or (at your option) any later version. |
63 | */ |
64 | #include "formhistory-frontend.h" |
65 | -#ifdef FORMHISTORY_USE_GDOM |
66 | #define COMPLETION_DELAY 200 |
67 | |
68 | FormHistoryPriv* |
69 | @@ -393,14 +392,12 @@ |
70 | for (i = 0; i < webkit_dom_node_list_get_length (inputs); i++) |
71 | { |
72 | WebKitDOMNode* element = webkit_dom_node_list_item (inputs, i); |
73 | - #if WEBKIT_CHECK_VERSION (1, 6, 1) |
74 | gchar* autocomplete = webkit_dom_html_input_element_get_autocomplete ( |
75 | WEBKIT_DOM_HTML_INPUT_ELEMENT (element)); |
76 | gboolean off = !g_strcmp0 (autocomplete, "off"); |
77 | g_free (autocomplete); |
78 | if (off) |
79 | continue; |
80 | - #endif |
81 | |
82 | g_object_set_data (G_OBJECT (element), "doc", doc); |
83 | g_object_set_data (G_OBJECT (element), "webview", web_view); |
84 | @@ -511,4 +508,3 @@ |
85 | G_CALLBACK (formhistory_suggestion_selected_cb), priv); |
86 | return TRUE; |
87 | } |
88 | -#endif |
89 | |
90 | === removed file 'extensions/formhistory/formhistory-js-frontend.c' |
91 | --- extensions/formhistory/formhistory-js-frontend.c 2012-12-07 19:18:26 +0000 |
92 | +++ extensions/formhistory/formhistory-js-frontend.c 1970-01-01 00:00:00 +0000 |
93 | @@ -1,141 +0,0 @@ |
94 | -/* |
95 | - Copyright (C) 2009-2012 Alexander Butenko <a.butenka@gmail.com> |
96 | - Copyright (C) 2009-2012 Christian Dywan <christian@twotoasts.de> |
97 | - |
98 | - This library is free software; you can redistribute it and/or |
99 | - modify it under the terms of the GNU Lesser General Public |
100 | - License as published by the Free Software Foundation; either |
101 | - version 2.1 of the License, or (at your option) any later version. |
102 | -*/ |
103 | -#include "formhistory-frontend.h" |
104 | -#ifdef FORMHISTORY_USE_JS |
105 | - |
106 | -FormHistoryPriv* |
107 | -formhistory_private_new () |
108 | -{ |
109 | - FormHistoryPriv* priv = g_slice_new (FormHistoryPriv); |
110 | - return priv; |
111 | -} |
112 | - |
113 | -gboolean |
114 | -formhistory_construct_popup_gui (FormHistoryPriv* priv) |
115 | -{ |
116 | - gchar* autosuggest; |
117 | - gchar* style; |
118 | - guint i; |
119 | - gchar* file; |
120 | - |
121 | - file = midori_app_find_res_filename ("autosuggestcontrol.js"); |
122 | - if (!g_file_get_contents (file, &autosuggest, NULL, NULL)) |
123 | - { |
124 | - g_free (file); |
125 | - return FALSE; |
126 | - } |
127 | - g_strchomp (autosuggest); |
128 | - |
129 | - katze_assign (file, midori_app_find_res_filename ("autosuggestcontrol.css")); |
130 | - if (!g_file_get_contents (file, &style, NULL, NULL)) |
131 | - { |
132 | - g_free (file); |
133 | - return FALSE; |
134 | - } |
135 | - g_strchomp (style); |
136 | - g_free (file); |
137 | - |
138 | - i = 0; |
139 | - while (style[i]) |
140 | - { |
141 | - if (style[i] == '\n') |
142 | - style[i] = ' '; |
143 | - i++; |
144 | - } |
145 | - |
146 | - priv->jsforms = g_strdup_printf ( |
147 | - "%s" |
148 | - "window.addEventListener ('DOMContentLoaded'," |
149 | - "function () {" |
150 | - " if (document.getElementById('formhistory'))" |
151 | - " return;" |
152 | - " if (!initSuggestions ())" |
153 | - " return;" |
154 | - " var mystyle = document.createElement('style');" |
155 | - " mystyle.setAttribute('type', 'text/css');" |
156 | - " mystyle.setAttribute('id', 'formhistory');" |
157 | - " mystyle.appendChild(document.createTextNode('%s'));" |
158 | - " var head = document.getElementsByTagName('head')[0];" |
159 | - " if (head) head.appendChild(mystyle);" |
160 | - "}, true);", |
161 | - autosuggest, |
162 | - style); |
163 | - g_strstrip (priv->jsforms); |
164 | - g_free (style); |
165 | - g_free (autosuggest); |
166 | - return TRUE; |
167 | -} |
168 | - |
169 | -void |
170 | -formhistory_setup_suggestions (WebKitWebView* web_view, |
171 | - JSContextRef js_context, |
172 | - MidoriExtension* extension) |
173 | -{ |
174 | - GString* suggestions; |
175 | - FormHistoryPriv* priv; |
176 | - static sqlite3_stmt* stmt; |
177 | - const char* sqlcmd; |
178 | - const unsigned char* key; |
179 | - const unsigned char* value; |
180 | - |
181 | - gint result, pos; |
182 | - |
183 | - priv = g_object_get_data (G_OBJECT (extension), "priv"); |
184 | - if (!priv->db) |
185 | - return; |
186 | - |
187 | - if (!stmt) |
188 | - { |
189 | - sqlcmd = "SELECT DISTINCT group_concat(value,'\",\"'), field FROM forms \ |
190 | - GROUP BY field ORDER BY field"; |
191 | - sqlite3_prepare_v2 (priv->db, sqlcmd, strlen (sqlcmd) + 1, &stmt, NULL); |
192 | - } |
193 | - result = sqlite3_step (stmt); |
194 | - if (result != SQLITE_ROW) |
195 | - { |
196 | - if (result == SQLITE_ERROR) |
197 | - g_print (_("Failed to select suggestions\n")); |
198 | - sqlite3_reset (stmt); |
199 | - return; |
200 | - } |
201 | - suggestions = g_string_new ( |
202 | - "function FormSuggestions(eid) { " |
203 | - "arr = new Array();"); |
204 | - |
205 | - while (result == SQLITE_ROW) |
206 | - { |
207 | - pos++; |
208 | - value = sqlite3_column_text (stmt, 0); |
209 | - key = sqlite3_column_text (stmt, 1); |
210 | - if (value) |
211 | - { |
212 | - g_string_append_printf (suggestions, " arr[\"%s\"] = [\"%s\"]; ", |
213 | - (gchar*)key, (gchar*)value); |
214 | - } |
215 | - result = sqlite3_step (stmt); |
216 | - } |
217 | - g_string_append (suggestions, "this.suggestions = arr[eid]; }"); |
218 | - g_string_append (suggestions, priv->jsforms); |
219 | - sokoke_js_script_eval (js_context, suggestions->str, NULL); |
220 | - g_string_free (suggestions, TRUE); |
221 | -} |
222 | - |
223 | -void |
224 | -formhistory_private_destroy (FormHistoryPriv *priv) |
225 | -{ |
226 | - if (priv->db) |
227 | - { |
228 | - sqlite3_close (priv->db); |
229 | - priv->db = NULL; |
230 | - } |
231 | - katze_assign (priv->jsforms, NULL); |
232 | - g_slice_free (FormHistoryPriv, priv); |
233 | -} |
234 | -#endif |
235 | |
236 | === modified file 'extensions/formhistory/formhistory.c' |
237 | --- extensions/formhistory/formhistory.c 2012-12-16 12:59:46 +0000 |
238 | +++ extensions/formhistory/formhistory.c 2013-06-19 20:32:28 +0000 |
239 | @@ -221,9 +221,7 @@ |
240 | js_context = webkit_web_frame_get_global_context (web_frame); |
241 | value = sokoke_js_script_eval (js_context, script, NULL); |
242 | |
243 | -#ifdef FORMHISTORY_USE_GDOM |
244 | formhistory_suggestions_hide_cb (NULL, NULL, priv); |
245 | -#endif |
246 | if (value && *value) |
247 | { |
248 | gchar** inputs = g_strsplit (value, "|||", 0); |
249 | @@ -235,7 +233,6 @@ |
250 | { |
251 | if (strcmp (parts[2], "password")) |
252 | formhistory_update_database (priv->db, NULL, parts[0], parts[1]); |
253 | - #if WEBKIT_CHECK_VERSION (1, 3, 8) |
254 | else |
255 | { |
256 | #if 0 |
257 | @@ -256,7 +253,6 @@ |
258 | g_object_set_data (G_OBJECT (web_view), "FormHistoryPasswordEntry", entry); |
259 | #endif |
260 | } |
261 | - #endif |
262 | } |
263 | g_strfreev (parts); |
264 | i++; |
265 | @@ -287,7 +283,6 @@ |
266 | |
267 | formhistory_setup_suggestions (web_view, js_context, extension); |
268 | |
269 | - #if WEBKIT_CHECK_VERSION (1, 3, 8) |
270 | entry = g_object_get_data (G_OBJECT (web_view), "FormHistoryPasswordEntry"); |
271 | if (entry) |
272 | { |
273 | @@ -301,10 +296,8 @@ |
274 | _("Never for this page"), GTK_RESPONSE_CANCEL, NULL); |
275 | g_object_set_data (G_OBJECT (web_view), "FormHistoryPasswordEntry", NULL); |
276 | } |
277 | - #endif |
278 | } |
279 | |
280 | -#if WEBKIT_CHECK_VERSION (1, 3, 8) |
281 | static gchar* |
282 | formhistory_decrypt (const gchar* data, |
283 | const gchar* password) |
284 | @@ -391,7 +384,6 @@ |
285 | formhistory_fill_login_data (js_context, priv, data); |
286 | g_free (data); |
287 | } |
288 | -#endif |
289 | |
290 | static void |
291 | formhistory_deactivate_cb (MidoriExtension* extension, |
292 | @@ -408,11 +400,8 @@ |
293 | G_CALLBACK (formhistory_window_object_cleared_cb), extension); |
294 | g_signal_connect (web_view, "navigation-policy-decision-requested", |
295 | G_CALLBACK (formhistory_navigation_decision_cb), extension); |
296 | - |
297 | - #if WEBKIT_CHECK_VERSION (1, 3, 8) |
298 | g_signal_connect (web_view, "onload-event", |
299 | G_CALLBACK (formhistory_frame_loaded_cb), extension); |
300 | - #endif |
301 | } |
302 | |
303 | static void |
304 | @@ -460,10 +449,8 @@ |
305 | web_view, formhistory_window_object_cleared_cb, extension); |
306 | g_signal_handlers_disconnect_by_func ( |
307 | web_view, formhistory_navigation_decision_cb, extension); |
308 | - #if WEBKIT_CHECK_VERSION (1, 3, 8) |
309 | g_signal_handlers_disconnect_by_func ( |
310 | web_view, formhistory_frame_loaded_cb, extension); |
311 | - #endif |
312 | } |
313 | |
314 | static void |
315 | |
316 | === modified file 'extensions/nsplugin-manager.vala' |
317 | --- extensions/nsplugin-manager.vala 2013-04-04 21:31:07 +0000 |
318 | +++ extensions/nsplugin-manager.vala 2013-06-19 20:32:28 +0000 |
319 | @@ -9,7 +9,6 @@ |
320 | See the file COPYING for the full license text. |
321 | */ |
322 | |
323 | -#if HAVE_WEBKIT_1_3_8 |
324 | namespace NSPlugins { |
325 | private int active_plugins = 0; |
326 | |
327 | @@ -53,10 +52,8 @@ |
328 | } |
329 | } |
330 | } |
331 | -#endif |
332 | |
333 | public Katze.Array? extension_init () { |
334 | -#if HAVE_WEBKIT_1_3_8 |
335 | if (!Midori.WebSettings.has_plugin_support ()) |
336 | return null; |
337 | |
338 | @@ -70,8 +67,5 @@ |
339 | extensions.add_item (new NSPlugins.Extension (plugin)); |
340 | } |
341 | return extensions; |
342 | -#else |
343 | - return null; |
344 | -#endif |
345 | } |
346 | |
347 | |
348 | === removed file 'extensions/web-cache.c' |
349 | --- extensions/web-cache.c 2012-11-22 01:01:42 +0000 |
350 | +++ extensions/web-cache.c 1970-01-01 00:00:00 +0000 |
351 | @@ -1,475 +0,0 @@ |
352 | -/* |
353 | - Copyright (C) 2009 Christian Dywan <christian@twotoasts.de> |
354 | - Copyright (C) 2009 Alexander Butenko <a.butenka@gmail.com> |
355 | - |
356 | - This library is free software; you can redistribute it and/or |
357 | - modify it under the terms of the GNU Lesser General Public |
358 | - License as published by the Free Software Foundation; either |
359 | - version 2.1 of the License, or (at your option) any later version. |
360 | - |
361 | - See the file COPYING for the full license text. |
362 | -*/ |
363 | - |
364 | -#include <midori/midori.h> |
365 | -#include <glib/gstdio.h> |
366 | -#include <stdlib.h> |
367 | - |
368 | -#include "config.h" |
369 | -#if HAVE_UNISTD_H |
370 | - #include <unistd.h> |
371 | -#endif |
372 | - |
373 | -#if !WEBKIT_CHECK_VERSION (1, 3, 11) |
374 | - |
375 | -#define MAXLENGTH 1024 * 1024 |
376 | - |
377 | -static gchar* |
378 | -web_cache_get_cache_dir (void) |
379 | -{ |
380 | - static gchar* cache_dir = NULL; |
381 | - if (!cache_dir) |
382 | - cache_dir = g_build_filename (midori_paths_get_cache_dir (), "web", NULL); |
383 | - return cache_dir; |
384 | -} |
385 | - |
386 | -static gchar* |
387 | -web_cache_get_cached_path (MidoriExtension* extension, |
388 | - const gchar* uri) |
389 | -{ |
390 | - gchar* checksum; |
391 | - gchar* folder; |
392 | - gchar* sub_path; |
393 | - gchar* encoded; |
394 | - gchar* ext; |
395 | - gchar* cached_filename; |
396 | - gchar* cached_path; |
397 | - |
398 | - checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); |
399 | - folder = g_strdup_printf ("%c%c", checksum[0], checksum[1]); |
400 | - sub_path = g_build_path (G_DIR_SEPARATOR_S, |
401 | - web_cache_get_cache_dir (), folder, NULL); |
402 | - katze_mkdir_with_parents (sub_path, 0700); |
403 | - g_free (folder); |
404 | - |
405 | - encoded = soup_uri_encode (uri, "/"); |
406 | - ext = g_strdup (g_strrstr (encoded, ".")); |
407 | - /* Make sure ext isn't becoming too long */ |
408 | - if (ext && ext[0] && ext[1] && ext[2] && ext[3] && ext[4]) |
409 | - ext[4] = '\0'; |
410 | - cached_filename = g_strdup_printf ("%s%s", checksum, ext ? ext : ""); |
411 | - g_free (ext); |
412 | - g_free (encoded); |
413 | - g_free (checksum); |
414 | - cached_path = g_build_filename (sub_path, cached_filename, NULL); |
415 | - g_free (cached_filename); |
416 | - return cached_path; |
417 | -} |
418 | - |
419 | -static gboolean |
420 | -web_cache_save_headers (SoupMessage* msg, |
421 | - gchar* filename) |
422 | -{ |
423 | - gchar* dsc_filename = g_strdup_printf ("%s.dsc.tmp", filename); |
424 | - SoupMessageHeaders* hdrs = msg->response_headers; |
425 | - SoupMessageHeadersIter iter; |
426 | - const gchar* name, *value; |
427 | - FILE* dscfd; |
428 | - |
429 | - soup_message_headers_iter_init (&iter, hdrs); |
430 | - dscfd = g_fopen (dsc_filename, "w"); |
431 | - g_free (dsc_filename); |
432 | - if (!dscfd) |
433 | - return FALSE; |
434 | - |
435 | - while (soup_message_headers_iter_next (&iter, &name, &value)) |
436 | - g_fprintf (dscfd, "%s: %s\n", name, value); |
437 | - fclose (dscfd); |
438 | - |
439 | - return TRUE; |
440 | -} |
441 | - |
442 | -static GHashTable* |
443 | -web_cache_get_headers (gchar* filename) |
444 | -{ |
445 | - GHashTable* headers; |
446 | - FILE* file; |
447 | - gchar* dsc_filename; |
448 | - gchar line[128]; |
449 | - |
450 | - if (!filename) |
451 | - return NULL; |
452 | - |
453 | - /* use g_access() instead of g_file_test for better performance */ |
454 | - if (g_access (filename, F_OK) != 0) |
455 | - return NULL; |
456 | - |
457 | - dsc_filename = g_strdup_printf ("%s.dsc", filename); |
458 | - headers = g_hash_table_new_full (g_str_hash, g_str_equal, |
459 | - (GDestroyNotify)g_free, |
460 | - (GDestroyNotify)g_free); |
461 | - |
462 | - if (!(file = g_fopen (dsc_filename, "r"))) |
463 | - { |
464 | - g_hash_table_destroy (headers); |
465 | - g_free (dsc_filename); |
466 | - return NULL; |
467 | - } |
468 | - while (fgets (line, 128, file)) |
469 | - { |
470 | - gchar** data; |
471 | - |
472 | - if (line == NULL) |
473 | - continue; |
474 | - |
475 | - g_strchomp (line); |
476 | - data = g_strsplit (line, ":", 2); |
477 | - if (data[0] && data[1]) |
478 | - g_hash_table_insert (headers, g_strdup (data[0]), |
479 | - g_strdup (g_strchug (data[1]))); |
480 | - g_strfreev (data); |
481 | - } |
482 | - fclose (file); |
483 | - g_free (dsc_filename); |
484 | - return headers; |
485 | -} |
486 | - |
487 | -static GFile* |
488 | -web_cache_tmp_prepare (gchar* filename) |
489 | -{ |
490 | - GFile *file; |
491 | - |
492 | - gchar* tmp_filename = g_strdup_printf ("%s.tmp", filename); |
493 | - if (g_access (tmp_filename, F_OK) == 0) |
494 | - { |
495 | - g_free (tmp_filename); |
496 | - return NULL; |
497 | - } |
498 | - file = g_file_new_for_path (tmp_filename); |
499 | - g_free (tmp_filename); |
500 | - |
501 | - return file; |
502 | -} |
503 | - |
504 | -static void |
505 | -web_cache_set_content_type (SoupMessage* msg, |
506 | - SoupBuffer* buffer) |
507 | -{ |
508 | - gchar* sniffed_type; |
509 | - SoupContentSniffer* sniffer = soup_content_sniffer_new (); |
510 | - if ((sniffed_type = soup_content_sniffer_sniff (sniffer, msg, buffer, NULL))) |
511 | - { |
512 | - g_signal_emit_by_name (msg, "content-sniffed", sniffed_type, NULL); |
513 | - g_free (sniffed_type); |
514 | - } |
515 | - else |
516 | - { |
517 | - const gchar* content_type = soup_message_headers_get_one ( |
518 | - msg->response_headers, "Content-Type"); |
519 | - g_signal_emit_by_name (msg, "content-sniffed", content_type, NULL); |
520 | - } |
521 | -} |
522 | - |
523 | -static void |
524 | -web_cache_message_finished_cb (SoupMessage* msg, |
525 | - GOutputStream* stream) |
526 | -{ |
527 | - gchar* headers; |
528 | - gchar* tmp_headers; |
529 | - gchar* tmp_data; |
530 | - gchar* filename; |
531 | - |
532 | - filename = g_object_get_data (G_OBJECT (stream), "filename"); |
533 | - headers = g_strdup_printf ("%s.dsc", filename); |
534 | - tmp_headers = g_strdup_printf ("%s.dsc.tmp", filename); |
535 | - tmp_data = g_strdup_printf ("%s.tmp", filename); |
536 | - g_output_stream_close (stream, NULL, NULL); |
537 | - |
538 | - if (msg->status_code == SOUP_STATUS_OK) |
539 | - { |
540 | - g_rename (tmp_data, filename); |
541 | - g_rename (tmp_headers, headers); |
542 | - } |
543 | - else |
544 | - { |
545 | - g_unlink (tmp_data); |
546 | - g_unlink (tmp_headers); |
547 | - } |
548 | - |
549 | - g_object_unref (stream); |
550 | - g_free (headers); |
551 | - g_free (tmp_headers); |
552 | - g_free (tmp_data); |
553 | -} |
554 | - |
555 | -static void web_cache_pause_message (SoupMessage* msg) |
556 | -{ |
557 | - SoupSession* session; |
558 | - session = g_object_get_data (G_OBJECT (msg), "session"); |
559 | - soup_session_pause_message (session, msg); |
560 | -} |
561 | - |
562 | -static void web_cache_unpause_message (SoupMessage* msg) |
563 | -{ |
564 | - SoupSession* session; |
565 | - session = g_object_get_data (G_OBJECT (msg), "session"); |
566 | - soup_session_unpause_message (session, msg); |
567 | -} |
568 | - |
569 | -static void |
570 | -web_cache_message_got_chunk_cb (SoupMessage* msg, |
571 | - SoupBuffer* chunk, |
572 | - GOutputStream* stream) |
573 | -{ |
574 | - if (!chunk->data || !chunk->length) |
575 | - return; |
576 | - /* FIXME g_output_stream_write_async (stream, chunk->data, chunk->length, |
577 | - G_PRIORITY_DEFAULT, NULL, NULL, (gpointer)chunk->length); */ |
578 | - g_output_stream_write (stream, chunk->data, chunk->length, NULL, NULL); |
579 | -} |
580 | - |
581 | -static void |
582 | -web_cache_message_rewrite_async_cb (GFile *file, |
583 | - GAsyncResult* res, |
584 | - SoupMessage* msg) |
585 | -{ |
586 | - SoupBuffer *buffer; |
587 | - char *data; |
588 | - gsize length; |
589 | - GError *error = NULL; |
590 | - |
591 | - if (g_file_load_contents_finish (file, res, &data, &length, NULL, &error)) |
592 | - { |
593 | - buffer = soup_buffer_new (SOUP_MEMORY_TEMPORARY, data, length); |
594 | - web_cache_set_content_type (msg, buffer); |
595 | - soup_message_body_append_buffer (msg->response_body, buffer); |
596 | - /* FIXME? */ |
597 | - web_cache_unpause_message (msg); |
598 | - g_signal_emit_by_name (msg, "got-chunk", buffer, NULL); |
599 | - soup_buffer_free (buffer); |
600 | - g_free (data); |
601 | - soup_message_got_body (msg); |
602 | - soup_message_finished (msg); |
603 | - } |
604 | - g_object_unref (file); |
605 | - g_object_unref (msg); |
606 | -} |
607 | - |
608 | -static void |
609 | -web_cache_message_rewrite (SoupMessage* msg, |
610 | - gchar* filename) |
611 | -{ |
612 | - GHashTableIter iter; |
613 | - gpointer key, value; |
614 | - GFile *file; |
615 | - |
616 | - GHashTable* cache_headers = web_cache_get_headers (filename); |
617 | - if (!cache_headers) |
618 | - return; |
619 | - |
620 | - soup_message_set_status (msg, SOUP_STATUS_OK); |
621 | - g_hash_table_iter_init (&iter, cache_headers); |
622 | - while (g_hash_table_iter_next (&iter, &key, &value)) |
623 | - soup_message_headers_replace (msg->response_headers, key, value); |
624 | - g_signal_emit_by_name (msg, "got-headers", NULL); |
625 | - g_hash_table_destroy (cache_headers); |
626 | - |
627 | - /* FIXME? It seems libsoup already said "goodbye" by the time |
628 | - the asynchronous function is starting to send data */ |
629 | - web_cache_pause_message (msg); |
630 | - file = g_file_new_for_path (filename); |
631 | - g_free (filename); |
632 | - g_object_ref (msg); |
633 | - g_file_load_contents_async (file, NULL, |
634 | - (GAsyncReadyCallback)web_cache_message_rewrite_async_cb, msg); |
635 | -} |
636 | - |
637 | -static void |
638 | -web_cache_mesage_got_headers_cb (SoupMessage* msg, |
639 | - gchar* filename) |
640 | -{ |
641 | - const gchar* nocache; |
642 | - SoupMessageHeaders *hdrs = msg->response_headers; |
643 | - const char* cl; |
644 | - |
645 | - /* Skip files downloaded by the user */ |
646 | - if (g_object_get_data (G_OBJECT (msg), "midori-web-cache-download")) |
647 | - return; |
648 | - |
649 | - /* Skip big files */ |
650 | - cl = soup_message_headers_get_one (hdrs, "Content-Length"); |
651 | - if (cl && atoi (cl) > MAXLENGTH) |
652 | - return; |
653 | - |
654 | - nocache = soup_message_headers_get_one (hdrs, "Pragma"); |
655 | - if (!nocache) |
656 | - nocache = soup_message_headers_get_one (hdrs, "Cache-Control"); |
657 | - if (nocache && g_regex_match_simple ("no-cache|no-store", nocache, |
658 | - G_REGEX_CASELESS, G_REGEX_MATCH_NOTEMPTY)) |
659 | - { |
660 | - return; |
661 | - } |
662 | - |
663 | - if (msg->status_code == SOUP_STATUS_NOT_MODIFIED) |
664 | - { |
665 | - /* g_debug ("loading from cache: %s", filename); */ |
666 | - g_signal_handlers_disconnect_by_func (msg, |
667 | - web_cache_mesage_got_headers_cb, filename); |
668 | - web_cache_message_rewrite (msg, filename); |
669 | - } |
670 | - else if (msg->status_code == SOUP_STATUS_OK) |
671 | - { |
672 | - GFile* file; |
673 | - GOutputStream* ostream; |
674 | - |
675 | - /* g_debug ("updating cache: %s", filename); */ |
676 | - if (!(file = web_cache_tmp_prepare (filename))) |
677 | - return; |
678 | - if (!web_cache_save_headers (msg, filename)) |
679 | - return; |
680 | - |
681 | - ostream = (GOutputStream*)g_file_append_to (file, |
682 | - G_FILE_CREATE_PRIVATE | G_FILE_CREATE_REPLACE_DESTINATION, NULL, NULL); |
683 | - g_object_unref (file); |
684 | - |
685 | - if (!ostream) |
686 | - return; |
687 | - |
688 | - g_object_set_data_full (G_OBJECT (ostream), "filename", |
689 | - filename, (GDestroyNotify)g_free); |
690 | - g_signal_connect (msg, "got-chunk", |
691 | - G_CALLBACK (web_cache_message_got_chunk_cb), ostream); |
692 | - g_signal_connect (msg, "finished", |
693 | - G_CALLBACK (web_cache_message_finished_cb), ostream); |
694 | - } |
695 | -} |
696 | - |
697 | -static void |
698 | -web_cache_session_request_queued_cb (SoupSession* session, |
699 | - SoupMessage* msg, |
700 | - MidoriExtension* extension) |
701 | -{ |
702 | - SoupURI* soup_uri = soup_message_get_uri (msg); |
703 | - gchar* uri = soup_uri_to_string (soup_uri, FALSE); |
704 | - |
705 | - if (midori_uri_is_http (uri) && !g_strcmp0 (msg->method, "GET")) |
706 | - { |
707 | - gchar* filename = web_cache_get_cached_path (extension, uri); |
708 | - GHashTable* cache_headers; |
709 | - gchar* etag; |
710 | - gchar* last_modified; |
711 | - |
712 | - cache_headers = web_cache_get_headers (filename); |
713 | - if (cache_headers) |
714 | - { |
715 | - etag = g_hash_table_lookup (cache_headers, "ETag"); |
716 | - last_modified = g_hash_table_lookup (cache_headers, "Last-Modified"); |
717 | - if (etag) |
718 | - soup_message_headers_replace (msg->request_headers, |
719 | - "If-None-Match", etag); |
720 | - if (last_modified) |
721 | - soup_message_headers_replace (msg->request_headers, |
722 | - "If-Modified-Since", last_modified); |
723 | - g_hash_table_destroy (cache_headers); |
724 | - } |
725 | - g_object_set_data (G_OBJECT (msg), "session", session); |
726 | - g_signal_connect (msg, "got-headers", |
727 | - G_CALLBACK (web_cache_mesage_got_headers_cb), filename); |
728 | - |
729 | - } |
730 | - g_free (uri); |
731 | -} |
732 | - |
733 | -static void |
734 | -web_cache_add_download_cb (MidoriBrowser* browser, |
735 | - WebKitDownload* download, |
736 | - MidoriExtension* extension) |
737 | -{ |
738 | - WebKitNetworkRequest* request = webkit_download_get_network_request (download); |
739 | - SoupMessage* msg = webkit_network_request_get_message (request); |
740 | - if (msg) |
741 | - g_object_set_data (G_OBJECT (msg), "midori-web-cache-download", |
742 | - (gpointer)0xdeadbeef); |
743 | -} |
744 | - |
745 | -static void |
746 | -web_cache_deactivate_cb (MidoriExtension* extension, |
747 | - MidoriBrowser* browser); |
748 | - |
749 | -static void |
750 | -web_cache_app_add_browser_cb (MidoriApp* app, |
751 | - MidoriBrowser* browser, |
752 | - MidoriExtension* extension) |
753 | -{ |
754 | - g_signal_connect (browser, "add-download", |
755 | - G_CALLBACK (web_cache_add_download_cb), extension); |
756 | - g_signal_connect (extension, "deactivate", |
757 | - G_CALLBACK (web_cache_deactivate_cb), browser); |
758 | -} |
759 | - |
760 | -static void |
761 | -web_cache_deactivate_cb (MidoriExtension* extension, |
762 | - MidoriBrowser* browser) |
763 | -{ |
764 | - MidoriApp* app = midori_extension_get_app (extension); |
765 | - SoupSession* session = webkit_get_default_session (); |
766 | - |
767 | - g_signal_handlers_disconnect_by_func ( |
768 | - session, web_cache_session_request_queued_cb, extension); |
769 | - g_signal_handlers_disconnect_by_func ( |
770 | - extension, web_cache_deactivate_cb, browser); |
771 | - g_signal_handlers_disconnect_by_func ( |
772 | - app, web_cache_app_add_browser_cb, extension); |
773 | - g_signal_handlers_disconnect_by_func ( |
774 | - browser, web_cache_add_download_cb, extension); |
775 | -} |
776 | - |
777 | -static void |
778 | -web_cache_activate_cb (MidoriExtension* extension, |
779 | - MidoriApp* app) |
780 | -{ |
781 | - KatzeArray* browsers; |
782 | - MidoriBrowser* browser; |
783 | - SoupSession* session = webkit_get_default_session (); |
784 | - |
785 | - katze_mkdir_with_parents (web_cache_get_cache_dir (), 0700); |
786 | - g_signal_connect (session, "request-queued", |
787 | - G_CALLBACK (web_cache_session_request_queued_cb), extension); |
788 | - |
789 | - browsers = katze_object_get_object (app, "browsers"); |
790 | - KATZE_ARRAY_FOREACH_ITEM (browser, browsers) |
791 | - web_cache_app_add_browser_cb (app, browser, extension); |
792 | - g_signal_connect (app, "add-browser", |
793 | - G_CALLBACK (web_cache_app_add_browser_cb), extension); |
794 | - |
795 | - g_object_unref (browsers); |
796 | -} |
797 | - |
798 | -static void |
799 | -web_cache_clear_cache_cb (void) |
800 | -{ |
801 | - midori_paths_remove_path (web_cache_get_cache_dir ()); |
802 | -} |
803 | -#endif |
804 | - |
805 | -MidoriExtension* |
806 | -extension_init (void) |
807 | -{ |
808 | - #if WEBKIT_CHECK_VERSION (1, 3, 11) |
809 | - return NULL; |
810 | - #else |
811 | - MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION, |
812 | - "name", _("Web Cache"), |
813 | - "description", _("Cache HTTP communication on disk"), |
814 | - "version", "0.1" MIDORI_VERSION_SUFFIX, |
815 | - "authors", "Christian Dywan <christian@twotoasts.de>", |
816 | - NULL); |
817 | - |
818 | - g_signal_connect (extension, "activate", |
819 | - G_CALLBACK (web_cache_activate_cb), NULL); |
820 | - |
821 | - midori_private_data_register_item ("web-cache", _("Web Cache"), |
822 | - G_CALLBACK (web_cache_clear_cache_cb)); |
823 | - |
824 | - return extension; |
825 | - #endif |
826 | -} |
827 | |
828 | === modified file 'katze/katze-item.c' |
829 | --- katze/katze-item.c 2013-05-31 22:00:38 +0000 |
830 | +++ katze/katze-item.c 2013-06-19 20:32:28 +0000 |
831 | @@ -458,14 +458,8 @@ |
832 | katze_item_image_destroyed_cb (GtkWidget* image, |
833 | KatzeItem* item); |
834 | #ifndef HAVE_WEBKIT2 |
835 | -#if WEBKIT_CHECK_VERSION (1, 3, 13) |
836 | static void |
837 | -#if WEBKIT_CHECK_VERSION (1, 8, 0) |
838 | katze_item_icon_loaded_cb (WebKitFaviconDatabase* database, |
839 | -#elif WEBKIT_CHECK_VERSION (1, 3, 13) |
840 | -katze_item_icon_loaded_cb (WebKitIconDatabase* database, |
841 | - WebKitWebFrame* web_frame, |
842 | -#endif |
843 | const gchar* frame_uri, |
844 | GtkWidget* image) |
845 | { |
846 | @@ -482,20 +476,14 @@ |
847 | } |
848 | } |
849 | #endif |
850 | -#endif |
851 | |
852 | static void |
853 | katze_item_image_destroyed_cb (GtkWidget* image, |
854 | KatzeItem* item) |
855 | { |
856 | #ifndef HAVE_WEBKIT2 |
857 | - #if WEBKIT_CHECK_VERSION (1, 8, 0) |
858 | g_signal_handlers_disconnect_by_func (webkit_get_favicon_database (), |
859 | katze_item_icon_loaded_cb, image); |
860 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
861 | - g_signal_handlers_disconnect_by_func (webkit_get_icon_database (), |
862 | - katze_item_icon_loaded_cb, image); |
863 | - #endif |
864 | #endif |
865 | g_object_unref (item); |
866 | } |
867 | @@ -532,13 +520,8 @@ |
868 | g_signal_connect (image, "destroy", |
869 | G_CALLBACK (katze_item_image_destroyed_cb), item); |
870 | #ifndef HAVE_WEBKIT2 |
871 | - #if WEBKIT_CHECK_VERSION (1, 8, 0) |
872 | g_signal_connect (webkit_get_favicon_database (), "icon-loaded", |
873 | G_CALLBACK (katze_item_icon_loaded_cb), image); |
874 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
875 | - g_signal_connect (webkit_get_icon_database (), "icon-loaded", |
876 | - G_CALLBACK (katze_item_icon_loaded_cb), image); |
877 | - #endif |
878 | #endif |
879 | return image; |
880 | } |
881 | |
882 | === modified file 'katze/katze-net.c' |
883 | --- katze/katze-net.c 2013-02-21 19:18:50 +0000 |
884 | +++ katze/katze-net.c 2013-06-19 20:32:28 +0000 |
885 | @@ -77,41 +77,6 @@ |
886 | g_slice_free (KatzeNetPriv, priv); |
887 | } |
888 | |
889 | -#if !WEBKIT_CHECK_VERSION (1, 3, 13) |
890 | -gchar* |
891 | -katze_net_get_cached_path (KatzeNet* net, |
892 | - const gchar* uri, |
893 | - const gchar* subfolder) |
894 | -{ |
895 | - gchar* checksum; |
896 | - gchar* extension; |
897 | - gchar* cached_filename; |
898 | - gchar* cached_path; |
899 | - |
900 | - if (uri == NULL) |
901 | - return NULL; |
902 | - |
903 | - checksum = g_compute_checksum_for_string (G_CHECKSUM_MD5, uri, -1); |
904 | - extension = g_strrstr (uri, "."); |
905 | - cached_filename = g_strdup_printf ("%s%s", checksum, |
906 | - extension ? extension : ""); |
907 | - g_free (checksum); |
908 | - |
909 | - if (subfolder) |
910 | - { |
911 | - gchar* cache_path = g_build_filename (midori_paths_get_cache_dir_for_reading (), subfolder, NULL); |
912 | - katze_mkdir_with_parents (cache_path, 0700); |
913 | - cached_path = g_build_filename (cache_path, cached_filename, NULL); |
914 | - g_free (cache_path); |
915 | - } |
916 | - else |
917 | - cached_path = g_build_filename (midori_paths_get_cache_dir (), cached_filename, NULL); |
918 | - |
919 | - g_free (cached_filename); |
920 | - return cached_path; |
921 | -} |
922 | -#endif |
923 | - |
924 | static void |
925 | katze_net_got_body_cb (SoupMessage* msg, |
926 | KatzeNetPriv* priv); |
927 | |
928 | === modified file 'katze/katze-net.h' |
929 | --- katze/katze-net.h 2013-02-21 21:36:30 +0000 |
930 | +++ katze/katze-net.h 2013-06-19 20:32:28 +0000 |
931 | @@ -71,13 +71,6 @@ |
932 | KatzeNetTransferCb transfer_cb, |
933 | gpointer user_data); |
934 | |
935 | -#if !WEBKIT_CHECK_VERSION (1, 3, 13) |
936 | -gchar* |
937 | -katze_net_get_cached_path (KatzeNet* net, |
938 | - const gchar* uri, |
939 | - const gchar* subfolder); |
940 | -#endif |
941 | - |
942 | G_END_DECLS |
943 | |
944 | #endif /* __KATZE_NET_H__ */ |
945 | |
946 | === modified file 'katze/midori-paths.vala' |
947 | --- katze/midori-paths.vala 2013-05-22 21:56:59 +0000 |
948 | +++ katze/midori-paths.vala 2013-06-19 20:32:28 +0000 |
949 | @@ -151,18 +151,14 @@ |
950 | #endif |
951 | tmp_dir = get_runtime_dir (); |
952 | } |
953 | -#if HAVE_WEBKIT_1_3_13 |
954 | if (user_data_dir != null) { |
955 | string folder = Path.build_filename (user_data_dir, "webkit", "icondatabase"); |
956 | #if HAVE_WEBKIT2 |
957 | WebKit.WebContext.get_default ().set_favicon_database_directory (folder); |
958 | -#elif HAVE_WEBKIT_1_8_0 |
959 | +#else |
960 | WebKit.get_favicon_database ().set_path (folder); |
961 | -#elif HAVE_WEBKIT_1_3_13 |
962 | - WebKit.get_icon_database ().set_path (folder); |
963 | #endif |
964 | } |
965 | -#endif |
966 | if (strcmp (Environment.get_variable ("MIDORI_DEBUG"), "paths") == 0) { |
967 | stdout.printf ("config: %s\ncache: %s\nuser_data: %s\ntmp: %s\n", |
968 | config_dir, cache_dir, user_data_dir, tmp_dir); |
969 | @@ -420,13 +416,10 @@ |
970 | assert (user_data_dir != null); |
971 | #if HAVE_WEBKIT2 |
972 | WebKit.WebContext.get_default ().get_favicon_database ().clear (); |
973 | -#elif HAVE_WEBKIT_1_8_0 |
974 | +#else |
975 | WebKit.get_favicon_database ().clear (); |
976 | -#elif HAVE_WEBKIT_1_3_13 |
977 | - WebKit.get_icon_database ().clear (); |
978 | #endif |
979 | /* FIXME: Exclude search engine icons */ |
980 | - remove_path (Path.build_filename (cache_dir, "icons")); |
981 | remove_path (Path.build_filename (user_data_dir, "webkit", "icondatabase")); |
982 | } |
983 | |
984 | @@ -441,33 +434,11 @@ |
985 | /* TODO async |
986 | var database = WebKit.WebContext.get_default ().get_favicon_database (); |
987 | database.get_favicon.begin (uri, null); */ |
988 | -#elif HAVE_WEBKIT_1_8_0 |
989 | +#else |
990 | Gdk.Pixbuf? pixbuf = WebKit.get_favicon_database () |
991 | .try_get_favicon_pixbuf (uri, icon_width, icon_height); |
992 | if (pixbuf != null) |
993 | return pixbuf; |
994 | -#elif HAVE_WEBKIT_1_3_13 |
995 | - Gdk.Pixbuf? pixbuf = WebKit.get_icon_database ().get_icon_pixbuf (uri); |
996 | - if (pixbuf != null) |
997 | - return pixbuf.scale_simple (icon_width, icon_height, Gdk.InterpType.BILINEAR); |
998 | -#else |
999 | - if (Midori.URI.is_http (uri)) { |
1000 | - try { |
1001 | - uint i = 8; |
1002 | - while (uri[i] != '\0' && uri[i] != '/') |
1003 | - i++; |
1004 | - string icon_uri = (uri[i] == '/') |
1005 | - ? uri.substring (0, i) + "/favicon.ico" |
1006 | - : uri + "/favicon.ico"; |
1007 | - string checksum = Checksum.compute_for_string (ChecksumType.MD5, icon_uri, -1); |
1008 | - string filename = checksum + Midori.Download.get_extension_for_uri (icon_uri) ?? ""; |
1009 | - string path = Path.build_filename (get_cache_dir_for_reading (), "icons", filename); |
1010 | - Gdk.Pixbuf? pixbuf = new Gdk.Pixbuf.from_file_at_size (path, icon_width, icon_height); |
1011 | - if (pixbuf != null) |
1012 | - return pixbuf; |
1013 | - } |
1014 | - catch (GLib.Error error) { } |
1015 | - } |
1016 | #endif |
1017 | if (widget != null) |
1018 | return widget.render_icon (Gtk.STOCK_FILE, Gtk.IconSize.MENU, null); |
1019 | |
1020 | === modified file 'midori/midori-browser.c' |
1021 | --- midori/midori-browser.c 2013-06-09 20:00:41 +0000 |
1022 | +++ midori/midori-browser.c 2013-06-19 20:32:28 +0000 |
1023 | @@ -2748,17 +2748,6 @@ |
1024 | MidoriBrowser* browser) |
1025 | { |
1026 | GtkWidget* widget = gtk_window_get_focus (GTK_WINDOW (browser)); |
1027 | -#if !WEBKIT_CHECK_VERSION (1, 4, 3) |
1028 | - /* Work around broken clipboard handling for the sake of the user */ |
1029 | - if (WEBKIT_IS_WEB_VIEW (widget)) |
1030 | - { |
1031 | - GtkWidget* scrolled = gtk_widget_get_parent (widget); |
1032 | - GtkWidget* view = gtk_widget_get_parent (scrolled); |
1033 | - const gchar* selected = midori_view_get_selected_text (MIDORI_VIEW (view)); |
1034 | - sokoke_widget_copy_clipboard (widget, selected, NULL, NULL); |
1035 | - return; |
1036 | - } |
1037 | -#endif |
1038 | if (G_LIKELY (widget) && g_signal_lookup ("copy-clipboard", G_OBJECT_TYPE (widget))) |
1039 | g_signal_emit_by_name (widget, "copy-clipboard"); |
1040 | } |
1041 | @@ -3797,14 +3786,8 @@ |
1042 | } |
1043 | |
1044 | #ifndef HAVE_WEBKIT2 |
1045 | -#if WEBKIT_CHECK_VERSION (1, 3, 13) |
1046 | static void |
1047 | -#if WEBKIT_CHECK_VERSION (1, 8, 0) |
1048 | midori_browser_item_icon_loaded_cb (WebKitFaviconDatabase* database, |
1049 | -#elif WEBKIT_CHECK_VERSION (1, 3, 13) |
1050 | -midori_browser_item_icon_loaded_cb (WebKitIconDatabase* database, |
1051 | - WebKitWebFrame* web_frame, |
1052 | -#endif |
1053 | const gchar* frame_uri, |
1054 | KatzeItem* item) |
1055 | { |
1056 | @@ -3812,30 +3795,19 @@ |
1057 | if (strcmp (frame_uri, uri)) |
1058 | return; |
1059 | |
1060 | - #if WEBKIT_CHECK_VERSION (1, 8, 0) |
1061 | gchar* icon_uri = webkit_favicon_database_get_favicon_uri ( |
1062 | webkit_get_favicon_database (), frame_uri); |
1063 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
1064 | - gchar* icon_uri = webkit_icon_database_get_icon_uri ( |
1065 | - webkit_get_icon_database (), frame_uri); |
1066 | - #endif |
1067 | if (icon_uri != NULL) |
1068 | { |
1069 | g_free (icon_uri); |
1070 | katze_item_set_icon (item, frame_uri); |
1071 | /* This signal fires extremely often (WebKit bug?) |
1072 | we must throttle it (disconnect) once we have an icon */ |
1073 | - #if WEBKIT_CHECK_VERSION (1, 8, 0) |
1074 | g_signal_handlers_disconnect_by_func (webkit_get_favicon_database (), |
1075 | midori_browser_item_icon_loaded_cb, item); |
1076 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
1077 | - g_signal_handlers_disconnect_by_func (webkit_get_icon_database (), |
1078 | - midori_browser_item_icon_loaded_cb, item); |
1079 | - #endif |
1080 | } |
1081 | } |
1082 | #endif |
1083 | -#endif |
1084 | |
1085 | static void |
1086 | midori_browser_queue_item_for_icon (KatzeItem* item, |
1087 | @@ -3845,13 +3817,8 @@ |
1088 | if (katze_item_get_icon (item) != NULL) |
1089 | return; |
1090 | g_object_set_data_full (G_OBJECT (item), "browser-queue-icon", g_strdup (uri), g_free); |
1091 | - #if WEBKIT_CHECK_VERSION (1, 8, 0) |
1092 | g_signal_connect (webkit_get_favicon_database (), "icon-loaded", |
1093 | G_CALLBACK (midori_browser_item_icon_loaded_cb), item); |
1094 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
1095 | - g_signal_connect (webkit_get_icon_database (), "icon-loaded", |
1096 | - G_CALLBACK (midori_browser_item_icon_loaded_cb), item); |
1097 | - #endif |
1098 | #endif |
1099 | } |
1100 | |
1101 | |
1102 | === modified file 'midori/midori-frontend.c' |
1103 | --- midori/midori-frontend.c 2013-05-23 22:15:27 +0000 |
1104 | +++ midori/midori-frontend.c 2013-06-19 20:32:28 +0000 |
1105 | @@ -170,9 +170,7 @@ |
1106 | "enable-offline-web-application-cache", FALSE, |
1107 | /* Arguably DNS prefetching is or isn't a privacy concern. For the |
1108 | * lack of more fine-grained control we'll go the safe route. */ |
1109 | - #if WEBKIT_CHECK_VERSION (1, 3, 11) |
1110 | "enable-dns-prefetching", FALSE, |
1111 | - #endif |
1112 | "strip-referer", TRUE, |
1113 | "show-panel", FALSE, |
1114 | "last-window-state", MIDORI_WINDOW_NORMAL, |
1115 | |
1116 | === modified file 'midori/midori-preferences.c' |
1117 | --- midori/midori-preferences.c 2013-04-04 21:34:29 +0000 |
1118 | +++ midori/midori-preferences.c 2013-06-19 20:32:28 +0000 |
1119 | @@ -21,10 +21,8 @@ |
1120 | #include <glib/gi18n.h> |
1121 | #include <libsoup/soup.h> |
1122 | |
1123 | -#if WEBKIT_CHECK_VERSION (1, 3, 11) |
1124 | #define LIBSOUP_USE_UNSTABLE_REQUEST_API |
1125 | #include <libsoup/soup-cache.h> |
1126 | -#endif |
1127 | |
1128 | #include <config.h> |
1129 | #if HAVE_LIBNOTIFY |
1130 | @@ -381,7 +379,6 @@ |
1131 | button = katze_property_proxy (settings, "enable-javascript", NULL); |
1132 | gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts")); |
1133 | INDENTED_ADD (button); |
1134 | - #if WEBKIT_CHECK_VERSION (1, 3, 8) |
1135 | button = katze_property_proxy (settings, "enable-webgl", NULL); |
1136 | gtk_button_set_label (GTK_BUTTON (button), _("Enable WebGL support")); |
1137 | #ifndef HAVE_WEBKIT2 |
1138 | @@ -398,11 +395,6 @@ |
1139 | g_free (supports_web_gl); |
1140 | } |
1141 | #endif |
1142 | - #else |
1143 | - button = katze_property_proxy (settings, "enable-plugins", NULL); |
1144 | - gtk_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins")); |
1145 | - gtk_widget_set_sensitive (button, midori_web_settings_has_plugin_support ()); |
1146 | - #endif |
1147 | SPANNED_ADD (button); |
1148 | button = katze_property_proxy (settings, "zoom-text-and-images", NULL); |
1149 | gtk_button_set_label (GTK_BUTTON (button), _("Zoom Text and Images")); |
1150 | @@ -513,7 +505,6 @@ |
1151 | G_CALLBACK (midori_preferences_notify_proxy_type_cb), label); |
1152 | midori_preferences_notify_proxy_type_cb (settings, NULL, label); |
1153 | #endif |
1154 | - #if WEBKIT_CHECK_VERSION (1, 3, 11) |
1155 | #ifndef HAVE_WEBKIT2 |
1156 | if (soup_session_get_feature (webkit_get_default_session (), SOUP_TYPE_CACHE)) |
1157 | { |
1158 | @@ -528,7 +519,6 @@ |
1159 | SPANNED_ADD (label); |
1160 | } |
1161 | #endif |
1162 | - #endif |
1163 | /* i18n: This refers to an application, not the 'user agent' string */ |
1164 | label = gtk_label_new (_("Identify as")); |
1165 | gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); |
1166 | |
1167 | === modified file 'midori/midori-privatedata.c' |
1168 | --- midori/midori-privatedata.c 2013-05-19 09:33:02 +0000 |
1169 | +++ midori/midori-privatedata.c 2013-06-19 20:32:28 +0000 |
1170 | @@ -22,10 +22,8 @@ |
1171 | #include <gdk/gdkkeysyms.h> |
1172 | #include <sqlite3.h> |
1173 | |
1174 | -#if WEBKIT_CHECK_VERSION (1, 3, 11) |
1175 | #define LIBSOUP_USE_UNSTABLE_REQUEST_API |
1176 | #include <libsoup/soup-cache.h> |
1177 | -#endif |
1178 | |
1179 | static void |
1180 | #ifdef HAVE_GRANITE |
1181 | @@ -273,11 +271,9 @@ |
1182 | webkit_remove_all_web_databases (); |
1183 | |
1184 | /* HTML5 offline application caches */ |
1185 | - #if WEBKIT_CHECK_VERSION (1, 3, 13) |
1186 | /* Changing the size implies clearing the cache */ |
1187 | webkit_application_cache_set_maximum_size ( |
1188 | webkit_application_cache_get_maximum_size () - 1); |
1189 | - #endif |
1190 | #endif |
1191 | } |
1192 | |
1193 | @@ -299,7 +295,6 @@ |
1194 | g_free (filename); |
1195 | } |
1196 | |
1197 | -#if WEBKIT_CHECK_VERSION (1, 3, 11) |
1198 | static void |
1199 | midori_clear_web_cache_cb (void) |
1200 | { |
1201 | @@ -315,7 +310,6 @@ |
1202 | g_free (cache); |
1203 | #endif |
1204 | } |
1205 | -#endif |
1206 | |
1207 | void |
1208 | midori_private_data_register_built_ins () |
1209 | @@ -325,11 +319,9 @@ |
1210 | G_CALLBACK (midori_clear_saved_logins_cb)); |
1211 | midori_private_data_register_item ("web-cookies", _("Cookies and Website data"), |
1212 | G_CALLBACK (midori_clear_web_cookies_cb)); |
1213 | - #if WEBKIT_CHECK_VERSION (1, 3, 11) |
1214 | /* TODO: Preserve page icons of search engines and merge privacy items */ |
1215 | midori_private_data_register_item ("web-cache", _("Web Cache"), |
1216 | G_CALLBACK (midori_clear_web_cache_cb)); |
1217 | - #endif |
1218 | midori_private_data_register_item ("page-icons", _("Website icons"), |
1219 | G_CALLBACK (midori_paths_clear_icons)); |
1220 | } |
1221 | |
1222 | === modified file 'midori/midori-searchaction.c' |
1223 | --- midori/midori-searchaction.c 2013-03-26 07:37:23 +0000 |
1224 | +++ midori/midori-searchaction.c 2013-06-19 20:32:28 +0000 |
1225 | @@ -905,7 +905,6 @@ |
1226 | PangoEllipsizeMode ellipsize) |
1227 | { |
1228 | #ifndef HAVE_WEBKIT2 |
1229 | - #if WEBKIT_CHECK_VERSION (1, 5, 0) |
1230 | WebKitDOMDocument* doc; |
1231 | WebKitDOMHTMLFormElement* active_form; |
1232 | WebKitDOMHTMLCollection* form_nodes; |
1233 | @@ -1020,9 +1019,6 @@ |
1234 | #else |
1235 | return NULL; |
1236 | #endif |
1237 | -#else |
1238 | - return NULL; |
1239 | -#endif |
1240 | } |
1241 | |
1242 | void |
1243 | |
1244 | === modified file 'midori/midori-session.c' |
1245 | --- midori/midori-session.c 2013-05-23 22:15:27 +0000 |
1246 | +++ midori/midori-session.c 2013-06-19 20:32:28 +0000 |
1247 | @@ -18,10 +18,8 @@ |
1248 | |
1249 | #include <glib/gi18n-lib.h> |
1250 | |
1251 | -#if WEBKIT_CHECK_VERSION (1, 3, 11) |
1252 | #define LIBSOUP_USE_UNSTABLE_REQUEST_API |
1253 | #include <libsoup/soup-cache.h> |
1254 | -#endif |
1255 | |
1256 | static void |
1257 | midori_soup_session_set_proxy_uri (SoupSession* session, |
1258 | @@ -209,13 +207,6 @@ |
1259 | g_free (certificate_file); |
1260 | #endif |
1261 | |
1262 | - #if !WEBKIT_CHECK_VERSION (1, 3, 5) |
1263 | - /* See http://stevesouders.com/ua/index.php */ |
1264 | - g_object_set (session, "max-conns", 60, |
1265 | - "max-conns-per-host", 6, |
1266 | - NULL); |
1267 | - #endif |
1268 | - |
1269 | g_object_set_data (G_OBJECT (session), "midori-settings", settings); |
1270 | soup_session_settings_notify_http_proxy_cb (settings, NULL, session); |
1271 | g_signal_connect (settings, "notify::http-proxy", |
1272 | @@ -301,14 +292,12 @@ |
1273 | } |
1274 | } |
1275 | |
1276 | - #if WEBKIT_CHECK_VERSION (1, 3, 11) |
1277 | katze_assign (config_file, g_build_filename (midori_paths_get_cache_dir (), "web", NULL)); |
1278 | feature = SOUP_SESSION_FEATURE (soup_cache_new (config_file, 0)); |
1279 | soup_session_add_feature (session, feature); |
1280 | soup_cache_set_max_size (SOUP_CACHE (feature), |
1281 | katze_object_get_int (settings, "maximum-cache-size") * 1024 * 1024); |
1282 | soup_cache_load (SOUP_CACHE (feature)); |
1283 | - #endif |
1284 | g_free (config_file); |
1285 | #endif |
1286 | return FALSE; |
1287 | |
1288 | === modified file 'midori/midori-view.c' |
1289 | --- midori/midori-view.c 2013-06-19 00:20:33 +0000 |
1290 | +++ midori/midori-view.c 2013-06-19 20:32:28 +0000 |
1291 | @@ -56,12 +56,6 @@ |
1292 | #include <sys/utsname.h> |
1293 | #endif |
1294 | |
1295 | -#if !WEBKIT_CHECK_VERSION (1, 4, 3) |
1296 | -/* This is unstable API, so we need to declare it */ |
1297 | -gchar* |
1298 | -webkit_web_view_get_selected_text (WebKitWebView* web_view); |
1299 | -#endif |
1300 | - |
1301 | static void |
1302 | midori_view_item_meta_data_changed (KatzeItem* item, |
1303 | const gchar* key, |
1304 | @@ -492,129 +486,6 @@ |
1305 | g_object_unref (icon); |
1306 | } |
1307 | |
1308 | -#if !WEBKIT_CHECK_VERSION (1, 3, 13) |
1309 | -static GdkPixbuf* |
1310 | -katze_pixbuf_new_from_buffer (const guchar* buffer, |
1311 | - gsize length, |
1312 | - const gchar* mime_type, |
1313 | - GError** error) |
1314 | -{ |
1315 | - /* Proposed for inclusion in GdkPixbuf |
1316 | - See http://bugzilla.gnome.org/show_bug.cgi?id=74291 */ |
1317 | - GdkPixbufLoader* loader; |
1318 | - GdkPixbuf* pixbuf; |
1319 | - |
1320 | - g_return_val_if_fail (buffer != NULL, NULL); |
1321 | - g_return_val_if_fail (length > 0, NULL); |
1322 | - |
1323 | - if (mime_type) |
1324 | - { |
1325 | - loader = gdk_pixbuf_loader_new_with_mime_type (mime_type, error); |
1326 | - if (!loader) |
1327 | - return NULL; |
1328 | - } |
1329 | - else |
1330 | - loader = gdk_pixbuf_loader_new (); |
1331 | - if (!gdk_pixbuf_loader_write (loader, buffer, length, error)) |
1332 | - { |
1333 | - g_object_unref (loader); |
1334 | - return NULL; |
1335 | - } |
1336 | - if (!gdk_pixbuf_loader_close (loader, error)) |
1337 | - { |
1338 | - g_object_unref (loader); |
1339 | - return NULL; |
1340 | - } |
1341 | - |
1342 | - pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); |
1343 | - g_object_ref (pixbuf); |
1344 | - g_object_unref (loader); |
1345 | - return pixbuf; |
1346 | -} |
1347 | - |
1348 | -static void |
1349 | -katze_net_object_maybe_unref (gpointer object) |
1350 | -{ |
1351 | - if (object) |
1352 | - g_object_unref (object); |
1353 | -} |
1354 | - |
1355 | -static GHashTable* |
1356 | -midori_view_get_memory (void) |
1357 | -{ |
1358 | - static GHashTable* memory = NULL; |
1359 | - if (!memory) |
1360 | - memory = g_hash_table_new_full (g_str_hash, g_str_equal, |
1361 | - g_free, katze_net_object_maybe_unref); |
1362 | - return (memory); |
1363 | -} |
1364 | - |
1365 | -static gboolean |
1366 | -katze_net_icon_status_cb (KatzeNetRequest* request, |
1367 | - MidoriView* view) |
1368 | -{ |
1369 | - switch (request->status) |
1370 | - { |
1371 | - case KATZE_NET_VERIFIED: |
1372 | - if (request->mime_type && strncmp (request->mime_type, "image/", 6)) |
1373 | - { |
1374 | - return FALSE; |
1375 | - } |
1376 | - break; |
1377 | - case KATZE_NET_MOVED: |
1378 | - break; |
1379 | - default: |
1380 | - return FALSE; |
1381 | - } |
1382 | - return TRUE; |
1383 | -} |
1384 | - |
1385 | -static void |
1386 | -katze_net_icon_transfer_cb (KatzeNetRequest* request, |
1387 | - MidoriView* view) |
1388 | -{ |
1389 | - GdkPixbuf* pixbuf; |
1390 | - FILE* fp; |
1391 | - GdkPixbuf* pixbuf_scaled; |
1392 | - gint icon_width, icon_height; |
1393 | - size_t ret; |
1394 | - GtkSettings* settings; |
1395 | - |
1396 | - if (request->status == KATZE_NET_MOVED) |
1397 | - return; |
1398 | - |
1399 | - pixbuf = NULL; |
1400 | - if (request->data) |
1401 | - { |
1402 | - gchar* icon_file = katze_net_get_cached_path (NULL, view->icon_uri, "icons"); |
1403 | - if (icon_file && (fp = fopen (icon_file, "wb"))) |
1404 | - { |
1405 | - ret = fwrite (request->data, 1, request->length, fp); |
1406 | - fclose (fp); |
1407 | - if ((ret - request->length != 0)) |
1408 | - g_warning ("Error writing to file %s in %s", icon_file, G_STRFUNC); |
1409 | - } |
1410 | - g_free (icon_file); |
1411 | - |
1412 | - pixbuf = katze_pixbuf_new_from_buffer ((guchar*)request->data, |
1413 | - request->length, request->mime_type, NULL); |
1414 | - |
1415 | - } |
1416 | - |
1417 | - if (!pixbuf) |
1418 | - { |
1419 | - midori_view_unset_icon (view); |
1420 | - return; |
1421 | - } |
1422 | - |
1423 | - g_hash_table_insert (midori_view_get_memory (), g_strdup (view->icon_uri), pixbuf); |
1424 | - settings = gtk_widget_get_settings (view->web_view); |
1425 | - gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU, &icon_width, &icon_height); |
1426 | - pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf, icon_width, icon_height, GDK_INTERP_BILINEAR); |
1427 | - midori_view_apply_icon (view, pixbuf_scaled, view->icon_uri); |
1428 | -} |
1429 | -#endif |
1430 | - |
1431 | static void |
1432 | _midori_web_view_load_icon (MidoriView* view) |
1433 | { |
1434 | @@ -634,74 +505,10 @@ |
1435 | g_object_unref (pixbuf); |
1436 | midori_view_apply_icon (view, pixbuf_scaled, view->icon_uri); |
1437 | } |
1438 | - #elif WEBKIT_CHECK_VERSION (1, 8, 0) |
1439 | + #else |
1440 | if ((pixbuf = webkit_web_view_try_get_favicon_pixbuf ( |
1441 | WEBKIT_WEB_VIEW (view->web_view), icon_width, icon_height))) |
1442 | midori_view_apply_icon (view, pixbuf, view->icon_uri); |
1443 | - #elif WEBKIT_CHECK_VERSION (1, 3, 13) |
1444 | - if ((pixbuf = webkit_web_view_get_icon_pixbuf ( |
1445 | - WEBKIT_WEB_VIEW (view->web_view)))) |
1446 | - { |
1447 | - GdkPixbuf* pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf, |
1448 | - icon_width, icon_height, GDK_INTERP_BILINEAR); |
1449 | - g_object_unref (pixbuf); |
1450 | - midori_view_apply_icon (view, pixbuf_scaled, view->icon_uri); |
1451 | - } |
1452 | - #else |
1453 | - GdkPixbuf* pixbuf_scaled; |
1454 | - const gchar* uri = midori_tab_get_uri (MIDORI_TAB (view)); |
1455 | - |
1456 | - if (!midori_uri_is_http (view->icon_uri)) |
1457 | - katze_assign (view->icon_uri, NULL); |
1458 | - |
1459 | - if (midori_uri_is_http (uri) || g_str_has_prefix (uri, "file://")) |
1460 | - { |
1461 | - gchar* icon_file = NULL; |
1462 | - if (!view->icon_uri) |
1463 | - { |
1464 | - guint i = 8; |
1465 | - while (uri[i] != '\0' && uri[i] != '/') |
1466 | - i++; |
1467 | - if (uri[i] == '/') |
1468 | - { |
1469 | - gchar* path = g_strndup (uri, i); |
1470 | - view->icon_uri = g_strdup_printf ("%s/favicon.ico", path); |
1471 | - g_free (path); |
1472 | - } |
1473 | - else |
1474 | - view->icon_uri = g_strdup_printf ("%s/favicon.ico", uri); |
1475 | - } |
1476 | - |
1477 | - if (g_hash_table_lookup_extended (midori_view_get_memory (), |
1478 | - view->icon_uri, NULL, (gpointer)&pixbuf)) |
1479 | - { |
1480 | - g_warn_if_fail (pixbuf != NULL); |
1481 | - g_object_ref (pixbuf); |
1482 | - } |
1483 | - else if ((icon_file = katze_net_get_cached_path (NULL, view->icon_uri, "icons")) && |
1484 | - (pixbuf = gdk_pixbuf_new_from_file (icon_file, NULL))) |
1485 | - { |
1486 | - g_hash_table_insert (midori_view_get_memory (), |
1487 | - g_strdup (view->icon_uri), g_object_ref (pixbuf)); |
1488 | - } |
1489 | - else if (!midori_tab_get_special (MIDORI_TAB (view))) |
1490 | - { |
1491 | - katze_net_load_uri (NULL, view->icon_uri, |
1492 | - (KatzeNetStatusCb)katze_net_icon_status_cb, |
1493 | - (KatzeNetTransferCb)katze_net_icon_transfer_cb, view); |
1494 | - } |
1495 | - |
1496 | - g_free (icon_file); |
1497 | - } |
1498 | - |
1499 | - if (pixbuf) |
1500 | - { |
1501 | - pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf, |
1502 | - icon_width, icon_height, GDK_INTERP_BILINEAR); |
1503 | - g_object_unref (pixbuf); |
1504 | - pixbuf = pixbuf_scaled; |
1505 | - midori_view_apply_icon (view, pixbuf, view->icon_uri); |
1506 | - } |
1507 | #endif |
1508 | } |
1509 | |
1510 | @@ -1347,7 +1154,6 @@ |
1511 | } |
1512 | } |
1513 | |
1514 | -#if WEBKIT_CHECK_VERSION (1, 1, 23) |
1515 | static void |
1516 | midori_view_location_response_cb (GtkWidget* infobar, |
1517 | gint response, |
1518 | @@ -1378,7 +1184,6 @@ |
1519 | return TRUE; |
1520 | } |
1521 | #endif |
1522 | -#endif |
1523 | |
1524 | void |
1525 | midori_view_set_html (MidoriView* view, |
1526 | @@ -1549,9 +1354,6 @@ |
1527 | "f.push ('$' + l[i].href + '|' + l[i].title);" |
1528 | "else if (r == 'search' && t == 'application/opensearchdescription+xml') " |
1529 | "f.push (':' + l[i].href + '|' + l[i].title); " |
1530 | - #if !WEBKIT_CHECK_VERSION (1, 1, 18) |
1531 | - "else if (r && r.indexOf ('icon') != -1) f.push (l[i].href); " |
1532 | - #endif |
1533 | "} if (document.location.href.indexOf ('twitter') != -1)" |
1534 | "{ var s = document.location.href.split('/'); " |
1535 | "var u = 'https://api.twitter.com/1/statuses/user_timeline.rss" |
1536 | @@ -1613,10 +1415,6 @@ |
1537 | G_CALLBACK (midori_view_open_search_response_cb), view, |
1538 | _("_Save Search engine"), GTK_RESPONSE_ACCEPT, NULL); */ |
1539 | } |
1540 | - #if !WEBKIT_CHECK_VERSION (1, 1, 18) |
1541 | - else |
1542 | - katze_assign (view->icon_uri, g_strdup (uri_and_title)); |
1543 | - #endif |
1544 | |
1545 | news_feeds_continue: |
1546 | current_item++; |
1547 | @@ -1625,10 +1423,6 @@ |
1548 | |
1549 | g_object_set_data_full (G_OBJECT (view), "news-feeds", default_uri, g_free); |
1550 | g_free (value); |
1551 | - |
1552 | - #if !WEBKIT_CHECK_VERSION (1, 4, 3) |
1553 | - _midori_web_view_load_icon (view); |
1554 | - #endif |
1555 | } |
1556 | #endif |
1557 | |
1558 | @@ -1708,8 +1502,6 @@ |
1559 | } |
1560 | #endif |
1561 | |
1562 | - |
1563 | -#if WEBKIT_CHECK_VERSION (1, 1, 18) |
1564 | static void |
1565 | midori_web_view_notify_icon_uri_cb (WebKitWebView* web_view, |
1566 | GParamSpec* pspec, |
1567 | @@ -1726,7 +1518,6 @@ |
1568 | katze_assign (view->icon_uri, icon_uri); |
1569 | _midori_web_view_load_icon (view); |
1570 | } |
1571 | -#endif |
1572 | |
1573 | static void |
1574 | webkit_web_view_notify_uri_cb (WebKitWebView* web_view, |
1575 | @@ -1783,10 +1574,6 @@ |
1576 | const gchar* link_uri = webkit_hit_test_result_get_link_uri (hit_test_result); |
1577 | #endif |
1578 | |
1579 | - #if !(WEBKIT_CHECK_VERSION (1, 3, 1) && defined (HAVE_LIBSOUP_2_29_91)) |
1580 | - sokoke_prefetch_uri (view->settings, link_uri, NULL, NULL); |
1581 | - #endif |
1582 | - |
1583 | katze_assign (view->link_uri, g_strdup (link_uri)); |
1584 | if (link_uri && g_str_has_prefix (link_uri, "mailto:")) |
1585 | { |
1586 | @@ -2511,7 +2298,6 @@ |
1587 | #endif |
1588 | } |
1589 | |
1590 | -#if WEBKIT_CHECK_VERSION (1, 5, 0) |
1591 | static void |
1592 | midori_view_menu_add_search_engine_cb (GtkWidget* widget, |
1593 | MidoriView* view) |
1594 | @@ -2522,7 +2308,6 @@ |
1595 | KatzeItem* item = g_object_get_data (G_OBJECT (widget), "item"); |
1596 | midori_search_action_get_editor (MIDORI_SEARCH_ACTION (action), item, TRUE); |
1597 | } |
1598 | -#endif |
1599 | |
1600 | static GtkWidget* |
1601 | midori_view_insert_menu_item (GtkMenuShell* menu, |
1602 | @@ -2637,7 +2422,6 @@ |
1603 | webkit_web_view_can_undo (web_view)); |
1604 | gtk_menu_shell_prepend (menu_shell, menuitem); |
1605 | |
1606 | - #if WEBKIT_CHECK_VERSION (1, 5, 0) |
1607 | { |
1608 | KatzeItem* item = midori_search_action_get_engine_for_form ( |
1609 | WEBKIT_WEB_VIEW (view->web_view), view->ellipsize); |
1610 | @@ -2650,7 +2434,6 @@ |
1611 | gtk_widget_show (menuitem); |
1612 | } |
1613 | } |
1614 | - #endif |
1615 | |
1616 | if (manual) |
1617 | { |
1618 | @@ -3923,14 +3706,10 @@ |
1619 | midori_view_web_view_resource_request_cb, view, |
1620 | "signal::database-quota-exceeded", |
1621 | midori_view_web_view_database_quota_exceeded_cb, view, |
1622 | - #if WEBKIT_CHECK_VERSION (1, 1, 23) |
1623 | "signal::geolocation-policy-decision-requested", |
1624 | midori_view_web_view_geolocation_decision_cb, view, |
1625 | - #endif |
1626 | - #if WEBKIT_CHECK_VERSION (1, 1, 18) |
1627 | "signal::notify::icon-uri", |
1628 | midori_web_view_notify_icon_uri_cb, view, |
1629 | - #endif |
1630 | "signal::hovering-over-link", |
1631 | webkit_web_view_hovering_over_link_cb, view, |
1632 | "signal::status-bar-text-changed", |
1633 | @@ -4119,7 +3898,7 @@ |
1634 | webkit_plugin_get_name (plugins->data), |
1635 | html ? webkit_plugin_get_description (plugins->data) : "")); |
1636 | } |
1637 | - #elif WEBKIT_CHECK_VERSION (1, 3, 8) |
1638 | + #else |
1639 | WebKitWebPluginDatabase* pdb = webkit_get_web_plugin_database (); |
1640 | GSList* plugins = webkit_web_plugin_database_get_plugins (pdb); |
1641 | GSList* plugin = plugins; |
1642 | @@ -4132,36 +3911,6 @@ |
1643 | html ? webkit_web_plugin_get_description (plugin->data) : "")); |
1644 | } |
1645 | webkit_web_plugin_database_plugins_list_free (plugins); |
1646 | - #else |
1647 | - if (view == NULL) |
1648 | - return; |
1649 | - |
1650 | - WebKitWebFrame* web_frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view)); |
1651 | - JSContextRef js_context = webkit_web_frame_get_global_context (web_frame); |
1652 | - /* Joins available plugins like this: URI1|title1,URI2|title2 */ |
1653 | - gchar* value = sokoke_js_script_eval (js_context, |
1654 | - "function plugins (l) { var f = new Array (); for (var i in l) " |
1655 | - "{ var p = l[i].name + '|' + l[i].filename; " |
1656 | - "if (f.indexOf (p) == -1) f.push (p); } return f; }" |
1657 | - "plugins (navigator.plugins)", NULL); |
1658 | - gchar** items = g_strsplit (value, ",", 0); |
1659 | - guint i = 0; |
1660 | - if (items != NULL) |
1661 | - while (items[i] != NULL) |
1662 | - { |
1663 | - gchar** parts = g_strsplit (items[i], "|", 2); |
1664 | - if (parts[0] && !g_str_equal (parts[1], "undefined") |
1665 | - && !midori_web_settings_skip_plugin (parts[1])) |
1666 | - midori_view_add_version (ns_plugins, html, g_strdup_printf ("%s\t%s", |
1667 | - parts[1], html ? parts[0] : "")); |
1668 | - g_strfreev (parts); |
1669 | - i++; |
1670 | - } |
1671 | - if (g_str_has_prefix (value, "undefined")) |
1672 | - midori_view_add_version (ns_plugins, html, g_strdup_printf ("%s", |
1673 | - "No plugins found")); |
1674 | - g_strfreev (items); |
1675 | - g_free (value); |
1676 | #endif |
1677 | } |
1678 | |
1679 | @@ -4700,17 +4449,14 @@ |
1680 | midori_view_has_selection (MidoriView* view) |
1681 | { |
1682 | #ifndef HAVE_WEBKIT2 |
1683 | -#if WEBKIT_CHECK_VERSION (1, 4, 3) |
1684 | WebKitDOMDocument* doc; |
1685 | WebKitDOMDOMWindow* window; |
1686 | WebKitDOMDOMSelection* selection; |
1687 | WebKitDOMRange* range; |
1688 | -#endif |
1689 | |
1690 | g_return_val_if_fail (MIDORI_IS_VIEW (view), FALSE); |
1691 | |
1692 | |
1693 | -#if WEBKIT_CHECK_VERSION (1, 4, 3) |
1694 | doc = webkit_web_view_get_dom_document (WEBKIT_WEB_VIEW (view->web_view)); |
1695 | window = webkit_dom_document_get_default_view (doc); |
1696 | selection = webkit_dom_dom_window_get_selection (window); |
1697 | @@ -4723,10 +4469,6 @@ |
1698 | return FALSE; |
1699 | |
1700 | katze_assign (view->selected_text, webkit_dom_range_get_text (range)); |
1701 | -#else |
1702 | - katze_assign (view->selected_text, webkit_web_view_get_selected_text ( |
1703 | - WEBKIT_WEB_VIEW (view->web_view))); |
1704 | -#endif |
1705 | |
1706 | if (view->selected_text && *view->selected_text) |
1707 | return TRUE; |
1708 | |
1709 | === modified file 'midori/midori-websettings.c' |
1710 | --- midori/midori-websettings.c 2013-05-19 09:33:02 +0000 |
1711 | +++ midori/midori-websettings.c 2013-06-19 20:32:28 +0000 |
1712 | @@ -60,9 +60,6 @@ |
1713 | gint clear_private_data; |
1714 | gchar* clear_data; |
1715 | gchar* site_data_rules; |
1716 | - #if !WEBKIT_CHECK_VERSION (1, 3, 13) |
1717 | - gboolean enable_dns_prefetching; |
1718 | - #endif |
1719 | gboolean enforce_font_family; |
1720 | gchar* user_stylesheet_uri; |
1721 | gchar* user_stylesheet_uri_cached; |
1722 | @@ -376,7 +373,6 @@ |
1723 | TRUE, |
1724 | flags)); |
1725 | |
1726 | - #if WEBKIT_CHECK_VERSION (1, 1, 18) |
1727 | g_object_class_install_property (gobject_class, |
1728 | PROP_ENABLE_PAGE_CACHE, |
1729 | g_param_spec_boolean ("enable-page-cache", |
1730 | @@ -384,7 +380,7 @@ |
1731 | "Whether the page cache should be used", |
1732 | !midori_web_settings_low_memory_profile (), |
1733 | flags)); |
1734 | - #endif |
1735 | + |
1736 | if (g_object_class_find_property (gobject_class, "enable-fullscreen")) |
1737 | g_object_class_install_property (gobject_class, |
1738 | PROP_ENABLE_FULLSCREEN, |
1739 | @@ -478,23 +474,6 @@ |
1740 | "Cookies, HTML5 databases, local storage and application cache blocking", |
1741 | NULL, |
1742 | flags)); |
1743 | - #if !WEBKIT_CHECK_VERSION (1, 3, 13) |
1744 | - /** |
1745 | - * MidoriWebSettings:enable-dns-prefetching: |
1746 | - * |
1747 | - * Whether to resolve host names in advance. |
1748 | - * |
1749 | - * Since: 0.3.4 |
1750 | - */ |
1751 | - g_object_class_install_property (gobject_class, |
1752 | - PROP_ENABLE_DNS_PREFETCHING, |
1753 | - g_param_spec_boolean ( |
1754 | - "enable-dns-prefetching", |
1755 | - "Whether to resolve host names in advance", |
1756 | - "Whether host names on a website or in bookmarks should be prefetched", |
1757 | - TRUE, |
1758 | - flags)); |
1759 | - #endif |
1760 | |
1761 | /** |
1762 | * MidoriWebSettings:enforc-font-family: |
1763 | @@ -567,13 +546,7 @@ |
1764 | web_settings->user_stylesheet_uri = web_settings->user_stylesheet_uri_cached = NULL; |
1765 | web_settings->user_stylesheets = NULL; |
1766 | |
1767 | - #if WEBKIT_CHECK_VERSION (1, 2, 6) && !WEBKIT_CHECK_VERSION (1, 2, 8) |
1768 | - /* Shadows are very slow with WebKitGTK+ 1.2.7 */ |
1769 | - midori_web_settings_add_style (web_settings, "box-shadow-workaround", |
1770 | - "* { -webkit-box-shadow: none !important; }"); |
1771 | - #endif |
1772 | - |
1773 | - #if defined (_WIN32) && WEBKIT_CHECK_VERSION (1, 7, 1) && !GTK_CHECK_VERSION (3, 0, 0) |
1774 | + #if defined (_WIN32) && !GTK_CHECK_VERSION (3, 0, 0) |
1775 | /* Try to work-around black borders on native widgets and GTK+2 on Win32 */ |
1776 | midori_web_settings_add_style (web_settings, "black-widgets-workaround", |
1777 | "input[type='checkbox'] { -webkit-appearance: checkbox !important }" |
1778 | @@ -617,11 +590,7 @@ |
1779 | gboolean |
1780 | midori_web_settings_has_plugin_support (void) |
1781 | { |
1782 | - #if !WEBKIT_CHECK_VERSION (1, 8, 2) && defined G_OS_WIN32 |
1783 | - return FALSE; |
1784 | - #else |
1785 | return !midori_debug ("unarmed") && g_strcmp0 (g_getenv ("MOZ_PLUGIN_PATH"), "/"); |
1786 | - #endif |
1787 | } |
1788 | |
1789 | /** |
1790 | @@ -798,10 +767,8 @@ |
1791 | const int webcore_minor = 32; |
1792 | #endif |
1793 | |
1794 | - #if WEBKIT_CHECK_VERSION (1, 1, 18) |
1795 | g_object_set (web_settings, "enable-site-specific-quirks", |
1796 | identify_as != MIDORI_IDENT_GENUINE, NULL); |
1797 | - #endif |
1798 | |
1799 | switch (identify_as) |
1800 | { |
1801 | @@ -1013,17 +980,15 @@ |
1802 | WEB_SETTINGS_STRING ("enable-plugins"), g_value_get_boolean (value), |
1803 | #if HAVE_WEBKIT2 |
1804 | "enable-java", g_value_get_boolean (value), |
1805 | - #elif WEBKIT_CHECK_VERSION (1, 1, 22) |
1806 | + #else |
1807 | "enable-java-applet", g_value_get_boolean (value), |
1808 | #endif |
1809 | NULL); |
1810 | break; |
1811 | - #if WEBKIT_CHECK_VERSION (1, 1, 18) |
1812 | case PROP_ENABLE_PAGE_CACHE: |
1813 | g_object_set (web_settings, WEB_SETTINGS_STRING ("enable-page-cache"), |
1814 | g_value_get_boolean (value), NULL); |
1815 | break; |
1816 | - #endif |
1817 | |
1818 | case PROP_PROXY_TYPE: |
1819 | web_settings->proxy_type = g_value_get_enum (value); |
1820 | @@ -1067,11 +1032,6 @@ |
1821 | case PROP_SITE_DATA_RULES: |
1822 | katze_assign (web_settings->site_data_rules, g_value_dup_string (value)); |
1823 | break; |
1824 | - #if !WEBKIT_CHECK_VERSION (1, 3, 13) |
1825 | - case PROP_ENABLE_DNS_PREFETCHING: |
1826 | - web_settings->enable_dns_prefetching = g_value_get_boolean (value); |
1827 | - break; |
1828 | - #endif |
1829 | case PROP_ENFORCE_FONT_FAMILY: |
1830 | if ((web_settings->enforce_font_family = g_value_get_boolean (value))) |
1831 | { |
1832 | @@ -1189,12 +1149,10 @@ |
1833 | g_value_set_boolean (value, katze_object_get_boolean (web_settings, |
1834 | WEB_SETTINGS_STRING ("enable-plugins"))); |
1835 | break; |
1836 | - #if WEBKIT_CHECK_VERSION (1, 1, 18) |
1837 | case PROP_ENABLE_PAGE_CACHE: |
1838 | g_value_set_boolean (value, katze_object_get_boolean (web_settings, |
1839 | WEB_SETTINGS_STRING ("enable-page-cache"))); |
1840 | break; |
1841 | - #endif |
1842 | |
1843 | case PROP_PROXY_TYPE: |
1844 | g_value_set_enum (value, web_settings->proxy_type); |
1845 | @@ -1219,11 +1177,6 @@ |
1846 | case PROP_SITE_DATA_RULES: |
1847 | g_value_set_string (value, web_settings->site_data_rules); |
1848 | break; |
1849 | - #if !WEBKIT_CHECK_VERSION (1, 3, 13) |
1850 | - case PROP_ENABLE_DNS_PREFETCHING: |
1851 | - g_value_set_boolean (value, web_settings->enable_dns_prefetching); |
1852 | - break; |
1853 | - #endif |
1854 | case PROP_ENFORCE_FONT_FAMILY: |
1855 | g_value_set_boolean (value, web_settings->enforce_font_family); |
1856 | break; |
1857 | |
1858 | === modified file 'wscript' |
1859 | --- wscript 2013-06-03 19:37:36 +0000 |
1860 | +++ wscript 2013-06-19 20:32:28 +0000 |
1861 | @@ -253,22 +253,20 @@ |
1862 | conf.define ('HAVE_WEBKIT2', 1) |
1863 | conf.env.append_value ('VALAFLAGS', '-D HAVE_WEBKIT2') |
1864 | else: |
1865 | - check_pkg ('webkitgtk-3.0', '1.1.17', var='WEBKIT', mandatory=False) |
1866 | + check_pkg ('webkitgtk-3.0', '1.8.3', var='WEBKIT', mandatory=False) |
1867 | if not conf.env['HAVE_GTK'] or not conf.env['HAVE_WEBKIT']: |
1868 | Utils.pprint ('RED', 'GTK+3 was not found.\n' \ |
1869 | 'Pass --disable-gtk3 to build without GTK+3.') |
1870 | sys.exit (1) |
1871 | - if check_version (conf.env['WEBKIT_VERSION'], 1, 5, 1): |
1872 | - check_pkg ('javascriptcoregtk-3.0', '1.5.1', args=args) |
1873 | + check_pkg ('javascriptcoregtk-3.0', '1.8.3', args=args) |
1874 | conf.env.append_value ('VALAFLAGS', '-D HAVE_GTK3') |
1875 | conf.env.append_value ('VALAFLAGS', '-D HAVE_OFFSCREEN') |
1876 | conf.env.append_value ('VALAFLAGS', '-D HAVE_DOM') |
1877 | else: |
1878 | check_pkg ('gtk+-2.0', '2.16.0', var='GTK') |
1879 | - check_pkg ('webkit-1.0', '1.1.17', args=args) |
1880 | + check_pkg ('webkit-1.0', '1.8.3', args=args) |
1881 | conf.define ('GCR_VERSION', 'No') |
1882 | - if check_version (conf.env['WEBKIT_VERSION'], 1, 5, 1): |
1883 | - check_pkg ('javascriptcoregtk-1.0', '1.5.1', args=args) |
1884 | + check_pkg ('javascriptcoregtk-1.0', '1.8.3', args=args) |
1885 | if check_version (conf.env['GTK_VERSION'], 2, 20, 0): |
1886 | conf.env.append_value ('VALAFLAGS', '-D HAVE_OFFSCREEN') |
1887 | conf.env['HAVE_GTK3'] = have_gtk3 |
Seems to work fine