Commit beaba05a authored by Michael Catanzaro's avatar Michael Catanzaro

Purge g_return from embed/

parent 3f97148d
......@@ -270,8 +270,8 @@ void
ephy_download_set_destination_uri (EphyDownload *download,
const char *destination)
{
g_return_if_fail (EPHY_IS_DOWNLOAD (download));
g_return_if_fail (destination != NULL);
g_assert (EPHY_IS_DOWNLOAD (download));
g_assert (destination != NULL);
webkit_download_set_destination (download->download, destination);
g_object_notify_by_pspec (G_OBJECT (download), obj_properties[PROP_DESTINATION]);
......@@ -290,7 +290,7 @@ void
ephy_download_set_action (EphyDownload *download,
EphyDownloadActionType action)
{
g_return_if_fail (EPHY_IS_DOWNLOAD (download));
g_assert (EPHY_IS_DOWNLOAD (download));
download->action = action;
g_object_notify_by_pspec (G_OBJECT (download), obj_properties[PROP_ACTION]);
......@@ -307,7 +307,7 @@ ephy_download_set_action (EphyDownload *download,
WebKitDownload *
ephy_download_get_webkit_download (EphyDownload *download)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), NULL);
g_assert (EPHY_IS_DOWNLOAD (download));
return download->download;
}
......@@ -323,7 +323,7 @@ ephy_download_get_webkit_download (EphyDownload *download)
const char *
ephy_download_get_destination_uri (EphyDownload *download)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), NULL);
g_assert (EPHY_IS_DOWNLOAD (download));
return webkit_download_get_destination (download->download);
}
......@@ -342,7 +342,7 @@ ephy_download_get_destination_uri (EphyDownload *download)
EphyDownloadActionType
ephy_download_get_action (EphyDownload *download)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), EPHY_DOWNLOAD_ACTION_NONE);
g_assert (EPHY_IS_DOWNLOAD (download));
return download->action;
}
......@@ -373,7 +373,7 @@ ephy_download_get_start_time (EphyDownload *download)
void
ephy_download_cancel (EphyDownload *download)
{
g_return_if_fail (EPHY_IS_DOWNLOAD (download));
g_assert (EPHY_IS_DOWNLOAD (download));
webkit_download_cancel (download->download);
}
......@@ -381,7 +381,7 @@ ephy_download_cancel (EphyDownload *download)
gboolean
ephy_download_is_active (EphyDownload *download)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), FALSE);
g_assert (EPHY_IS_DOWNLOAD (download));
return !download->finished;
}
......@@ -389,7 +389,7 @@ ephy_download_is_active (EphyDownload *download)
gboolean
ephy_download_succeeded (EphyDownload *download)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), FALSE);
g_assert (EPHY_IS_DOWNLOAD (download));
return download->finished && !download->error;
}
......@@ -398,7 +398,7 @@ gboolean
ephy_download_failed (EphyDownload *download,
GError **error)
{
g_return_val_if_fail (EPHY_IS_DOWNLOAD (download), FALSE);
g_assert (EPHY_IS_DOWNLOAD (download));
if (download->finished && download->error) {
if (error)
......@@ -722,7 +722,7 @@ ephy_download_new (WebKitDownload *download)
{
EphyDownload *ephy_download;
g_return_val_if_fail (WEBKIT_IS_DOWNLOAD (download), NULL);
g_assert (WEBKIT_IS_DOWNLOAD (download));
ephy_download = g_object_new (EPHY_TYPE_DOWNLOAD, NULL);
......@@ -763,7 +763,7 @@ ephy_download_new_for_uri (const char *uri)
WebKitDownload *download;
EphyEmbedShell *shell = ephy_embed_shell_get_default ();
g_return_val_if_fail (uri != NULL, NULL);
g_assert (uri != NULL);
download = webkit_web_context_download_uri (ephy_embed_shell_get_web_context (shell), uri);
ephy_download = ephy_download_new (download);
......
......@@ -165,8 +165,8 @@ ephy_downloads_manager_add_download (EphyDownloadsManager *manager,
{
WebKitDownload *wk_download;
g_return_if_fail (EPHY_IS_DOWNLOADS_MANAGER (manager));
g_return_if_fail (EPHY_IS_DOWNLOAD (download));
g_assert (EPHY_IS_DOWNLOADS_MANAGER (manager));
g_assert (EPHY_IS_DOWNLOAD (download));
if (g_list_find (manager->downloads, download))
return;
......@@ -195,8 +195,8 @@ ephy_downloads_manager_remove_download (EphyDownloadsManager *manager,
{
GList *download_link;
g_return_if_fail (EPHY_IS_DOWNLOADS_MANAGER (manager));
g_return_if_fail (EPHY_IS_DOWNLOAD (download));
g_assert (EPHY_IS_DOWNLOADS_MANAGER (manager));
g_assert (EPHY_IS_DOWNLOAD (download));
download_link = g_list_find (manager->downloads, download);
if (!download_link)
......@@ -212,7 +212,7 @@ ephy_downloads_manager_has_active_downloads (EphyDownloadsManager *manager)
{
GList *l;
g_return_val_if_fail (EPHY_IS_DOWNLOADS_MANAGER (manager), FALSE);
g_assert (EPHY_IS_DOWNLOADS_MANAGER (manager));
for (l = manager->downloads; l; l = g_list_next (l)) {
EphyDownload *download = EPHY_DOWNLOAD (l->data);
......@@ -227,7 +227,7 @@ ephy_downloads_manager_has_active_downloads (EphyDownloadsManager *manager)
GList *
ephy_downloads_manager_get_downloads (EphyDownloadsManager *manager)
{
g_return_val_if_fail (EPHY_IS_DOWNLOADS_MANAGER (manager), NULL);
g_assert (EPHY_IS_DOWNLOADS_MANAGER (manager));
return manager->downloads;
}
......@@ -239,7 +239,7 @@ ephy_downloads_manager_get_estimated_progress (EphyDownloadsManager *manager)
guint n_active = 0;
gdouble progress = 0;
g_return_val_if_fail (EPHY_IS_DOWNLOADS_MANAGER (manager), 0);
g_assert (EPHY_IS_DOWNLOADS_MANAGER (manager));
for (l = manager->downloads; l; l = g_list_next (l)) {
EphyDownload *download = EPHY_DOWNLOAD (l->data);
......
......@@ -59,8 +59,8 @@ ephy_embed_container_add_child (EphyEmbedContainer *container,
{
EphyEmbedContainerInterface *iface;
g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), -1);
g_return_val_if_fail (EPHY_IS_EMBED (child), -1);
g_assert (EPHY_IS_EMBED_CONTAINER (container));
g_assert (EPHY_IS_EMBED (child));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->add_child (container, child, position, set_active);
......@@ -79,8 +79,8 @@ ephy_embed_container_set_active_child (EphyEmbedContainer *container,
{
EphyEmbedContainerInterface *iface;
g_return_if_fail (EPHY_IS_EMBED_CONTAINER (container));
g_return_if_fail (EPHY_IS_EMBED (child));
g_assert (EPHY_IS_EMBED_CONTAINER (container));
g_assert (EPHY_IS_EMBED (child));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
......@@ -100,8 +100,8 @@ ephy_embed_container_remove_child (EphyEmbedContainer *container,
{
EphyEmbedContainerInterface *iface;
g_return_if_fail (EPHY_IS_EMBED_CONTAINER (container));
g_return_if_fail (EPHY_IS_EMBED (child));
g_assert (EPHY_IS_EMBED_CONTAINER (container));
g_assert (EPHY_IS_EMBED (child));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
......@@ -121,7 +121,7 @@ ephy_embed_container_get_active_child (EphyEmbedContainer *container)
{
EphyEmbedContainerInterface *iface;
g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), NULL);
g_assert (EPHY_IS_EMBED_CONTAINER (container));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_active_child (container);
......@@ -141,7 +141,7 @@ ephy_embed_container_get_children (EphyEmbedContainer *container)
{
EphyEmbedContainerInterface *iface;
g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), NULL);
g_assert (EPHY_IS_EMBED_CONTAINER (container));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_children (container);
......@@ -160,7 +160,7 @@ ephy_embed_container_get_is_popup (EphyEmbedContainer *container)
{
EphyEmbedContainerInterface *iface;
g_return_val_if_fail (EPHY_IS_EMBED_CONTAINER (container), FALSE);
g_assert (EPHY_IS_EMBED_CONTAINER (container));
iface = EPHY_EMBED_CONTAINER_GET_IFACE (container);
return iface->get_is_popup (container);
......
......@@ -78,7 +78,7 @@ ephy_embed_event_get_context (EphyEmbedEvent *event)
{
guint context;
g_return_val_if_fail (EPHY_IS_EMBED_EVENT (event), 0);
g_assert (EPHY_IS_EMBED_EVENT (event));
g_object_get (event->hit_test_result, "context", &context, NULL);
return context;
......@@ -87,7 +87,7 @@ ephy_embed_event_get_context (EphyEmbedEvent *event)
guint
ephy_embed_event_get_button (EphyEmbedEvent *event)
{
g_return_val_if_fail (EPHY_IS_EMBED_EVENT (event), 0);
g_assert (EPHY_IS_EMBED_EVENT (event));
return event->button;
}
......@@ -95,7 +95,7 @@ ephy_embed_event_get_button (EphyEmbedEvent *event)
guint
ephy_embed_event_get_modifier (EphyEmbedEvent *event)
{
g_return_val_if_fail (EPHY_IS_EMBED_EVENT (event), 0);
g_assert (EPHY_IS_EMBED_EVENT (event));
return event->modifier;
}
......@@ -104,7 +104,7 @@ void
ephy_embed_event_get_coords (EphyEmbedEvent *event,
guint *x, guint *y)
{
g_return_if_fail (EPHY_IS_EMBED_EVENT (event));
g_assert (EPHY_IS_EMBED_EVENT (event));
if (x)
*x = event->x;
......@@ -123,8 +123,8 @@ ephy_embed_event_get_property (EphyEmbedEvent *event,
const char *name,
GValue *value)
{
g_return_if_fail (EPHY_IS_EMBED_EVENT (event));
g_return_if_fail (name);
g_assert (EPHY_IS_EMBED_EVENT (event));
g_assert (name);
/* FIXME: ugly hack! This only works for now because all properties
we have are strings */
......@@ -137,8 +137,8 @@ gboolean
ephy_embed_event_has_property (EphyEmbedEvent *event,
const char *name)
{
g_return_val_if_fail (EPHY_IS_EMBED_EVENT (event), FALSE);
g_return_val_if_fail (name, FALSE);
g_assert (EPHY_IS_EMBED_EVENT (event));
g_assert (name);
return g_object_class_find_property (G_OBJECT_GET_CLASS (event->hit_test_result),
name) != NULL;
......@@ -153,7 +153,7 @@ ephy_embed_event_has_property (EphyEmbedEvent *event,
WebKitHitTestResult *
ephy_embed_event_get_hit_test_result (EphyEmbedEvent *event)
{
g_return_val_if_fail (EPHY_IS_EMBED_EVENT (event), NULL);
g_assert (EPHY_IS_EMBED_EVENT (event));
return event->hit_test_result;
}
......@@ -539,7 +539,7 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (priv->global_history_service == NULL) {
char *filename;
......@@ -554,7 +554,7 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
priv->global_history_service = ephy_history_service_new (filename, mode);
g_free (filename);
g_return_val_if_fail (priv->global_history_service, NULL);
g_assert (priv->global_history_service);
g_signal_connect (priv->global_history_service, "urls-visited",
G_CALLBACK (history_service_urls_visited_cb),
shell);
......@@ -597,7 +597,7 @@ ephy_embed_shell_get_encodings (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (priv->encodings == NULL)
priv->encodings = ephy_encodings_new ();
......@@ -1291,7 +1291,7 @@ ephy_embed_shell_set_page_setup (EphyEmbedShell *shell,
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
char *path;
g_return_if_fail (EPHY_IS_EMBED_SHELL (shell));
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (page_setup != NULL)
g_object_ref (page_setup);
......@@ -1318,7 +1318,7 @@ ephy_embed_shell_get_page_setup (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (priv->page_setup == NULL) {
GError *error = NULL;
......@@ -1354,7 +1354,7 @@ ephy_embed_shell_set_print_settings (EphyEmbedShell *shell,
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
char *path;
g_return_if_fail (EPHY_IS_EMBED_SHELL (shell));
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (settings != NULL)
g_object_ref (settings);
......@@ -1382,7 +1382,7 @@ ephy_embed_shell_get_print_settings (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL);
g_assert (EPHY_IS_EMBED_SHELL (shell));
if (priv->print_settings == NULL) {
GError *error = NULL;
......@@ -1414,7 +1414,7 @@ ephy_embed_shell_get_mode (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), EPHY_EMBED_SHELL_MODE_BROWSER);
g_assert (EPHY_IS_EMBED_SHELL (shell));
return priv->mode;
}
......@@ -1442,8 +1442,8 @@ ephy_embed_shell_launch_handler (EphyEmbedShell *shell,
GList *list = NULL;
gboolean ret = FALSE;
g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), FALSE);
g_return_val_if_fail (file || mime_type, FALSE);
g_assert (EPHY_IS_EMBED_SHELL (shell));
g_assert (file || mime_type);
app = ephy_file_launcher_get_app_info_for_file (file, mime_type);
......
......@@ -222,7 +222,7 @@ ephy_embed_utils_normalize_address (const char *address)
{
char *effective_address = NULL;
g_return_val_if_fail (address, NULL);
g_assert (address);
if (is_bang_search (address)) {
EphyEmbedShell *shell;
......
......@@ -135,8 +135,8 @@ ephy_embed_statusbar_get_context_id (EphyEmbed *embed, const char *context_desc
char *string;
guint id;
g_return_val_if_fail (EPHY_IS_EMBED (embed), 0);
g_return_val_if_fail (context_description != NULL, 0);
g_assert (EPHY_IS_EMBED (embed));
g_assert (context_description != NULL);
/* we need to preserve namespaces on object datas */
string = g_strconcat ("ephy-embed-status-bar-context:", context_description, NULL);
......@@ -167,7 +167,7 @@ ephy_embed_set_statusbar_label (EphyEmbed *embed, const char *label)
static void
ephy_embed_statusbar_update (EphyEmbed *embed, const char *text)
{
g_return_if_fail (EPHY_IS_EMBED (embed));
g_assert (EPHY_IS_EMBED (embed));
ephy_embed_set_statusbar_label (embed, text);
}
......@@ -177,9 +177,9 @@ ephy_embed_statusbar_push (EphyEmbed *embed, guint context_id, const char *text)
{
EphyEmbedStatusbarMsg *msg;
g_return_val_if_fail (EPHY_IS_EMBED (embed), 0);
g_return_val_if_fail (context_id != 0, 0);
g_return_val_if_fail (text != NULL, 0);
g_assert (EPHY_IS_EMBED (embed));
g_assert (context_id != 0);
g_assert (text != NULL);
msg = g_slice_new (EphyEmbedStatusbarMsg);
msg->text = g_strdup (text);
......@@ -201,8 +201,8 @@ ephy_embed_statusbar_pop (EphyEmbed *embed, guint context_id)
EphyEmbedStatusbarMsg *msg;
GSList *list;
g_return_if_fail (EPHY_IS_EMBED (embed));
g_return_if_fail (context_id != 0);
g_assert (EPHY_IS_EMBED (embed));
g_assert (context_id != 0);
for (list = embed->messages; list; list = list->next) {
msg = list->data;
......@@ -815,7 +815,7 @@ ephy_embed_init (EphyEmbed *embed)
EphyWebView *
ephy_embed_get_web_view (EphyEmbed *embed)
{
g_return_val_if_fail (EPHY_IS_EMBED (embed), NULL);
g_assert (EPHY_IS_EMBED (embed));
return EPHY_WEB_VIEW (embed->web_view);
}
......@@ -831,7 +831,7 @@ ephy_embed_get_web_view (EphyEmbed *embed)
EphyFindToolbar *
ephy_embed_get_find_toolbar (EphyEmbed *embed)
{
g_return_val_if_fail (EPHY_IS_EMBED (embed), NULL);
g_assert (EPHY_IS_EMBED (embed));
return EPHY_FIND_TOOLBAR (embed->find_toolbar);
}
......@@ -903,8 +903,8 @@ ephy_embed_remove_top_widget (EphyEmbed *embed, GtkWidget *widget)
void
ephy_embed_set_delayed_load_request (EphyEmbed *embed, WebKitURIRequest *request, WebKitWebViewSessionState *state)
{
g_return_if_fail (EPHY_IS_EMBED (embed));
g_return_if_fail (WEBKIT_IS_URI_REQUEST (request));
g_assert (EPHY_IS_EMBED (embed));
g_assert (WEBKIT_IS_URI_REQUEST (request));
g_clear_pointer (&embed->delayed_state, webkit_web_view_session_state_unref);
g_clear_object (&embed->delayed_request);
......@@ -925,7 +925,7 @@ ephy_embed_set_delayed_load_request (EphyEmbed *embed, WebKitURIRequest *request
gboolean
ephy_embed_has_load_pending (EphyEmbed *embed)
{
g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
g_assert (EPHY_IS_EMBED (embed));
return !!embed->delayed_request;
}
......@@ -933,7 +933,7 @@ ephy_embed_has_load_pending (EphyEmbed *embed)
const char *
ephy_embed_get_title (EphyEmbed *embed)
{
g_return_val_if_fail (EPHY_IS_EMBED (embed), NULL);
g_assert (EPHY_IS_EMBED (embed));
return embed->title;
}
......@@ -950,7 +950,7 @@ ephy_embed_get_title (EphyEmbed *embed)
gboolean
ephy_embed_inspector_is_loaded (EphyEmbed *embed)
{
g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
g_assert (EPHY_IS_EMBED (embed));
return embed->inspector_loaded;
}
......@@ -960,7 +960,7 @@ ephy_embed_attach_notification_container (EphyEmbed *embed)
{
EphyNotificationContainer *container;
g_return_if_fail (EPHY_IS_EMBED (embed));
g_assert (EPHY_IS_EMBED (embed));
container = ephy_notification_container_get_default ();
if (gtk_widget_get_parent (GTK_WIDGET (container)) == NULL)
......@@ -972,7 +972,7 @@ ephy_embed_detach_notification_container (EphyEmbed *embed)
{
EphyNotificationContainer *container;
g_return_if_fail (EPHY_IS_EMBED (embed));
g_assert (EPHY_IS_EMBED (embed));
container = ephy_notification_container_get_default ();
if (gtk_widget_get_parent (GTK_WIDGET (container)) == embed->overlay) {
......
......@@ -224,7 +224,7 @@ ephy_encoding_init (EphyEncoding *encoding)
const char *
ephy_encoding_get_title (EphyEncoding *encoding)
{
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), NULL);
g_assert (EPHY_IS_ENCODING (encoding));
return encoding->title;
}
......@@ -232,7 +232,7 @@ ephy_encoding_get_title (EphyEncoding *encoding)
const char *
ephy_encoding_get_title_elided (EphyEncoding *encoding)
{
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), NULL);
g_assert (EPHY_IS_ENCODING (encoding));
return encoding->title_elided;
}
......@@ -240,7 +240,7 @@ ephy_encoding_get_title_elided (EphyEncoding *encoding)
const char *
ephy_encoding_get_collation_key (EphyEncoding *encoding)
{
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), NULL);
g_assert (EPHY_IS_ENCODING (encoding));
return encoding->collation_key;
}
......@@ -248,7 +248,7 @@ ephy_encoding_get_collation_key (EphyEncoding *encoding)
const char *
ephy_encoding_get_encoding (EphyEncoding *encoding)
{
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), NULL);
g_assert (EPHY_IS_ENCODING (encoding));
return encoding->encoding;
}
......@@ -256,14 +256,15 @@ ephy_encoding_get_encoding (EphyEncoding *encoding)
int
ephy_encoding_get_language_groups (EphyEncoding *encoding)
{
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), LG_NONE);
g_assert (EPHY_IS_ENCODING (encoding));
return encoding->language_groups;
}
EphyEncoding *
ephy_encoding_new (const char *encoding, const char *title,
int language_groups)
ephy_encoding_new (const char *encoding,
const char *title,
int language_groups)
{
return g_object_new (EPHY_TYPE_ENCODING,
"encoding", encoding,
......
......@@ -206,7 +206,7 @@ ephy_encodings_get_encoding (EphyEncodings *encodings,
{
EphyEncoding *encoding;
g_return_val_if_fail (EPHY_IS_ENCODINGS (encodings), NULL);
g_assert (EPHY_IS_ENCODINGS (encodings));
encoding = g_hash_table_lookup (encodings->hash, code);
......@@ -273,7 +273,7 @@ ephy_encodings_get_all (EphyEncodings *encodings)
{
GList *l = NULL;
g_return_val_if_fail (EPHY_IS_ENCODINGS (encodings), NULL);
g_assert (EPHY_IS_ENCODINGS (encodings));
g_hash_table_foreach (encodings->hash, (GHFunc)get_all_encodings, &l);
......@@ -287,8 +287,8 @@ ephy_encodings_add_recent (EphyEncodings *encodings,
GSList *element, *l;
GVariantBuilder builder;
g_return_if_fail (EPHY_IS_ENCODINGS (encodings));
g_return_if_fail (code != NULL);
g_assert (EPHY_IS_ENCODINGS (encodings));
g_assert (code != NULL);
if (ephy_encodings_get_encoding (encodings, code, FALSE) == NULL)
return;
......@@ -331,13 +331,13 @@ ephy_encodings_get_recent (EphyEncodings *encodings)
GSList *l;
GList *list = NULL;
g_return_val_if_fail (EPHY_IS_ENCODINGS (encodings), NULL);
g_assert (EPHY_IS_ENCODINGS (encodings));
for (l = encodings->recent; l != NULL; l = l->next) {
EphyEncoding *encoding;
encoding = ephy_encodings_get_encoding (encodings, (char *)l->data, FALSE);
g_return_val_if_fail (EPHY_IS_ENCODING (encoding), NULL);
g_assert (EPHY_IS_ENCODING (encoding));
list = g_list_prepend (list, encoding);
}
......
......@@ -52,7 +52,7 @@ static GParamSpec *obj_properties[LAST_PROP];
static void
ephy_file_monitor_cancel (EphyFileMonitor *monitor)
{
g_return_if_fail (EPHY_IS_FILE_MONITOR (monitor));
g_assert (EPHY_IS_FILE_MONITOR (monitor));
if (monitor->monitor != NULL) {
LOG ("Cancelling file monitor");
......@@ -171,8 +171,8 @@ ephy_file_monitor_update_location (EphyFileMonitor *file_monitor,
GFileType file_type;
GFileInfo *file_info;
g_return_if_fail (EPHY_IS_FILE_MONITOR (file_monitor));
g_return_if_fail (address != NULL);
g_assert (EPHY_IS_FILE_MONITOR (file_monitor));
g_assert (address != NULL);
ephy_file_monitor_cancel (file_monitor);
......
......@@ -144,7 +144,7 @@ tab_search_key_press_cb (WebKitWebView *web_view,
{
GtkWidget *widget = (GtkWidget *)toolbar;
g_return_val_if_fail (event != NULL, FALSE);
g_assert (event != NULL);
/* check for / and ' which open the find toolbar in text resp. link mode */
if (gtk_search_bar_get_search_mode (GTK_SEARCH_BAR (widget)) == FALSE) {
......@@ -586,7 +586,7 @@ ephy_find_toolbar_open (EphyFindToolbar *toolbar,
gboolean links_only,
gboolean typing_ahead)
{
g_return_if_fail (toolbar->web_view != NULL);
g_assert (toolbar->web_view != NULL);
toolbar->typing_ahead = typing_ahead;
toolbar->links_only = links_only;
......
......@@ -499,8 +499,8 @@ GtkWidget *
ephy_option_menu_new (EphyWebView *view,
WebKitOptionMenu *menu)
{
g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), NULL);
g_return_val_if_fail (WEBKIT_IS_OPTION_MENU (menu), NULL);
g_assert (EPHY_IS_WEB_VIEW (view));
g_assert (WEBKIT_IS_OPTION_MENU (menu));
return g_object_new (EPHY_TYPE_OPTION_MENU,
"view", view,
......@@ -547,8 +547,8 @@ ephy_option_menu_popup (EphyOptionMenu *menu,
GtkWidget *toplevel;
GtkScrolledWindow *swindow;
g_return_if_fail (EPHY_IS_OPTION_MENU (menu));
g_return_if_fail (rect != NULL);
g_assert (EPHY_IS_OPTION_MENU (menu));
g_assert (rect != NULL);
window = gtk_widget_get_window (GTK_WIDGET (menu->view));
gdk_window_get_origin (window, &x, &y);
......@@ -629,7 +629,7 @@ ephy_option_menu_popup (EphyOptionMenu *menu,
void
ephy_option_menu_popdown (EphyOptionMenu *menu)
{
g_return_if_fail (EPHY_IS_OPTION_MENU (menu));
g_assert (EPHY_IS_OPTION_MENU (menu));
if (!menu->device)
return;
......
......@@ -165,7 +165,7 @@ ephy_web_extension_proxy_new (GDBusConnection *connection)
{
EphyWebExtensionProxy *web_extension;
g_return_val_if_fail (G_IS_DBUS_CONNECTION (connection), NULL);
g_assert (G_IS_DBUS_CONNECTION (connection));
web_extension = g_object_new (EPHY_TYPE_WEB_EXTENSION_PROXY, NULL);
......@@ -193,7 +193,7 @@ ephy_web_extension_proxy_form_auth_data_save_confirmation_response (EphyWebExten
guint request_id,
gboolean response)
{
g_return_if_fail (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
g_assert (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
if (!web_extension->proxy)
return;
......@@ -234,7 +234,7 @@ ephy_web_extension_proxy_web_page_has_modified_forms (EphyWebExtensionProxy *web
{
GTask *task;
g_return_if_fail (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
g_assert (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
task = g_task_new (web_extension, cancellable, callback, user_data);
......@@ -259,7 +259,7 @@ ephy_web_extension_proxy_web_page_has_modified_forms_finish (EphyWebExtensionPro
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, web_extension), FALSE);
g_assert (g_task_is_valid (result, web_extension));
return g_task_propagate_boolean (G_TASK (result), error);
}
......@@ -291,7 +291,7 @@ ephy_web_extension_proxy_get_best_web_app_icon (EphyWebExtensionProxy *web_exten
{
GTask *task;
g_return_if_fail (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
g_assert (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
task = g_task_new (web_extension, cancellable, callback, user_data);
......@@ -321,7 +321,7 @@ ephy_web_extension_proxy_get_best_web_app_icon_finish (EphyWebExtensionProxy *we
GVariant *variant;
GTask *task = G_TASK (result);
g_return_val_if_fail (g_task_is_valid (result, web_extension), FALSE);
g_assert (g_task_is_valid (result, web_extension));
variant = g_task_propagate_pointer (task, error);
if (!variant)
......@@ -363,7 +363,7 @@ ephy_web_extension_proxy_get_web_app_title (EphyWebExtensionProxy *web_extension
{
GTask *task;
g_return_if_fail (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
g_assert (EPHY_IS_WEB_EXTENSION_PROXY (web_extension));
task = g_task_new (web_extension, cancellable, callback, user_data);
......@@ -388,7 +388,7 @@ ephy_web_extension_proxy_get_web_app_title_finish (EphyWebExtensionProxy *web_ex
GAsyncResult *result,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, web_extension), FALSE);
g_assert (g_task_is_valid (result, web_extension));
return g_task_propagate_pointer (G_TASK (result), error);
}
......
......@@ -203,10 +203,10 @@ popups_manager_new_window_info (EphyEmbedContainer *container)
char *features;
g_object_get (container, "is-popup", &is_popup, NULL);
g_return_val_if_fail (is_popup, g_strdup (""));
g_assert (is_popup);
embed = ephy_embed_container_get_active_child (container);
g_return_val_if_fail (embed != NULL, g_strdup (""));
g_assert (embed != NULL);
gtk_widget_get_allocation (GTK_WIDGET (embed), &allocation);
......@@ -264,7 +264,7 @@ popups_manager_hide (EphyEmbedContainer *container,
char *features;
embed = ephy_embed_container_get_active_child (container);
g_return_if_fail (EPHY_IS_EMBED (embed));
g_assert (EPHY_IS_EMBED (embed));
location = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
if (location == NULL) return;
......@@ -815,8 +815,8 @@ allow_tls_certificate_cb (EphyEmbedShell *shell,
if (webkit_web_view_get_page_id (WEBKIT_WEB_VIEW (view)) != page_id)
return;