Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Epiphany
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
126
Issues
126
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
Epiphany
Commits
3df6f8c4
Commit
3df6f8c4
authored
Dec 08, 2013
by
Carlos Garcia Campos
Committed by
Carlos Garcia Campos
Dec 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove all WebKit1 code
We are using WebKit2 unconditionally already.
parent
7213d38a
Changes
36
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
33 additions
and
2300 deletions
+33
-2300
configure.ac
configure.ac
+0
-2
embed/ephy-embed-prefs.c
embed/ephy-embed-prefs.c
+0
-4
embed/ephy-web-view.c
embed/ephy-web-view.c
+0
-8
lib/ephy-smaps.c
lib/ephy-smaps.c
+0
-9
lib/ephy-snapshot-service.c
lib/ephy-snapshot-service.c
+0
-65
lib/ephy-snapshot-service.h
lib/ephy-snapshot-service.h
+0
-4
lib/ephy-web-app-utils.c
lib/ephy-web-app-utils.c
+0
-18
lib/ephy-web-app-utils.h
lib/ephy-web-app-utils.h
+0
-5
lib/widgets/ephy-download-widget.c
lib/widgets/ephy-download-widget.c
+0
-99
lib/widgets/ephy-hosts-store.c
lib/widgets/ephy-hosts-store.c
+11
-68
lib/widgets/ephy-location-entry.c
lib/widgets/ephy-location-entry.c
+0
-11
lib/widgets/ephy-overview-store.h
lib/widgets/ephy-overview-store.h
+0
-4
src/Makefile.am
src/Makefile.am
+0
-4
src/bookmarks/ephy-bookmark-action.c
src/bookmarks/ephy-bookmark-action.c
+2
-66
src/bookmarks/ephy-bookmarks-editor.c
src/bookmarks/ephy-bookmarks-editor.c
+0
-75
src/bookmarks/ephy-bookmarks.c
src/bookmarks/ephy-bookmarks.c
+0
-24
src/ephy-completion-model.c
src/ephy-completion-model.c
+1
-28
src/ephy-encoding-dialog.c
src/ephy-encoding-dialog.c
+2
-33
src/ephy-encoding-menu.c
src/ephy-encoding-menu.c
+1
-22
src/ephy-find-toolbar.c
src/ephy-find-toolbar.c
+2
-214
src/ephy-history-window.c
src/ephy-history-window.c
+0
-6
src/ephy-navigation-history-action.c
src/ephy-navigation-history-action.c
+5
-166
src/ephy-notebook.c
src/ephy-notebook.c
+0
-8
src/ephy-session.c
src/ephy-session.c
+1
-55
src/ephy-shell.c
src/ephy-shell.c
+0
-31
src/ephy-shell.h
src/ephy-shell.h
+0
-8
src/ephy-window.c
src/ephy-window.c
+0
-527
src/pdm-dialog.c
src/pdm-dialog.c
+0
-199
src/popup-commands.c
src/popup-commands.c
+0
-114
src/popup-commands.h
src/popup-commands.h
+0
-6
src/resources/epiphany-ui.xml
src/resources/epiphany-ui.xml
+0
-11
src/window-commands.c
src/window-commands.c
+6
-183
tests/ephy-session-test.c
tests/ephy-session-test.c
+0
-97
tests/ephy-shell-test.c
tests/ephy-shell-test.c
+0
-38
tests/ephy-test-utils.c
tests/ephy-test-utils.c
+0
-12
tests/ephy-web-view-test.c
tests/ephy-web-view-test.c
+2
-76
No files found.
configure.ac
View file @
3df6f8c4
...
...
@@ -79,8 +79,6 @@ GCR_REQUIRED=3.5.5
AVAHI_REQUIRED=0.6.22
WEBKIT_GTK_PC_NAME=webkit2gtk-3.0
AC_DEFINE([HAVE_WEBKIT2],[1],[Define if building with WebKit2])
AM_CONDITIONAL(WITH_WEBKIT2, [test "yes" = "yes"])
# Tests
...
...
embed/ephy-embed-prefs.c
View file @
3df6f8c4
...
...
@@ -199,10 +199,6 @@ webkit_pref_callback_user_agent (GSettings *settings,
"Epiphany"
,
VERSION
);
}
/* This doesn't contain WebKit2 specific API, but it's only used inside
* HAVE_WEBKIT2 blocks, so it gives a compile warning when building
* with WebKit1.
*/
static
gdouble
get_screen_dpi
(
GdkScreen
*
screen
)
{
...
...
embed/ephy-web-view.c
View file @
3df6f8c4
...
...
@@ -2549,7 +2549,6 @@ ephy_web_view_set_typed_address (EphyWebView *view,
g_object_notify
(
G_OBJECT
(
view
),
"typed-address"
);
}
#ifdef HAVE_WEBKIT2
static
void
has_modified_forms_cb
(
GDBusProxy
*
web_extension
,
GAsyncResult
*
result
,
...
...
@@ -2567,7 +2566,6 @@ has_modified_forms_cb (GDBusProxy *web_extension,
g_task_return_boolean
(
task
,
retval
);
g_object_unref
(
task
);
}
#endif
/**
* ephy_web_view_has_modified_forms:
...
...
@@ -2590,7 +2588,6 @@ ephy_web_view_has_modified_forms (EphyWebView *view,
gpointer
user_data
)
{
GTask
*
task
=
g_task_new
(
view
,
cancellable
,
callback
,
user_data
);
#ifdef HAVE_WEBKIT2
GDBusProxy
*
web_extension
;
web_extension
=
ephy_embed_shell_get_web_extension_proxy
(
ephy_embed_shell_get_default
());
...
...
@@ -2606,11 +2603,6 @@ ephy_web_view_has_modified_forms (EphyWebView *view,
}
else
{
g_task_return_boolean
(
task
,
FALSE
);
}
#else
WebKitDOMDocument
*
document
=
webkit_web_view_get_dom_document
(
WEBKIT_WEB_VIEW
(
view
));
g_task_return_boolean
(
task
,
ephy_web_dom_utils_has_modified_forms
(
document
));
#endif
g_object_unref
(
task
);
}
...
...
lib/ephy-smaps.c
View file @
3df6f8c4
...
...
@@ -66,7 +66,6 @@ typedef enum {
EPHY_PROCESS_OTHER
}
EphyProcess
;
#ifdef HAVE_WEBKIT2
static
const
char
*
get_ephy_process_name
(
EphyProcess
process
)
{
switch
(
process
)
{
...
...
@@ -82,7 +81,6 @@ static const char *get_ephy_process_name (EphyProcess process)
return
NULL
;
}
#endif
static
void
vma_free
(
VMA_t
*
vma
)
{
...
...
@@ -306,9 +304,7 @@ static void ephy_smaps_pid_to_html (EphySMaps *smaps, GString *str, pid_t pid, E
g_slist_free
(
vma_entries
);
#ifdef HAVE_WEBKIT2
g_string_append_printf
(
str
,
"<h2>%s</h2>"
,
get_ephy_process_name
(
process
));
#endif
/* Anon table. */
print_vma_table
(
str
,
anon_hash
,
"Anonymous memory"
);
...
...
@@ -321,7 +317,6 @@ static void ephy_smaps_pid_to_html (EphySMaps *smaps, GString *str, pid_t pid, E
g_hash_table_unref
(
mapped_hash
);
}
#ifdef HAVE_WEBKIT2
static
pid_t
get_pid_from_proc_name
(
const
char
*
name
)
{
guint
i
;
...
...
@@ -442,7 +437,6 @@ static void ephy_smaps_pid_children_to_html (EphySMaps *smaps, GString *str, pid
}
g_dir_close
(
proc
);
}
#endif
char
*
ephy_smaps_to_html
(
EphySMaps
*
smaps
)
{
...
...
@@ -452,10 +446,7 @@ char* ephy_smaps_to_html (EphySMaps *smaps)
g_string_append
(
str
,
"<body>"
);
ephy_smaps_pid_to_html
(
smaps
,
str
,
pid
,
EPHY_PROCESS_EPIPHANY
);
#ifdef HAVE_WEBKIT2
ephy_smaps_pid_children_to_html
(
smaps
,
str
,
pid
);
#endif
g_string_append
(
str
,
"</body>"
);
...
...
lib/ephy-snapshot-service.c
View file @
3df6f8c4
...
...
@@ -27,11 +27,7 @@
#define GNOME_DESKTOP_USE_UNSTABLE_API
#endif
#include <libgnome-desktop/gnome-desktop-thumbnail.h>
#ifdef HAVE_WEBKIT2
#include <webkit2/webkit2.h>
#else
#include <webkit/webkit.h>
#endif
#define EPHY_SNAPSHOT_SERVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EPHY_TYPE_SNAPSHOT_SERVICE, EphySnapshotServicePrivate))
...
...
@@ -182,7 +178,6 @@ save_snapshot (cairo_surface_t *surface,
(
GAsyncReadyCallback
)
snapshot_saved
,
result
);
}
#ifdef HAVE_WEBKIT2
static
void
on_snapshot_ready
(
WebKitWebView
*
webview
,
GAsyncResult
*
result
,
...
...
@@ -202,46 +197,22 @@ on_snapshot_ready (WebKitWebView *webview,
save_snapshot
(
surface
,
simple
);
cairo_surface_destroy
(
surface
);
}
#endif
static
gboolean
retrieve_snapshot_from_web_view
(
GSimpleAsyncResult
*
result
)
{
#ifndef HAVE_WEBKIT2
cairo_surface_t
*
surface
;
#endif
SnapshotAsyncData
*
data
;
data
=
(
SnapshotAsyncData
*
)
g_simple_async_result_get_op_res_gpointer
(
result
);
#ifdef HAVE_WEBKIT2
webkit_web_view_get_snapshot
(
data
->
web_view
,
WEBKIT_SNAPSHOT_REGION_VISIBLE
,
WEBKIT_SNAPSHOT_OPTIONS_NONE
,
NULL
,
(
GAsyncReadyCallback
)
on_snapshot_ready
,
result
);
#else
surface
=
webkit_web_view_get_snapshot
(
data
->
web_view
);
if
(
surface
==
NULL
)
{
g_simple_async_result_set_error
(
result
,
EPHY_SNAPSHOT_SERVICE_ERROR
,
EPHY_SNAPSHOT_SERVICE_ERROR_WEB_VIEW
,
"%s"
,
"Error getting snapshot from web view"
);
g_simple_async_result_complete
(
result
);
g_object_unref
(
result
);
return
FALSE
;
}
save_snapshot
(
surface
,
result
);
cairo_surface_destroy
(
surface
);
#endif
return
FALSE
;
}
#ifdef HAVE_WEBKIT2
static
void
webview_load_changed_cb
(
WebKitWebView
*
webview
,
WebKitLoadEvent
load_event
,
...
...
@@ -277,33 +248,6 @@ webview_load_failed_cb (WebKitWebView *webview,
return
FALSE
;
}
#else
static
void
webview_load_status_changed_cb
(
WebKitWebView
*
webview
,
GParamSpec
*
pspec
,
GSimpleAsyncResult
*
result
)
{
switch
(
webkit_web_view_get_load_status
(
webview
))
{
case
WEBKIT_LOAD_FINISHED
:
/* Load finished doesn't ensure that we actually have visible
content yet, so hold a bit before retrieving the snapshot. */
g_idle_add
((
GSourceFunc
)
retrieve_snapshot_from_web_view
,
result
);
g_signal_handlers_disconnect_by_func
(
webview
,
webview_load_status_changed_cb
,
result
);
break
;
case
WEBKIT_LOAD_FAILED
:
g_signal_handlers_disconnect_by_func
(
webview
,
webview_load_status_changed_cb
,
result
);
g_simple_async_result_set_error
(
result
,
EPHY_SNAPSHOT_SERVICE_ERROR
,
EPHY_SNAPSHOT_SERVICE_ERROR_WEB_VIEW
,
"%s"
,
"Error getting snapshot, web view failed to load"
);
g_simple_async_result_complete_in_idle
(
result
);
g_object_unref
(
result
);
break
;
default:
break
;
}
}
#endif
static
gboolean
ephy_snapshot_service_take_from_webview
(
GSimpleAsyncResult
*
result
)
...
...
@@ -312,7 +256,6 @@ ephy_snapshot_service_take_from_webview (GSimpleAsyncResult *result)
data
=
(
SnapshotAsyncData
*
)
g_simple_async_result_get_op_res_gpointer
(
result
);
#ifdef HAVE_WEBKIT2
if
(
webkit_web_view_get_estimated_load_progress
(
WEBKIT_WEB_VIEW
(
data
->
web_view
))
==
1
.
0
)
retrieve_snapshot_from_web_view
(
result
);
else
{
...
...
@@ -321,14 +264,6 @@ ephy_snapshot_service_take_from_webview (GSimpleAsyncResult *result)
g_signal_connect
(
data
->
web_view
,
"load-failed"
,
G_CALLBACK
(
webview_load_failed_cb
),
result
);
}
#else
if
(
webkit_web_view_get_load_status
(
data
->
web_view
)
==
WEBKIT_LOAD_FINISHED
)
retrieve_snapshot_from_web_view
(
result
);
else
g_signal_connect
(
data
->
web_view
,
"notify::load-status"
,
G_CALLBACK
(
webview_load_status_changed_cb
),
result
);
#endif
return
FALSE
;
}
...
...
lib/ephy-snapshot-service.h
View file @
3df6f8c4
...
...
@@ -22,11 +22,7 @@
#define _EPHY_SNAPSHOT_SERVICE_H
#include <gtk/gtk.h>
#ifdef HAVE_WEBKIT2
#include <webkit2/webkit2.h>
#else
#include <webkit/webkit.h>
#endif
#include <glib-object.h>
...
...
lib/ephy-web-app-utils.c
View file @
3df6f8c4
...
...
@@ -27,11 +27,7 @@
#include <glib/gstdio.h>
#include <libsoup/soup.h>
#ifdef HAVE_WEBKIT2
#include <webkit2/webkit2.h>
#else
#include <webkit/webkit.h>
#endif
#define EPHY_WEB_APP_DESKTOP_FILE_PREFIX "epiphany-"
...
...
@@ -257,7 +253,6 @@ out:
return
desktop_file_path
;
}
#ifdef HAVE_WEBKIT2
static
SoupCookieJar
*
get_current_cookie_jar
(
void
)
{
char
*
filename
;
...
...
@@ -273,19 +268,6 @@ static SoupCookieJar *get_current_cookie_jar (void)
return
jar
;
}
#else
static
SoupCookieJar
*
get_current_cookie_jar
(
void
)
{
SoupSession
*
session
=
webkit_get_default_session
();
SoupCookieJar
*
jar
;
jar
=
(
SoupCookieJar
*
)
soup_session_get_feature
(
session
,
SOUP_TYPE_COOKIE_JAR
);
/* WebKit might not have a cookie jar yet, if it has not needed one
* and none has been set by Epiphany. */
return
jar
?
g_object_ref
(
jar
)
:
NULL
;
}
#endif
static
void
create_cookie_jar_for_domain
(
const
char
*
address
,
const
char
*
directory
)
...
...
lib/ephy-web-app-utils.h
View file @
3df6f8c4
...
...
@@ -26,12 +26,7 @@
#include <glib.h>
#include <gtk/gtk.h>
#ifdef HAVE_WEBKIT2
#include <webkit2/webkit2.h>
#else
#include <webkit/webkit.h>
#endif
G_BEGIN_DECLS
...
...
lib/widgets/ephy-download-widget.c
View file @
3df6f8c4
...
...
@@ -31,11 +31,7 @@
#include "totem-glow-button.h"
#include <glib/gi18n.h>
#ifdef HAVE_WEBKIT2
#include <webkit2/webkit2.h>
#else
#include <webkit/webkit.h>
#endif
G_DEFINE_TYPE
(
EphyDownloadWidget
,
ephy_download_widget
,
GTK_TYPE_BOX
)
...
...
@@ -88,11 +84,7 @@ get_destination_basename_from_download (EphyDownload *ephy_download)
char
*
unescaped
;
download
=
ephy_download_get_webkit_download
(
ephy_download
);
#ifdef HAVE_WEBKIT2
dest
=
webkit_download_get_destination
(
download
);
#else
dest
=
webkit_download_get_destination_uri
(
download
);
#endif
if
(
!
dest
)
return
NULL
;
...
...
@@ -134,17 +126,11 @@ get_remaining_time (WebKitDownload *download)
gdouble
elapsed_time
;
gdouble
remaining_time
;
gdouble
per_byte_time
;
#ifdef HAVE_WEBKIT2
WebKitURIResponse
*
response
;
response
=
webkit_download_get_response
(
download
);
total
=
webkit_uri_response_get_content_length
(
response
);
cur
=
webkit_download_get_received_data_length
(
download
);
#else
total
=
webkit_download_get_total_size
(
download
);
cur
=
webkit_download_get_current_size
(
download
);
#endif
elapsed_time
=
webkit_download_get_elapsed_time
(
download
);
if
(
cur
<=
0
)
...
...
@@ -193,11 +179,7 @@ update_download_label_and_tooltip (EphyDownloadWidget *widget,
char
*
destination
;
download
=
ephy_download_get_webkit_download
(
widget
->
priv
->
download
);
#ifdef HAVE_WEBKIT2
destination
=
g_filename_display_basename
(
webkit_download_get_destination
(
download
));
#else
destination
=
g_filename_display_basename
(
webkit_download_get_destination_uri
(
download
));
#endif
remaining_tooltip
=
g_markup_printf_escaped
(
"%s
\n
%s"
,
destination
,
download_label
);
g_free
(
destination
);
...
...
@@ -210,19 +192,10 @@ update_download_label_and_tooltip (EphyDownloadWidget *widget,
static
gboolean
download_content_length_is_known
(
WebKitDownload
*
download
)
{
#ifdef HAVE_WEBKIT2
WebKitURIResponse
*
response
;
response
=
webkit_download_get_response
(
download
);
return
webkit_uri_response_get_content_length
(
response
);
#else
WebKitNetworkResponse
*
response
;
SoupMessage
*
message
;
response
=
webkit_download_get_network_response
(
download
);
message
=
webkit_network_response_get_message
(
response
);
return
soup_message_headers_get_content_length
(
message
->
response_headers
)
>
0
;
#endif
}
static
void
...
...
@@ -233,14 +206,10 @@ widget_progress_cb (WebKitDownload *download,
int
progress
;
char
*
download_label
=
NULL
;
#ifdef HAVE_WEBKIT2
if
(
!
webkit_download_get_destination
(
download
))
return
;
progress
=
webkit_download_get_estimated_progress
(
download
)
*
100
;
#else
progress
=
webkit_download_get_progress
(
download
)
*
100
;
#endif
if
(
progress
%
10
==
0
)
update_download_icon
(
widget
);
...
...
@@ -260,11 +229,7 @@ widget_progress_cb (WebKitDownload *download,
gint64
current_size
;
/* Unknown content length, show received bytes instead. */
#ifdef HAVE_WEBKIT2
current_size
=
webkit_download_get_received_data_length
(
download
);
#else
current_size
=
webkit_download_get_current_size
(
download
);
#endif
if
(
current_size
>
0
)
download_label
=
g_format_size
(
current_size
);
}
...
...
@@ -275,7 +240,6 @@ widget_progress_cb (WebKitDownload *download,
}
}
#ifdef HAVE_WEBKIT2
static
void
widget_destination_changed_cb
(
WebKitDownload
*
download
,
GParamSpec
*
pspec
,
...
...
@@ -296,26 +260,7 @@ widget_finished_cb (WebKitDownload *download,
update_download_label_and_tooltip
(
widget
,
_
(
"Finished"
));
totem_glow_button_set_glow
(
TOTEM_GLOW_BUTTON
(
widget
->
priv
->
button
),
TRUE
);
}
#else
static
void
widget_status_cb
(
WebKitDownload
*
download
,
GParamSpec
*
pspec
,
EphyDownloadWidget
*
widget
)
{
WebKitDownloadStatus
status
;
status
=
webkit_download_get_status
(
download
);
if
(
status
!=
WEBKIT_DOWNLOAD_STATUS_FINISHED
)
return
;
widget
->
priv
->
finished
=
TRUE
;
update_download_label_and_tooltip
(
widget
,
_
(
"Finished"
));
totem_glow_button_set_glow
(
TOTEM_GLOW_BUTTON
(
widget
->
priv
->
button
),
TRUE
);
}
#endif
#ifdef HAVE_WEBKIT2
static
void
widget_failed_cb
(
WebKitDownload
*
download
,
GError
*
error
,
...
...
@@ -330,31 +275,6 @@ widget_failed_cb (WebKitDownload *download,
gtk_widget_set_tooltip_text
(
GTK_WIDGET
(
widget
),
error_msg
);
g_free
(
error_msg
);
}
#else
static
gboolean
widget_error_cb
(
WebKitDownload
*
download
,
gint
error_code
,
gint
error_detail
,
char
*
reason
,
EphyDownloadWidget
*
widget
)
{
char
*
error_msg
;
g_signal_handlers_disconnect_by_func
(
download
,
widget_status_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_progress_cb
,
widget
);
error_msg
=
g_strdup_printf
(
_
(
"Error downloading: %s"
),
reason
);
gtk_label_set_text
(
GTK_LABEL
(
widget
->
priv
->
remaining
),
error_msg
);
gtk_widget_set_tooltip_text
(
GTK_WIDGET
(
widget
),
error_msg
);
g_free
(
error_msg
);
totem_glow_button_set_glow
(
TOTEM_GLOW_BUTTON
(
widget
->
priv
->
button
),
TRUE
);
return
FALSE
;
}
#endif
static
void
open_activate_cb
(
GtkMenuItem
*
item
,
EphyDownloadWidget
*
widget
)
...
...
@@ -391,11 +311,7 @@ download_menu_clicked_cb (GtkWidget *button,
download
=
ephy_download_get_webkit_download
(
widget
->
priv
->
download
);
#ifdef HAVE_WEBKIT2
basename
=
g_filename_display_basename
(
webkit_download_get_destination
(
download
));
#else
basename
=
g_filename_display_basename
(
webkit_download_get_destination_uri
(
download
));
#endif
name
=
g_uri_unescape_string
(
basename
,
NULL
);
box
=
gtk_widget_get_parent
(
button
);
...
...
@@ -491,16 +407,10 @@ ephy_download_widget_dispose (GObject *object)
if
(
widget
->
priv
->
download
!=
NULL
)
{
download
=
ephy_download_get_webkit_download
(
widget
->
priv
->
download
);
#ifdef HAVE_WEBKIT2
g_signal_handlers_disconnect_by_func
(
download
,
widget_progress_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_destination_changed_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_finished_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_failed_cb
,
widget
);
#else
g_signal_handlers_disconnect_by_func
(
download
,
widget_progress_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_status_cb
,
widget
);
g_signal_handlers_disconnect_by_func
(
download
,
widget_error_cb
,
widget
);
#endif
g_object_unref
(
widget
->
priv
->
download
);
widget
->
priv
->
download
=
NULL
;
...
...
@@ -642,7 +552,6 @@ ephy_download_widget_new (EphyDownload *ephy_download)
widget
->
priv
->
remaining
=
remain
;
widget
->
priv
->
menu
=
menu
;
#ifdef HAVE_WEBKIT2
g_signal_connect
(
download
,
"notify::estimated-progress"
,
G_CALLBACK
(
widget_progress_cb
),
widget
);
g_signal_connect
(
download
,
"notify::destination"
,
...
...
@@ -651,14 +560,6 @@ ephy_download_widget_new (EphyDownload *ephy_download)
G_CALLBACK
(
widget_finished_cb
),
widget
);
g_signal_connect
(
download
,
"failed"
,
G_CALLBACK
(
widget_failed_cb
),
widget
);
#else
g_signal_connect
(
download
,
"notify::progress"
,
G_CALLBACK
(
widget_progress_cb
),
widget
);
g_signal_connect
(
download
,
"notify::status"
,
G_CALLBACK
(
widget_status_cb
),
widget
);
g_signal_connect
(
download
,
"error"
,
G_CALLBACK
(
widget_error_cb
),
widget
);
#endif
gtk_button_set_relief
(
GTK_BUTTON
(
button
),
GTK_RELIEF_HALF
);
gtk_button_set_relief
(
GTK_BUTTON
(
menu
),
GTK_RELIEF_NORMAL
);
...
...
lib/widgets/ephy-hosts-store.c
View file @
3df6f8c4
...
...
@@ -26,9 +26,7 @@
#include "ephy-hosts-store.h"
#include <glib/gi18n.h>
#ifdef HAVE_WEBKIT2
#include <libsoup/soup.h>
#endif
G_DEFINE_TYPE
(
EphyHostsStore
,
ephy_hosts_store
,
GTK_TYPE_LIST_STORE
)
...
...
@@ -45,22 +43,16 @@ async_update_favicon_icon (GObject *source, GAsyncResult *result, gpointer user_
IconLoadData
*
data
=
(
IconLoadData
*
)
user_data
;
WebKitFaviconDatabase
*
database
;
GdkPixbuf
*
favicon
=
NULL
;
#ifdef HAVE_WEBKIT2
cairo_surface_t
*
icon_surface
;
#endif
database
=
WEBKIT_FAVICON_DATABASE
(
source
);
#ifdef HAVE_WEBKIT2
icon_surface
=
webkit_favicon_database_get_favicon_finish
(
database
,
result
,
NULL
);
if
(
icon_surface
)
{
favicon
=
ephy_pixbuf_get_from_surface_scaled
(
icon_surface
,
FAVICON_SIZE
,
FAVICON_SIZE
);
cairo_surface_destroy
(
icon_surface
);
}
#else
favicon
=
webkit_favicon_database_get_favicon_pixbuf_finish
(
database
,
result
,
NULL
);
#endif
if
(
favicon
)
{
/* The completion model might have changed its contents */
...
...
@@ -82,9 +74,7 @@ async_update_favicon_icon (GObject *source, GAsyncResult *result, gpointer user_
static
void
icon_changed_cb
(
WebKitFaviconDatabase
*
database
,
const
char
*
page_uri
,
#ifdef HAVE_WEBKIT2
const
char
*
favicon_uri
,
#endif
GtkTreeModel
*
model
)
{
GtkTreeIter
iter
;
...
...
@@ -108,7 +98,6 @@ icon_changed_cb (WebKitFaviconDatabase *database,
g_free
(
host_address
);
if
(
cmp
==
0
)
{
#ifdef HAVE_WEBKIT2
IconLoadData
*
data
;
GtkTreePath
*
path
;
...
...
@@ -123,19 +112,6 @@ icon_changed_cb (WebKitFaviconDatabase *database,
0
,
async_update_favicon_icon
,
data
);
#else
GdkPixbuf
*
favicon
=
webkit_favicon_database_try_get_favicon_pixbuf
(
database
,
page_uri
,
FAVICON_SIZE
,
FAVICON_SIZE
);
if
(
favicon
)
{
gtk_list_store_set
(
GTK_LIST_STORE
(
model
),
&
iter
,
EPHY_HOSTS_STORE_COLUMN_FAVICON
,
favicon
,
-
1
);
g_object_unref
(
favicon
);
}
#endif
}
valid
=
gtk_tree_model_iter_next
(
model
,
&
iter
);
...
...
@@ -152,11 +128,7 @@ ephy_hosts_store_finalize (GObject *object)
EphyHostsStore
*
store
=
EPHY_HOSTS_STORE
(
object
);
WebKitFaviconDatabase
*
database
;
#ifdef HAVE_WEBKIT2
database
=
webkit_web_context_get_favicon_database
(
webkit_web_context_get_default
());
#else
database
=
webkit_get_favicon_database
();
#endif
g_signal_handlers_disconnect_by_func
(
database
,
icon_changed_cb
,
store
);
...
...
@@ -189,13 +161,8 @@ ephy_hosts_store_init (EphyHostsStore *self)
EPHY_HOSTS_STORE_COLUMN_ADDRESS
,
GTK_SORT_ASCENDING
);
#ifdef HAVE_WEBKIT2
g_signal_connect
(
webkit_web_context_get_favicon_database
(
webkit_web_context_get_default
()),
"favicon-changed"
,
G_CALLBACK
(
icon_changed_cb
),
self
);
#else
g_signal_connect
(
webkit_get_favicon_database
(),
"icon-loaded"
,
G_CALLBACK
(
icon_changed_cb
),
self
);
#endif
}
EphyHostsStore
*
...
...
@@ -213,25 +180,13 @@ ephy_hosts_store_add_hosts (EphyHostsStore *store,
GtkTreeIter
treeiter
;
GtkTreePath
*
path
;
GList
*
iter
;
GdkPixbuf
*
favicon
;
IconLoadData
*
data
;
WebKitFaviconDatabase
*
database
;
#ifdef HAVE_WEBKIT2
database
=
webkit_web_context_get_favicon_database
(
webkit_web_context_get_default
());
#else
database
=
webkit_get_favicon_database
();
#endif
for
(
iter
=
hosts
;
iter
!=
NULL
;
iter
=
iter
->
next
)
{
host
=
(
EphyHistoryHost
*
)
iter
->
data
;
#ifdef HAVE_WEBKIT2
/* Flag favicon to NULL to reuse some code later on */
favicon
=
NULL
;
#else
favicon
=
webkit_favicon_database_try_get_favicon_pixbuf
(
database
,
host
->
url
,
FAVICON_SIZE
,
FAVICON_SIZE
);
#endif
gtk_list_store_insert_with_values
(
GTK_LIST_STORE
(
store
),