aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-encoding-dialog.c10
-rw-r--r--src/ephy-encoding-menu.c12
-rw-r--r--src/ephy-favicon-action.c2
-rw-r--r--src/ephy-nautilus-view.c18
-rw-r--r--src/ephy-navigation-action.c8
-rw-r--r--src/ephy-tab.c31
-rw-r--r--src/ephy-window.c32
-rwxr-xr-xsrc/pdm-dialog.c6
-rw-r--r--src/popup-commands.c6
-rwxr-xr-xsrc/ppview-toolbar.c7
-rw-r--r--src/prefs-dialog.c7
-rw-r--r--src/session.c2
-rw-r--r--src/window-commands.c12
13 files changed, 70 insertions, 83 deletions
diff --git a/src/ephy-encoding-dialog.c b/src/ephy-encoding-dialog.c
index 8f259744e..489ad60f6 100644
--- a/src/ephy-encoding-dialog.c
+++ b/src/ephy-encoding-dialog.c
@@ -127,7 +127,6 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
EphyEmbed *embed;
EphyEncodingInfo *info;
EphyNode *node;
- gresult result;
GtkTreeSelection *selection;
GtkTreeModel *model;
GList *rows;
@@ -139,8 +138,8 @@ sync_embed_cb (EphyEncodingDialog *dialog, GParamSpec *pspec, gpointer dummy)
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
g_return_if_fail (EPHY_IS_EMBED (embed));
- result = ephy_embed_get_encoding_info (embed, &info);
- if (result != G_OK || info == NULL) return;
+ info = ephy_embed_get_encoding_info (embed);
+ if (info == NULL) return;
node = ephy_encodings_get_node (dialog->priv->encodings, info->encoding);
g_return_if_fail (EPHY_IS_NODE (node));
@@ -205,13 +204,12 @@ activate_choice (EphyEncodingDialog *dialog)
EphyEncodingInfo *info;
GtkWidget *button;
gboolean is_automatic;
- gresult result;
embed = ephy_embed_dialog_get_embed (EPHY_EMBED_DIALOG (dialog));
g_return_if_fail (EPHY_IS_EMBED (embed));
- result = ephy_embed_get_encoding_info (embed, &info);
- if (result != G_OK || info == NULL) return;
+ info = ephy_embed_get_encoding_info (embed);
+ if (info == NULL) return;
button = ephy_dialog_get_control (EPHY_DIALOG (dialog), AUTOMATIC_PROP);
is_automatic = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
diff --git a/src/ephy-encoding-menu.c b/src/ephy-encoding-menu.c
index 312ba5a2f..1dd2b3a1a 100644
--- a/src/ephy-encoding-menu.c
+++ b/src/ephy-encoding-menu.c
@@ -150,14 +150,13 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu)
EphyEncodingMenuPrivate *p = menu->priv;
EphyEmbed *embed;
GtkAction *action;
- EphyEncodingInfo *info = NULL;
+ EphyEncodingInfo *info;
char name[128];
const char *encoding;
EphyNode *enc_node;
GList *recent, *related = NULL, *l;
EphyLanguageGroup groups;
gboolean is_automatic;
- gresult result;
START_PROFILER ("Rebuilding encoding menu")
@@ -171,8 +170,8 @@ update_encoding_menu_cb (GtkAction *dummy, EphyEncodingMenu *menu)
recent = ephy_encodings_get_recent (p->encodings);
embed = ephy_window_get_active_embed (p->window);
- result = ephy_embed_get_encoding_info (embed, &info);
- if (result != G_OK || info == NULL) goto build_menu;
+ info = ephy_embed_get_encoding_info (embed);
+ if (info == NULL) goto build_menu;
LOG ("encoding information\n enc='%s' default='%s' hint='%s' "
"prev_doc='%s' forced='%s' parent='%s' source=%d "
@@ -291,7 +290,6 @@ encoding_activate_cb (GtkAction *action, EphyEncodingMenu *menu)
EphyEmbed *embed;
EphyEncodingInfo *info;
const char *name, *encoding;
- gresult result;
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) == FALSE
|| menu->priv->update_tag)
@@ -304,8 +302,8 @@ encoding_activate_cb (GtkAction *action, EphyEncodingMenu *menu)
embed = ephy_window_get_active_embed (menu->priv->window);
- result = ephy_embed_get_encoding_info (embed, &info);
- if (result != G_OK || info == NULL) return;
+ info = ephy_embed_get_encoding_info (embed);
+ if (info == NULL) return;
/* Force only when different from current encoding */
if (info->encoding && strcmp (info->encoding, encoding) != 0)
diff --git a/src/ephy-favicon-action.c b/src/ephy-favicon-action.c
index e3c39ac0c..9285ceea4 100644
--- a/src/ephy-favicon-action.c
+++ b/src/ephy-favicon-action.c
@@ -100,7 +100,7 @@ each_url_get_data_binder (EphyDragEachSelectedItemDataGet iteratee,
tab = ephy_window_get_active_tab (window);
embed = ephy_tab_get_embed (tab);
- ephy_embed_get_location (embed, TRUE, &location);
+ location = ephy_embed_get_location (embed, TRUE);
title = ephy_tab_get_title (tab);
iteratee (location, title, data);
diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c
index 421073cee..b79e0d7fc 100644
--- a/src/ephy-nautilus-view.c
+++ b/src/ephy-nautilus-view.c
@@ -298,8 +298,8 @@ gnv_embed_dom_mouse_click_cb (EphyEmbed *embed,
EphyEmbedEventType type;
EmbedEventContext context;
- ephy_embed_event_get_event_type (event, &type);
- ephy_embed_event_get_context (event, &context);
+ type = ephy_embed_event_get_event_type (event);
+ context = ephy_embed_event_get_context (event);
if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2
&& (context & EMBED_CONTEXT_LINK))
@@ -325,9 +325,7 @@ gnv_embed_context_menu_cb (EphyEmbed *embed,
EphyNautilusView *view)
{
EphyNautilusViewPrivate *p = view->priv;
- EmbedEventContext context;
- ephy_embed_event_get_context (event, &context);
ephy_embed_popup_control_set_event (p->popup, event);
ephy_embed_popup_control_show (p->popup, embed);
}
@@ -382,7 +380,7 @@ gnv_embed_title_cb (EphyEmbed *embed, EphyNautilusView *view)
g_return_if_fail (view->priv->embed == embed);
g_free (p->title);
- ephy_embed_get_title (embed, &p->title);
+ p->title = ephy_embed_get_title (embed);
nautilus_view_set_title (NAUTILUS_VIEW (view), p->title);
}
@@ -501,7 +499,7 @@ gnv_popup_cmd_frame_in_new_window (BonoboUIComponent *uic,
info = ephy_embed_popup_control_get_event (popup);
- ephy_embed_get_location (view->priv->embed, FALSE, &location);
+ location = ephy_embed_get_location (view->priv->embed, FALSE);
nautilus_view_open_location (NAUTILUS_VIEW (view),
location,
@@ -572,12 +570,10 @@ gnv_zoomable_zoom_in_cb (BonoboZoomable *zoomable,
EphyNautilusView *view)
{
float zoom, new_zoom;
- gresult rv;
g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
- rv = ephy_embed_zoom_get (view->priv->embed, &zoom);
- if (rv == G_FAILED) return;
+ zoom = ephy_embed_zoom_get (view->priv->embed);
new_zoom = ephy_zoom_get_changed_zoom_level (zoom, 1);
ephy_embed_zoom_set (view->priv->embed, new_zoom, TRUE);
@@ -588,12 +584,10 @@ gnv_zoomable_zoom_out_cb (BonoboZoomable *zoomable,
EphyNautilusView *view)
{
float zoom, new_zoom;
- gresult rv;
g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
- rv = ephy_embed_zoom_get (view->priv->embed, &zoom);
- if (rv == G_FAILED) return;
+ zoom = ephy_embed_zoom_get (view->priv->embed);
new_zoom = ephy_zoom_get_changed_zoom_level (zoom, -1);
ephy_embed_zoom_set (view->priv->embed, new_zoom, TRUE);
diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
index 769cd9e19..ef5c393f7 100644
--- a/src/ephy-navigation-action.c
+++ b/src/ephy-navigation-action.c
@@ -121,7 +121,7 @@ activate_up_menu_item_cb (GtkWidget *menu, EphyWindow *window)
go_nth = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(menu), "go_nth"));
- ephy_embed_get_go_up_list (embed, &l);
+ l = ephy_embed_get_go_up_list (embed);
url = g_slist_nth_data (l, go_nth);
if (url)
@@ -143,8 +143,8 @@ setup_back_or_forward_menu (EphyWindow *window, GtkMenuShell *ms, EphyNavigation
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_shistory_get_pos (embed, &pos);
- ephy_embed_shistory_count (embed, &count);
+ pos = ephy_embed_shistory_get_pos (embed);
+ count = ephy_embed_shistory_n_items (embed);
if (count == 0) return;
@@ -196,7 +196,7 @@ setup_up_menu (EphyWindow *window, GtkMenuShell *ms)
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_go_up_list (embed, &l);
+ l = ephy_embed_get_go_up_list (embed);
for (li = l; li; li = li->next)
{
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 5da504146..144546f0c 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -610,8 +610,7 @@ ephy_tab_address_cb (EphyEmbed *embed, const char *address, EphyTab *tab)
EphyHistory *history;
EphyNode *host;
GValue value = { 0, };
- float zoom = 1.0, current_zoom = 1.0;
- gresult rv;
+ float zoom = 1.0, current_zoom;
history = ephy_embed_shell_get_global_history
(EPHY_EMBED_SHELL (ephy_shell));
@@ -624,8 +623,8 @@ ephy_tab_address_cb (EphyEmbed *embed, const char *address, EphyTab *tab)
g_value_unset (&value);
}
- rv = ephy_embed_zoom_get (embed, &current_zoom);
- if (rv == G_OK && zoom != current_zoom)
+ current_zoom = ephy_embed_zoom_get (embed);
+ if (zoom != current_zoom)
{
tab->priv->setting_zoom = TRUE;
ephy_embed_zoom_set (embed, zoom, FALSE);
@@ -648,20 +647,22 @@ ephy_tab_zoom_changed_cb (EphyEmbed *embed, float zoom, EphyTab *tab)
return;
}
- ephy_embed_get_location (embed, TRUE, &address);
+ address = ephy_embed_get_location (embed, TRUE);
if (address_has_web_scheme (address))
{
EphyHistory *history;
EphyNode *host;
GValue value = { 0, };
- float zoom = 1.0;
-
history = ephy_embed_shell_get_global_history
(EPHY_EMBED_SHELL (ephy_shell));
host = ephy_history_get_host (history, address);
- if (host != NULL && ephy_embed_zoom_get (embed, &zoom) == G_OK)
+ if (host != NULL)
{
+ float zoom;
+
+ zoom = ephy_embed_zoom_get (embed);
+
g_value_init (&value, G_TYPE_FLOAT);
g_value_set_float (&value, zoom);
ephy_node_set_property
@@ -678,7 +679,7 @@ ephy_tab_title_cb (EphyEmbed *embed, EphyTab *tab)
{
char *title;
- ephy_embed_get_title (embed, &title);
+ title = ephy_embed_get_title (embed);
ephy_tab_set_title (tab, title);
@@ -1008,8 +1009,8 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
g_assert (EPHY_IS_EMBED_EVENT(event));
- ephy_embed_event_get_event_type (event, &type);
- ephy_embed_event_get_context (event, &context);
+ type = ephy_embed_event_get_event_type (event);
+ context = ephy_embed_event_get_context (event);
if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2
&& (context & EMBED_CONTEXT_LINK))
@@ -1181,17 +1182,17 @@ ephy_tab_update_navigation_flags (EphyTab *tab)
embed = tab->priv->embed;
- if (ephy_embed_can_go_up (embed) == G_OK)
+ if (ephy_embed_can_go_up (embed))
{
flags |= TAB_NAV_UP;
}
- if (ephy_embed_can_go_back (embed) == G_OK)
+ if (ephy_embed_can_go_back (embed))
{
flags |= TAB_NAV_BACK;
}
- if (ephy_embed_can_go_forward (embed) == G_OK)
+ if (ephy_embed_can_go_forward (embed))
{
flags |= TAB_NAV_FORWARD;
}
@@ -1248,7 +1249,7 @@ ephy_tab_set_title (EphyTab *tab, const char *new_title)
GnomeVFSURI *uri = NULL;
char *address;
- ephy_embed_get_location (tab->priv->embed, TRUE, &address);
+ address = ephy_embed_get_location (tab->priv->embed, TRUE);
if (address)
{
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 793495f49..5bf9297d4 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -603,16 +603,16 @@ edit_menu_show_cb (GtkWidget *menu,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_command_manager_get_command_state
- (EPHY_COMMAND_MANAGER (embed), "cmd_copy", &can_copy);
- ephy_command_manager_get_command_state
- (EPHY_COMMAND_MANAGER (embed), "cmd_cut", &can_cut);
- ephy_command_manager_get_command_state
- (EPHY_COMMAND_MANAGER (embed), "cmd_paste", &can_paste);
- ephy_command_manager_get_command_state
- (EPHY_COMMAND_MANAGER (embed), "cmd_undo", &can_undo);
- ephy_command_manager_get_command_state
- (EPHY_COMMAND_MANAGER (embed), "cmd_redo", &can_redo);
+ can_copy = ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_copy");
+ can_cut = ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_cut");
+ can_paste = ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_paste");
+ can_undo = ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_undo");
+ can_redo = ephy_command_manager_get_command_state
+ (EPHY_COMMAND_MANAGER (embed), "cmd_redo");
}
action_group = window->priv->action_group;
@@ -871,11 +871,7 @@ sync_tab_security (EphyTab *tab, GParamSpec *pspec, EphyWindow *window)
embed = ephy_tab_get_embed (tab);
- if (ephy_embed_get_security_level (embed, &level, &description) != G_OK)
- {
- level = STATE_IS_UNKNOWN;
- description = NULL;
- }
+ ephy_embed_get_security_level (embed, &level, &description);
if (level != ephy_tab_get_security_level (tab))
{
@@ -1083,7 +1079,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
has_background = ephy_embed_event_has_property (event, "background_image");
- ephy_embed_event_get_context (event, &context);
+ context = ephy_embed_event_get_context (event);
if ((context & EMBED_CONTEXT_LINK) &&
(context & EMBED_CONTEXT_IMAGE))
@@ -1123,7 +1119,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
g_signal_connect (widget, "destroy",
G_CALLBACK (popup_destroy_cb), window);
- ephy_embed_event_get_event_type (event, &type);
+ type = ephy_embed_event_get_event_type (event);
if (type == EPHY_EMBED_EVENT_KEY)
{
gtk_menu_popup (GTK_MENU (widget), NULL, NULL,
@@ -1950,7 +1946,7 @@ ephy_window_set_zoom (EphyWindow *window,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_zoom_get (embed, &current_zoom);
+ current_zoom = ephy_embed_zoom_get (embed);
if (zoom == ZOOM_IN)
{
diff --git a/src/pdm-dialog.c b/src/pdm-dialog.c
index 3becb2d84..8cd0357d4 100755
--- a/src/pdm-dialog.c
+++ b/src/pdm-dialog.c
@@ -632,7 +632,7 @@ pdm_dialog_init (PdmDialog *dialog)
passwords_tv = setup_passwords_treeview (dialog);
cookies = g_new0 (PdmActionInfo, 1);
- ephy_embed_single_list_cookies (single, &cookies->list);
+ cookies->list = ephy_embed_single_list_cookies (single);
cookies->dialog = dialog;
cookies->remove_id = PROP_COOKIES_REMOVE;
cookies->add = pdm_dialog_cookie_add;
@@ -643,8 +643,8 @@ pdm_dialog_init (PdmDialog *dialog)
setup_action (cookies);
passwords = g_new0 (PdmActionInfo, 1);
- ephy_embed_single_list_passwords (single, PASSWORD_PASSWORD,
- &passwords->list);
+ passwords->list = ephy_embed_single_list_passwords
+ (single, PASSWORD_PASSWORD);
passwords->dialog = dialog;
passwords->remove_id = PROP_PASSWORDS_REMOVE;
passwords->add = pdm_dialog_password_add;
diff --git a/src/popup-commands.c b/src/popup-commands.c
index 8771274c6..7756f9daf 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -196,7 +196,7 @@ popup_cmd_frame_in_new_tab (GtkAction *action,
embed = ephy_window_get_active_embed (window);
- ephy_embed_get_location (embed, FALSE, &location);
+ location = ephy_embed_get_location (embed, FALSE);
ephy_shell_new_tab (ephy_shell, window, tab,
location,
@@ -218,7 +218,7 @@ popup_cmd_frame_in_new_window (GtkAction *action,
embed = ephy_window_get_active_embed (window);
- ephy_embed_get_location (embed, FALSE, &location);
+ location = ephy_embed_get_location (embed, FALSE);
ephy_shell_new_tab (ephy_shell, NULL, tab,
location,
@@ -428,7 +428,7 @@ popup_cmd_open_frame (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_location (embed, FALSE, &location);
+ location = ephy_embed_get_location (embed, FALSE);
ephy_embed_load_url (embed, location);
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index a9e303afd..a5caebab0 100755
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -220,7 +220,7 @@ toolbar_update_sensitivity (PPViewToolbar *t)
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_print_preview_num_pages (embed, &pages);
+ pages = ephy_embed_print_preview_n_pages (embed);
c_page = t->priv->current_page;
action = gtk_action_group_get_action (action_group, "PPVGoBack");
@@ -321,8 +321,7 @@ toolbar_cmd_ppv_goto_last (GtkUIManager *merge,
PRINTPREVIEW_END,
0);
- ephy_embed_print_preview_num_pages (embed,
- &t->priv->current_page);
+ t->priv->current_page = ephy_embed_print_preview_n_pages (embed);
toolbar_update_sensitivity (t);
}
@@ -337,7 +336,7 @@ clamp_page_limits (PPViewToolbar *t, int page)
embed = ephy_window_get_active_embed (window);
g_return_val_if_fail (embed != NULL, -1);
- ephy_embed_print_preview_num_pages (embed, &pages);
+ pages = ephy_embed_print_preview_n_pages (embed);
return CLAMP (page, 1, pages);
}
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index ddcc91567..f20291cb1 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -416,9 +416,8 @@ setup_font_menu (PrefsDialog *dialog,
single = ephy_embed_shell_get_embed_single
(EPHY_EMBED_SHELL (ephy_shell));
- ephy_embed_single_get_font_list (single,
- get_current_language_code (dialog),
- &fonts);
+ fonts = ephy_embed_single_get_font_list
+ (single, get_current_language_code (dialog));
/* Get the default font */
g_snprintf (key, 255, "%s_%s_%s", CONF_RENDERING_FONT, type,
@@ -1101,7 +1100,7 @@ prefs_homepage_current_button_clicked_cb (GtkWidget *button,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_location (embed, TRUE, &location);
+ location = ephy_embed_get_location (embed, TRUE);
set_homepage_entry (dialog, location);
g_free (location);
}
diff --git a/src/session.c b/src/session.c
index db894d54d..e6042e95a 100644
--- a/src/session.c
+++ b/src/session.c
@@ -451,7 +451,7 @@ save_tab (EphyWindow *window,
/* otherwise, use the actual location. */
embed = ephy_tab_get_embed (tab);
- ephy_embed_get_location (embed, TRUE, &location);
+ location = ephy_embed_get_location (embed, TRUE);
xmlSetProp (embed_node, "url", location);
g_free (location);
diff --git a/src/window-commands.c b/src/window-commands.c
index d7d48834b..215a1bf48 100644
--- a/src/window-commands.c
+++ b/src/window-commands.c
@@ -121,11 +121,12 @@ window_cmd_file_send_to (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_location (embed, TRUE, &embed_location);
+ embed_location = ephy_embed_get_location (embed, TRUE);
location = gnome_vfs_escape_string (embed_location);
g_free (embed_location);
- if (ephy_embed_get_title (embed, &title) == G_OK)
+ title = ephy_embed_get_title (embed);
+ if (title != NULL)
{
char *tmp = gnome_vfs_escape_string (title);
g_free (title);
@@ -297,9 +298,10 @@ window_cmd_file_bookmark_page (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_location (embed, TRUE, &location);
+ location = ephy_embed_get_location (embed, TRUE);
- if (ephy_embed_get_title (embed, &title) != G_OK)
+ title = ephy_embed_get_title (embed);
+ if (title == NULL)
{
title = g_strdup (_("Untitled"));
}
@@ -754,7 +756,7 @@ window_cmd_view_page_source (GtkAction *action,
embed = ephy_window_get_active_embed (window);
g_return_if_fail (embed != NULL);
- ephy_embed_get_location (embed, TRUE, &address);
+ address = ephy_embed_get_location (embed, TRUE);
if (editor_can_open_uri (address))
{