Commit 4436c462 authored by Michael Catanzaro's avatar Michael Catanzaro

Purge g_return from src/

parent 489df78b
...@@ -6,13 +6,10 @@ Some TODO items, in no particular order: ...@@ -6,13 +6,10 @@ Some TODO items, in no particular order:
- Use G_SOURCE_CONTINUE/G_SOURCE_REMOVE. - Use G_SOURCE_CONTINUE/G_SOURCE_REMOVE.
- Name all timeout and idle sources - Name all timeout and idle sources
- Replace constructor functions with constructed functions - Replace constructor functions with constructed functions
- Use g_clear_object in dispose/finalize - Use g_clear_object/g_clear_pointer in dispose/finalize
- Get rid of object references in dispose, not finalize - Replace dispose with finalize wherever possible
- embed/ does not make much sense anymore as a name. Rename to
something else, perhaps core/? webview/?
- Use GtkBuilder instead of declaring the UIs with C - Use GtkBuilder instead of declaring the UIs with C
- We practically don't test any part of Epiphany, change that (how do - We practically don't test any part of Epiphany, change that (how do
you test UI code? There's like 3 or 4 frameworks for this, pick one? you test UI code? There's like 3 or 4 frameworks for this, pick one?
What does Chrome do?) What does Chrome do?)
- g_str_equal -> g_strcmp0 or strcmp except in hash maps - g_str_equal -> g_strcmp0 or strcmp except in hash maps
- g_return -> g_assert more or less everywhere
...@@ -140,7 +140,7 @@ ephy_add_bookmark_popover_init (EphyAddBookmarkPopover *self) ...@@ -140,7 +140,7 @@ ephy_add_bookmark_popover_init (EphyAddBookmarkPopover *self)
GtkWidget * GtkWidget *
ephy_add_bookmark_popover_new (EphyHeaderBar *header_bar) ephy_add_bookmark_popover_new (EphyHeaderBar *header_bar)
{ {
g_return_val_if_fail (EPHY_IS_HEADER_BAR (header_bar), NULL); g_assert (EPHY_IS_HEADER_BAR (header_bar));
return g_object_new (EPHY_TYPE_ADD_BOOKMARK_POPOVER, return g_object_new (EPHY_TYPE_ADD_BOOKMARK_POPOVER,
"header-bar", header_bar, "header-bar", header_bar,
......
...@@ -537,8 +537,8 @@ ephy_bookmark_properties_grid_new (EphyBookmark *bookmark, ...@@ -537,8 +537,8 @@ ephy_bookmark_properties_grid_new (EphyBookmark *bookmark,
EphyBookmarkPropertiesGridType type, EphyBookmarkPropertiesGridType type,
GtkWidget *parent) GtkWidget *parent)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (bookmark), NULL); g_assert (EPHY_IS_BOOKMARK (bookmark));
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL); g_assert (GTK_IS_WIDGET (parent));
return g_object_new (EPHY_TYPE_BOOKMARK_PROPERTIES_GRID, return g_object_new (EPHY_TYPE_BOOKMARK_PROPERTIES_GRID,
"bookmark", bookmark, "bookmark", bookmark,
...@@ -550,7 +550,7 @@ ephy_bookmark_properties_grid_new (EphyBookmark *bookmark, ...@@ -550,7 +550,7 @@ ephy_bookmark_properties_grid_new (EphyBookmark *bookmark,
GtkWidget * GtkWidget *
ephy_bookmark_properties_grid_get_add_tag_button (EphyBookmarkPropertiesGrid *self) ephy_bookmark_properties_grid_get_add_tag_button (EphyBookmarkPropertiesGrid *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK_PROPERTIES_GRID (self), NULL); g_assert (EPHY_IS_BOOKMARK_PROPERTIES_GRID (self));
return self->add_tag_button; return self->add_tag_button;
} }
...@@ -234,7 +234,7 @@ ephy_bookmark_row_new (EphyBookmark *bookmark) ...@@ -234,7 +234,7 @@ ephy_bookmark_row_new (EphyBookmark *bookmark)
EphyBookmark * EphyBookmark *
ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self) ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK_ROW (self), NULL); g_assert (EPHY_IS_BOOKMARK_ROW (self));
return self->bookmark; return self->bookmark;
} }
...@@ -242,7 +242,7 @@ ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self) ...@@ -242,7 +242,7 @@ ephy_bookmark_row_get_bookmark (EphyBookmarkRow *self)
const char * const char *
ephy_bookmark_row_get_bookmark_url (EphyBookmarkRow *self) ephy_bookmark_row_get_bookmark_url (EphyBookmarkRow *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK_ROW (self), NULL); g_assert (EPHY_IS_BOOKMARK_ROW (self));
return ephy_bookmark_get_url (self->bookmark); return ephy_bookmark_get_url (self->bookmark);
} }
...@@ -305,7 +305,7 @@ void ...@@ -305,7 +305,7 @@ void
ephy_bookmark_set_time_added (EphyBookmark *self, ephy_bookmark_set_time_added (EphyBookmark *self,
gint64 time_added) gint64 time_added)
{ {
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_assert (time_added >= 0); g_assert (time_added >= 0);
self->time_added = time_added; self->time_added = time_added;
...@@ -314,7 +314,7 @@ ephy_bookmark_set_time_added (EphyBookmark *self, ...@@ -314,7 +314,7 @@ ephy_bookmark_set_time_added (EphyBookmark *self,
gint64 gint64
ephy_bookmark_get_time_added (EphyBookmark *self) ephy_bookmark_get_time_added (EphyBookmark *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), 0); g_assert (EPHY_IS_BOOKMARK (self));
return self->time_added; return self->time_added;
} }
...@@ -323,7 +323,7 @@ ephy_bookmark_get_time_added (EphyBookmark *self) ...@@ -323,7 +323,7 @@ ephy_bookmark_get_time_added (EphyBookmark *self)
void void
ephy_bookmark_set_url (EphyBookmark *self, const char *url) ephy_bookmark_set_url (EphyBookmark *self, const char *url)
{ {
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_free (self->url); g_free (self->url);
self->url = g_strdup (url); self->url = g_strdup (url);
...@@ -332,7 +332,7 @@ ephy_bookmark_set_url (EphyBookmark *self, const char *url) ...@@ -332,7 +332,7 @@ ephy_bookmark_set_url (EphyBookmark *self, const char *url)
const char * const char *
ephy_bookmark_get_url (EphyBookmark *self) ephy_bookmark_get_url (EphyBookmark *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL); g_assert (EPHY_IS_BOOKMARK (self));
return self->url; return self->url;
} }
...@@ -340,7 +340,7 @@ ephy_bookmark_get_url (EphyBookmark *self) ...@@ -340,7 +340,7 @@ ephy_bookmark_get_url (EphyBookmark *self)
void void
ephy_bookmark_set_title (EphyBookmark *self, const char *title) ephy_bookmark_set_title (EphyBookmark *self, const char *title)
{ {
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_free (self->title); g_free (self->title);
self->title = g_strdup (title); self->title = g_strdup (title);
...@@ -350,7 +350,7 @@ ephy_bookmark_set_title (EphyBookmark *self, const char *title) ...@@ -350,7 +350,7 @@ ephy_bookmark_set_title (EphyBookmark *self, const char *title)
const char * const char *
ephy_bookmark_get_title (EphyBookmark *bookmark) ephy_bookmark_get_title (EphyBookmark *bookmark)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (bookmark), NULL); g_assert (EPHY_IS_BOOKMARK (bookmark));
return bookmark->title; return bookmark->title;
} }
...@@ -359,8 +359,8 @@ void ...@@ -359,8 +359,8 @@ void
ephy_bookmark_set_id (EphyBookmark *self, ephy_bookmark_set_id (EphyBookmark *self,
const char *id) const char *id)
{ {
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_return_if_fail (id != NULL); g_assert (id != NULL);
g_free (self->id); g_free (self->id);
self->id = g_strdup (id); self->id = g_strdup (id);
...@@ -369,7 +369,7 @@ ephy_bookmark_set_id (EphyBookmark *self, ...@@ -369,7 +369,7 @@ ephy_bookmark_set_id (EphyBookmark *self,
const char * const char *
ephy_bookmark_get_id (EphyBookmark *self) ephy_bookmark_get_id (EphyBookmark *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL); g_assert (EPHY_IS_BOOKMARK (self));
return self->id; return self->id;
} }
...@@ -381,7 +381,7 @@ ephy_bookmark_set_is_uploaded (EphyBookmark *self, ...@@ -381,7 +381,7 @@ ephy_bookmark_set_is_uploaded (EphyBookmark *self,
/* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export /* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export
* expects it. We need to delete it and write a migrator for bookmarks. */ * expects it. We need to delete it and write a migrator for bookmarks. */
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
} }
gboolean gboolean
...@@ -389,7 +389,7 @@ ephy_bookmark_is_uploaded (EphyBookmark *self) ...@@ -389,7 +389,7 @@ ephy_bookmark_is_uploaded (EphyBookmark *self)
{ {
/* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export /* FIXME: This is no longer used for Firefox Sync, but bookmarks import/export
* expects it. We need to delete it and write a migrator for bookmarks. */ * expects it. We need to delete it and write a migrator for bookmarks. */
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), FALSE); g_assert (EPHY_IS_BOOKMARK (self));
return FALSE; return FALSE;
} }
...@@ -401,8 +401,8 @@ ephy_bookmark_add_tag (EphyBookmark *self, ...@@ -401,8 +401,8 @@ ephy_bookmark_add_tag (EphyBookmark *self,
GSequenceIter *tag_iter; GSequenceIter *tag_iter;
GSequenceIter *prev_tag_iter; GSequenceIter *prev_tag_iter;
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_return_if_fail (tag != NULL); g_assert (tag != NULL);
tag_iter = g_sequence_search (self->tags, tag_iter = g_sequence_search (self->tags,
(gpointer)tag, (gpointer)tag,
...@@ -423,8 +423,8 @@ ephy_bookmark_remove_tag (EphyBookmark *self, ...@@ -423,8 +423,8 @@ ephy_bookmark_remove_tag (EphyBookmark *self,
{ {
GSequenceIter *tag_iter; GSequenceIter *tag_iter;
g_return_if_fail (EPHY_IS_BOOKMARK (self)); g_assert (EPHY_IS_BOOKMARK (self));
g_return_if_fail (tag != NULL); g_assert (tag != NULL);
tag_iter = g_sequence_lookup (self->tags, tag_iter = g_sequence_lookup (self->tags,
(gpointer)tag, (gpointer)tag,
...@@ -442,8 +442,8 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag) ...@@ -442,8 +442,8 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag)
{ {
GSequenceIter *tag_iter; GSequenceIter *tag_iter;
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), FALSE); g_assert (EPHY_IS_BOOKMARK (self));
g_return_val_if_fail (tag != NULL, FALSE); g_assert (tag != NULL);
tag_iter = g_sequence_lookup (self->tags, tag_iter = g_sequence_lookup (self->tags,
(gpointer)tag, (gpointer)tag,
...@@ -456,7 +456,7 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag) ...@@ -456,7 +456,7 @@ ephy_bookmark_has_tag (EphyBookmark *self, const char *tag)
GSequence * GSequence *
ephy_bookmark_get_tags (EphyBookmark *self) ephy_bookmark_get_tags (EphyBookmark *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARK (self), NULL); g_assert (EPHY_IS_BOOKMARK (self));
return self->tags; return self->tags;
} }
......
...@@ -338,8 +338,8 @@ void ...@@ -338,8 +338,8 @@ void
ephy_bookmarks_manager_add_bookmark (EphyBookmarksManager *self, ephy_bookmarks_manager_add_bookmark (EphyBookmarksManager *self,
EphyBookmark *bookmark) EphyBookmark *bookmark)
{ {
g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self)); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_if_fail (EPHY_IS_BOOKMARK (bookmark)); g_assert (EPHY_IS_BOOKMARK (bookmark));
ephy_bookmarks_manager_add_bookmark_internal (self, bookmark, TRUE); ephy_bookmarks_manager_add_bookmark_internal (self, bookmark, TRUE);
g_signal_emit_by_name (self, "synchronizable-modified", bookmark, FALSE); g_signal_emit_by_name (self, "synchronizable-modified", bookmark, FALSE);
...@@ -351,8 +351,8 @@ ephy_bookmarks_manager_add_bookmarks (EphyBookmarksManager *self, ...@@ -351,8 +351,8 @@ ephy_bookmarks_manager_add_bookmarks (EphyBookmarksManager *self,
{ {
GSequenceIter *iter; GSequenceIter *iter;
g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self)); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_if_fail (bookmarks != NULL); g_assert (bookmarks != NULL);
for (iter = g_sequence_get_begin_iter (bookmarks); for (iter = g_sequence_get_begin_iter (bookmarks);
!g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) { !g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) {
...@@ -407,8 +407,8 @@ ephy_bookmarks_manager_remove_bookmark_internal (EphyBookmarksManager *self, ...@@ -407,8 +407,8 @@ ephy_bookmarks_manager_remove_bookmark_internal (EphyBookmarksManager *self,
void ephy_bookmarks_manager_remove_bookmark (EphyBookmarksManager *self, void ephy_bookmarks_manager_remove_bookmark (EphyBookmarksManager *self,
EphyBookmark *bookmark) EphyBookmark *bookmark)
{ {
g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self)); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_if_fail (EPHY_IS_BOOKMARK (bookmark)); g_assert (EPHY_IS_BOOKMARK (bookmark));
g_signal_emit_by_name (self, "synchronizable-deleted", bookmark); g_signal_emit_by_name (self, "synchronizable-deleted", bookmark);
ephy_bookmarks_manager_remove_bookmark_internal (self, bookmark); ephy_bookmarks_manager_remove_bookmark_internal (self, bookmark);
...@@ -420,8 +420,8 @@ ephy_bookmarks_manager_get_bookmark_by_url (EphyBookmarksManager *self, ...@@ -420,8 +420,8 @@ ephy_bookmarks_manager_get_bookmark_by_url (EphyBookmarksManager *self,
{ {
GSequenceIter *iter; GSequenceIter *iter;
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_val_if_fail (url != NULL, FALSE); g_assert (url != NULL);
for (iter = g_sequence_get_begin_iter (self->bookmarks); for (iter = g_sequence_get_begin_iter (self->bookmarks);
!g_sequence_iter_is_end (iter); !g_sequence_iter_is_end (iter);
...@@ -441,8 +441,8 @@ ephy_bookmarks_manager_get_bookmark_by_id (EphyBookmarksManager *self, ...@@ -441,8 +441,8 @@ ephy_bookmarks_manager_get_bookmark_by_id (EphyBookmarksManager *self,
{ {
GSequenceIter *iter; GSequenceIter *iter;
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_val_if_fail (id != NULL, FALSE); g_assert (id != NULL);
for (iter = g_sequence_get_begin_iter (self->bookmarks); for (iter = g_sequence_get_begin_iter (self->bookmarks);
!g_sequence_iter_is_end (iter); !g_sequence_iter_is_end (iter);
...@@ -462,8 +462,8 @@ ephy_bookmarks_manager_create_tag (EphyBookmarksManager *self, const char *tag) ...@@ -462,8 +462,8 @@ ephy_bookmarks_manager_create_tag (EphyBookmarksManager *self, const char *tag)
GSequenceIter *tag_iter; GSequenceIter *tag_iter;
GSequenceIter *prev_tag_iter; GSequenceIter *prev_tag_iter;
g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self)); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_if_fail (tag != NULL); g_assert (tag != NULL);
tag_iter = g_sequence_search (self->tags, tag_iter = g_sequence_search (self->tags,
(gpointer)tag, (gpointer)tag,
...@@ -484,8 +484,8 @@ ephy_bookmarks_manager_delete_tag (EphyBookmarksManager *self, const char *tag) ...@@ -484,8 +484,8 @@ ephy_bookmarks_manager_delete_tag (EphyBookmarksManager *self, const char *tag)
GSequenceIter *iter = NULL; GSequenceIter *iter = NULL;
int position; int position;
g_return_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self)); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_if_fail (tag != NULL); g_assert (tag != NULL);
if (strcmp (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0) if (strcmp (tag, EPHY_BOOKMARKS_FAVORITES_TAG) == 0)
return; return;
...@@ -511,8 +511,8 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag) ...@@ -511,8 +511,8 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag)
{ {
GSequenceIter *iter; GSequenceIter *iter;
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), FALSE); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
g_return_val_if_fail (tag != NULL, FALSE); g_assert (tag != NULL);
iter = g_sequence_lookup (self->tags, iter = g_sequence_lookup (self->tags,
(gpointer)tag, (gpointer)tag,
...@@ -525,7 +525,7 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag) ...@@ -525,7 +525,7 @@ ephy_bookmarks_manager_tag_exists (EphyBookmarksManager *self, const char *tag)
GSequence * GSequence *
ephy_bookmarks_manager_get_bookmarks (EphyBookmarksManager *self) ephy_bookmarks_manager_get_bookmarks (EphyBookmarksManager *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
return self->bookmarks; return self->bookmarks;
} }
...@@ -537,7 +537,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self, ...@@ -537,7 +537,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self,
GSequence *bookmarks; GSequence *bookmarks;
GSequenceIter *iter; GSequenceIter *iter;
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
bookmarks = g_sequence_new (g_object_unref); bookmarks = g_sequence_new (g_object_unref);
...@@ -574,7 +574,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self, ...@@ -574,7 +574,7 @@ ephy_bookmarks_manager_get_bookmarks_with_tag (EphyBookmarksManager *self,
GSequence * GSequence *
ephy_bookmarks_manager_get_tags (EphyBookmarksManager *self) ephy_bookmarks_manager_get_tags (EphyBookmarksManager *self)
{ {
g_return_val_if_fail (EPHY_IS_BOOKMARKS_MANAGER (self), NULL); g_assert (EPHY_IS_BOOKMARKS_MANAGER (self));
return self->tags; return self->tags;
} }
...@@ -599,7 +599,7 @@ ephy_bookmarks_manager_save_to_file_finish (EphyBookmarksManager *self, ...@@ -599,7 +599,7 @@ ephy_bookmarks_manager_save_to_file_finish (EphyBookmarksManager *self,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
g_return_val_if_fail (g_task_is_valid (result, self), FALSE); g_assert (g_task_is_valid (result, self));
return g_task_propagate_boolean (G_TASK (result), error); return g_task_propagate_boolean (G_TASK (result), error);
} }
......
...@@ -113,7 +113,7 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog) ...@@ -113,7 +113,7 @@ sync_encoding_against_embed (EphyEncodingDialog *dialog)
dialog->update_embed_tag = TRUE; dialog->update_embed_tag = TRUE;
g_return_if_fail (EPHY_IS_EMBED (dialog->embed)); g_assert (EPHY_IS_EMBED (dialog->embed));
view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed); view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
encoding = webkit_web_view_get_custom_charset (view); encoding = webkit_web_view_get_custom_charset (view);
...@@ -170,7 +170,7 @@ ephy_encoding_dialog_attach_embed (EphyEncodingDialog *dialog) ...@@ -170,7 +170,7 @@ ephy_encoding_dialog_attach_embed (EphyEncodingDialog *dialog)
EphyEmbed **embedptr; EphyEmbed **embedptr;
embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (dialog->window)); embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (dialog->window));
g_return_if_fail (EPHY_IS_EMBED (embed)); g_assert (EPHY_IS_EMBED (embed));
g_signal_connect (G_OBJECT (ephy_embed_get_web_view (embed)), "load-changed", g_signal_connect (G_OBJECT (ephy_embed_get_web_view (embed)), "load-changed",
G_CALLBACK (embed_net_stop_cb), dialog); G_CALLBACK (embed_net_stop_cb), dialog);
...@@ -195,7 +195,7 @@ activate_choice (EphyEncodingDialog *dialog) ...@@ -195,7 +195,7 @@ activate_choice (EphyEncodingDialog *dialog)
{ {
WebKitWebView *view; WebKitWebView *view;
g_return_if_fail (EPHY_IS_EMBED (dialog->embed)); g_assert (EPHY_IS_EMBED (dialog->embed));
view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed); view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
if (gtk_switch_get_active (dialog->default_switch)) { if (gtk_switch_get_active (dialog->default_switch)) {
...@@ -381,7 +381,7 @@ ephy_encoding_dialog_constructed (GObject *object) ...@@ -381,7 +381,7 @@ ephy_encoding_dialog_constructed (GObject *object)
/* selected encoding */ /* selected encoding */
dialog = EPHY_ENCODING_DIALOG (object); dialog = EPHY_ENCODING_DIALOG (object);
g_return_if_fail (EPHY_IS_EMBED (dialog->embed)); g_assert (EPHY_IS_EMBED (dialog->embed));
view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed); view = EPHY_GET_WEBKIT_WEB_VIEW_FROM_EMBED (dialog->embed);
dialog->selected_encoding = webkit_web_view_get_custom_charset (view); dialog->selected_encoding = webkit_web_view_get_custom_charset (view);
...@@ -434,7 +434,7 @@ static void ...@@ -434,7 +434,7 @@ static void
ephy_encoding_dialog_set_parent_window (EphyEncodingDialog *dialog, ephy_encoding_dialog_set_parent_window (EphyEncodingDialog *dialog,
EphyWindow *window) EphyWindow *window)
{ {
g_return_if_fail (EPHY_IS_WINDOW (window)); g_assert (EPHY_IS_WINDOW (window));
g_signal_connect (G_OBJECT (window), "notify::active-child", g_signal_connect (G_OBJECT (window), "notify::active-child",
G_CALLBACK (ephy_encoding_dialog_sync_embed), dialog); G_CALLBACK (ephy_encoding_dialog_sync_embed), dialog);
......
...@@ -50,7 +50,7 @@ void ...@@ -50,7 +50,7 @@ void
ephy_encoding_row_set_selected (EphyEncodingRow *row, ephy_encoding_row_set_selected (EphyEncodingRow *row,
gboolean selected) gboolean selected)
{ {
g_return_if_fail (EPHY_IS_ENCODING_ROW (row)); g_assert (EPHY_IS_ENCODING_ROW (row));
if (selected) if (selected)
gtk_widget_show (GTK_WIDGET (row->selected_image)); gtk_widget_show (GTK_WIDGET (row->selected_image));
...@@ -68,7 +68,7 @@ static void ...@@ -68,7 +68,7 @@ static void
ephy_encoding_row_set_encoding (EphyEncodingRow *self, ephy_encoding_row_set_encoding (EphyEncodingRow *self,
EphyEncoding *encoding) EphyEncoding *encoding)
{ {
g_return_if_fail (EPHY_IS_ENCODING (encoding)); g_assert (EPHY_IS_ENCODING (encoding));
self->encoding = encoding; self->encoding = encoding;
gtk_label_set_text (self->encoding_label, gtk_label_set_text (self->encoding_label,
......
...@@ -283,7 +283,7 @@ new_history_menu_item (EphyWebView *view, ...@@ -283,7 +283,7 @@ new_history_menu_item (EphyWebView *view,
WebKitFaviconDatabase *database; WebKitFaviconDatabase *database;
EphyEmbedShell *shell = ephy_embed_shell_get_default (); EphyEmbedShell *shell = ephy_embed_shell_get_default ();
g_return_val_if_fail (address != NULL && origtext != NULL, NULL); g_assert (address != NULL && origtext != NULL);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
...@@ -328,7 +328,7 @@ middle_click_handle_on_history_menu_item (EphyEmbed *embed, ...@@ -328,7 +328,7 @@ middle_click_handle_on_history_menu_item (EphyEmbed *embed,
EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (embed))), EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (embed))),
embed, embed,
0); 0);
g_return_if_fail (new_embed != NULL); g_assert (new_embed != NULL);
/* Load the new URL */ /* Load the new URL */
url = webkit_back_forward_list_item_get_original_uri (item); url = webkit_back_forward_list_item_get_original_uri (item);
...@@ -383,7 +383,7 @@ build_dropdown_menu (EphyWindow *window, ...@@ -383,7 +383,7 @@ build_dropdown_menu (EphyWindow *window,
WebKitWebView *web_view; WebKitWebView *web_view;
embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window)); embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
g_return_val_if_fail (embed != NULL, NULL); g_assert (embed != NULL);
menu = GTK_MENU_SHELL (gtk_menu_new ()); menu = GTK_MENU_SHELL (gtk_menu_new ());
...@@ -877,7 +877,7 @@ ephy_header_bar_class_init (EphyHeaderBarClass *klass) ...@@ -877,7 +877,7 @@ ephy_header_bar_class_init (EphyHeaderBarClass *klass)
GtkWidget * GtkWidget *
ephy_header_bar_new (EphyWindow *window) ephy_header_bar_new (EphyWindow *window)
{ {
g_return_val_if_fail (EPHY_IS_WINDOW (window), NULL); g_assert (EPHY_IS_WINDOW (window));
return GTK_WIDGET (g_object_new (EPHY_TYPE_HEADER_BAR, return GTK_WIDGET (g_object_new (EPHY_TYPE_HEADER_BAR,
"show-close-button", TRUE, "show-close-button", TRUE,
......
...@@ -475,7 +475,7 @@ on_treeview_row_activated (GtkTreeView *view, ...@@ -475,7 +475,7 @@ on_treeview_row_activated (GtkTreeView *view,
window = EPHY_WINDOW (get_target_window (self)); window = EPHY_WINDOW (get_target_window (self));
url = get_url_from_path (gtk_tree_view_get_model (view), url = get_url_from_path (gtk_tree_view_get_model (view),
path); path);
g_return_if_fail (url != NULL); g_assert (url != NULL);
embed = ephy_shell_new_tab (ephy_shell_get_default (), embed = ephy_shell_new_tab (ephy_shell_get_default (),
window, NULL, EPHY_NEW_TAB_JUMP); window, NULL, EPHY_NEW_TAB_JUMP);
...@@ -741,7 +741,7 @@ ephy_history_dialog_new (EphyHistoryService *history_service) ...@@ -741,7 +741,7 @@ ephy_history_dialog_new (EphyHistoryService *history_service)
{ {
EphyHistoryDialog *self; EphyHistoryDialog *self;
g_return_val_if_fail (history_service != NULL, NULL); g_assert (history_service != NULL);
self = g_object_new (EPHY_TYPE_HISTORY_DIALOG, self = g_object_new (EPHY_TYPE_HISTORY_DIALOG,
"use-header-bar", TRUE, "use-header-bar", TRUE,
......
...@@ -489,7 +489,7 @@ ephy_location_controller_finalize (GObject *object) ...@@ -489,7 +489,7 @@ ephy_location_controller_finalize (GObject *object)
const char * const char *
ephy_location_controller_get_address (EphyLocationController *controller) ephy_location_controller_get_address (EphyLocationController *controller)
{ {
g_return_val_if_fail (EPHY_IS_LOCATION_CONTROLLER (controller), ""); g_assert (EPHY_IS_LOCATION_CONTROLLER (controller));
return controller->address; return controller->address;
} }
...@@ -505,7 +505,7 @@ void ...@@ -505,7 +505,7 @@ void
ephy_location_controller_set_address (EphyLocationController *controller, ephy_location_controller_set_address (EphyLocationController *controller,
const char *address) const char *address)
{ {
g_return_if_fail (EPHY_IS_LOCATION_CONTROLLER (controller)); g_assert (EPHY_IS_LOCATION_CONTROLLER (controller));
LOG ("set_address %s", address); LOG ("set_address %s", address);
......
...@@ -187,7 +187,7 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y) ...@@ -187,7 +187,7 @@ find_tab_num_at_pos (EphyNotebook *notebook, gint abs_x, gint abs_y)
gint x_root, y_root; gint x_root, y_root;
tab = gtk_notebook_get_tab_label (nb, page); tab = gtk_notebook_get_tab_label (nb, page);
g_return_val_if_fail (tab != NULL, -1); g_assert (tab != NULL);
if (!gtk_widget_get_mapped (GTK_WIDGET (tab))) { if (!gtk_widget_get_mapped (GTK_WIDGET (tab))) {
page_num++; page_num++;
...@@ -604,7 +604,7 @@ sync_load_status (EphyWebView *view, GParamSpec *pspec, GtkWidget *proxy) ...@@ -604,7 +604,7 @@ sync_load_status (EphyWebView *view, GParamSpec *pspec, GtkWidget *proxy)
spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "spinner")); spinner = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "spinner"));
icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "icon")); icon = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "icon"));
g_return_if_fail (spinner != NULL && icon != NULL); g_assert (spinner != NULL && icon != NULL);
embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (view); embed = EPHY_GET_EMBED_FROM_EPHY_WEB_VIEW (view);
if (ephy_web_view_is_loading (view) && !ephy_embed_has_load_pending (embed)) { if (ephy_web_view_is_loading (view) && !ephy_embed_has_load_pending (embed)) {
...@@ -852,7 +852,7 @@ ephy_notebook_add_tab (EphyNotebook *notebook, ...@@ -852,7 +852,7 @@ ephy_notebook_add_tab (EphyNotebook *notebook,
{ {
GtkNotebook *gnotebook = GTK_NOTEBOOK (notebook); GtkNotebook *gnotebook = GTK_NOTEBOOK (notebook);
g_return_val_if_fail (EPHY_IS_NOTEBOOK (notebook), -1); g_assert (EPHY_IS_NOTEBOOK (notebook));
position = gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), position = gtk_notebook_insert_page (GTK_NOTEBOOK (notebook),
GTK_WIDGET (embed), GTK_WIDGET (embed),
...@@ -992,7 +992,7 @@ ephy_notebook_next_page (EphyNotebook *notebook) ...@@ -992,7 +992,7 @@ ephy_notebook_next_page (EphyNotebook *notebook)
{ {
gint current_page, n_pages; gint current_page, n_pages;
g_return_if_fail (EPHY_IS_NOTEBOOK (notebook)); g_assert (EPHY_IS_NOTEBOOK (notebook));
current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook)); current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)); n_pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
...@@ -1024,7 +1024,7 @@ ephy_notebook_prev_page (EphyNotebook *notebook) ...@@ -1024,7 +1024,7 @@ ephy_notebook_prev_page (EphyNotebook *notebook)
{ {
gint current_page; gint current_page;
g_return_if_fail (EPHY_IS_NOTEBOOK (notebook)); g_assert (EPHY_IS_NOTEBOOK (notebook));
current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));