mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-24 18:25:50 +00:00
Replace g_return_*() with g_assert() in private, internal functions.
2008-04-30 A. Walton <awalton@gnome.org> * libnautilus-private/nautilus-clipboard.c: * libnautilus-private/nautilus-directory-async.c: * libnautilus-private/nautilus-directory.c: * libnautilus-private/nautilus-entry.c: * libnautilus-private/nautilus-file.c: * libnautilus-private/nautilus-horizontal-splitter.c: * libnautilus-private/nautilus-icon-canvas-item.c: * libnautilus-private/nautilus-icon-container.c: * libnautilus-private/nautilus-metafile.c: * libnautilus-private/nautilus-users-groups-cache.c: * libnautilus-private/nautilus-vfs-directory.c: * src/nautilus-emblem-sidebar.c: * src/nautilus-file-management-properties.c: * src/nautilus-window-manage-views.c: * src/nautilus-window.c: * src/nautilus-zoom-control.c: Replace g_return_*() with g_assert() in private, internal functions. Closes #530321. svn path=/trunk/; revision=14114
This commit is contained in:
parent
0e85a1cae0
commit
a9b02ab3f9
21
ChangeLog
21
ChangeLog
|
@ -1,3 +1,24 @@
|
|||
2008-04-30 A. Walton <awalton@gnome.org>
|
||||
|
||||
* libnautilus-private/nautilus-clipboard.c:
|
||||
* libnautilus-private/nautilus-directory-async.c:
|
||||
* libnautilus-private/nautilus-directory.c:
|
||||
* libnautilus-private/nautilus-entry.c:
|
||||
* libnautilus-private/nautilus-file.c:
|
||||
* libnautilus-private/nautilus-horizontal-splitter.c:
|
||||
* libnautilus-private/nautilus-icon-canvas-item.c:
|
||||
* libnautilus-private/nautilus-icon-container.c:
|
||||
* libnautilus-private/nautilus-metafile.c:
|
||||
* libnautilus-private/nautilus-users-groups-cache.c:
|
||||
* libnautilus-private/nautilus-vfs-directory.c:
|
||||
* src/nautilus-emblem-sidebar.c:
|
||||
* src/nautilus-file-management-properties.c:
|
||||
* src/nautilus-window-manage-views.c:
|
||||
* src/nautilus-window.c:
|
||||
* src/nautilus-zoom-control.c:
|
||||
Replace g_return_*() with g_assert() in private, internal
|
||||
functions. Closes #530321.
|
||||
|
||||
2008-04-29 David Zeuthen <davidz@redhat.com>
|
||||
|
||||
* libnautilus-private/nautilus-autorun.c:
|
||||
|
|
|
@ -66,7 +66,7 @@ struct _TargetCallbackData {
|
|||
static void
|
||||
cut_callback (gpointer target)
|
||||
{
|
||||
g_return_if_fail (target != NULL);
|
||||
g_assert (target != NULL);
|
||||
|
||||
g_signal_emit_by_name (target, "cut-clipboard");
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ cut_callback (gpointer target)
|
|||
static void
|
||||
copy_callback (gpointer target)
|
||||
{
|
||||
g_return_if_fail (target != NULL);
|
||||
g_assert (target != NULL);
|
||||
|
||||
g_signal_emit_by_name (target, "copy-clipboard");
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ copy_callback (gpointer target)
|
|||
static void
|
||||
paste_callback (gpointer target)
|
||||
{
|
||||
g_return_if_fail (target != NULL);
|
||||
g_assert (target != NULL);
|
||||
|
||||
g_signal_emit_by_name (target, "paste-clipboard");
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ editable_select_all_callback (gpointer target)
|
|||
GtkEditable *editable;
|
||||
|
||||
editable = GTK_EDITABLE (target);
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_assert (editable != NULL);
|
||||
|
||||
gtk_editable_set_position (editable, -1);
|
||||
gtk_editable_select_region (editable, 0, -1);
|
||||
|
@ -102,7 +102,7 @@ editable_select_all_callback (gpointer target)
|
|||
static void
|
||||
text_view_select_all_callback (gpointer target)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_TEXT_VIEW (target));
|
||||
g_assert (GTK_IS_TEXT_VIEW (target));
|
||||
|
||||
g_signal_emit_by_name (target, "select-all", TRUE);
|
||||
}
|
||||
|
@ -134,10 +134,10 @@ action_select_all_callback (GtkAction *action,
|
|||
{
|
||||
TargetCallbackData *target_data;
|
||||
|
||||
g_return_if_fail (callback_data != NULL);
|
||||
g_assert (callback_data != NULL);
|
||||
|
||||
target_data = g_object_get_data (callback_data, "Nautilus:clipboard_target_data");
|
||||
g_return_if_fail (target_data != NULL);
|
||||
g_assert (target_data != NULL);
|
||||
|
||||
target_data->select_all_callback (callback_data);
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ selection_changed_callback (GtkWidget *widget,
|
|||
g_assert (target_data != NULL);
|
||||
|
||||
editable = GTK_EDITABLE (widget);
|
||||
g_return_if_fail (editable != NULL);
|
||||
g_assert (editable != NULL);
|
||||
|
||||
if (gtk_editable_get_selection_bounds (editable, &start, &end) && start != end) {
|
||||
set_clipboard_menu_items_sensitive (target_data->action_group);
|
||||
|
|
|
@ -645,8 +645,8 @@ mime_db_changed_callback (GObject *ignore, NautilusDirectory *dir)
|
|||
{
|
||||
NautilusFileAttributes attrs;
|
||||
|
||||
g_return_if_fail (dir != NULL);
|
||||
g_return_if_fail (dir->details != NULL);
|
||||
g_assert (dir != NULL);
|
||||
g_assert (dir->details != NULL);
|
||||
|
||||
attrs = NAUTILUS_FILE_ATTRIBUTE_INFO |
|
||||
NAUTILUS_FILE_ATTRIBUTE_LINK_INFO |
|
||||
|
|
|
@ -1208,7 +1208,7 @@ change_directory_location (NautilusDirectory *directory,
|
|||
* to be moved. But if that did somehow happen, this function
|
||||
* wouldn't do enough to handle it.
|
||||
*/
|
||||
g_return_if_fail (directory->details->as_file == NULL);
|
||||
g_assert (directory->details->as_file == NULL);
|
||||
|
||||
g_hash_table_remove (directories,
|
||||
directory->details->location);
|
||||
|
|
|
@ -353,7 +353,7 @@ static gboolean
|
|||
nautilus_entry_selection_clear (GtkWidget *widget,
|
||||
GdkEventSelection *event)
|
||||
{
|
||||
g_return_val_if_fail (NAUTILUS_IS_ENTRY (widget), FALSE);
|
||||
g_assert (NAUTILUS_IS_ENTRY (widget));
|
||||
|
||||
if (gdk_selection_owner_get (event->selection) == widget->window) {
|
||||
return FALSE;
|
||||
|
|
|
@ -360,9 +360,9 @@ nautilus_file_new_from_filename (NautilusDirectory *directory,
|
|||
{
|
||||
NautilusFile *file;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (filename[0] != '\0', NULL);
|
||||
g_assert (NAUTILUS_IS_DIRECTORY (directory));
|
||||
g_assert (filename != NULL);
|
||||
g_assert (filename[0] != '\0');
|
||||
|
||||
if (NAUTILUS_IS_DESKTOP_DIRECTORY (directory)) {
|
||||
if (self_owned) {
|
||||
|
@ -519,7 +519,7 @@ nautilus_file_get_internal (GFile *location, gboolean create)
|
|||
GFile *parent;
|
||||
char *basename;
|
||||
|
||||
g_return_val_if_fail (location != NULL, NULL);
|
||||
g_assert (location != NULL);
|
||||
|
||||
parent = g_file_get_parent (location);
|
||||
|
||||
|
@ -4853,7 +4853,7 @@ nautilus_file_get_octal_permissions_as_string (NautilusFile *file)
|
|||
{
|
||||
guint32 permissions;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
if (!nautilus_file_can_get_permissions (file)) {
|
||||
return NULL;
|
||||
|
@ -4885,7 +4885,7 @@ nautilus_file_get_permissions_as_string (NautilusFile *file)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
permissions = file->details->permissions;
|
||||
is_directory = nautilus_file_is_directory (file);
|
||||
|
@ -4958,7 +4958,7 @@ format_item_count_for_display (guint item_count,
|
|||
gboolean includes_directories,
|
||||
gboolean includes_files)
|
||||
{
|
||||
g_return_val_if_fail (includes_directories || includes_files, NULL);
|
||||
g_assert (includes_directories || includes_files);
|
||||
|
||||
return g_strdup_printf (includes_directories
|
||||
? (includes_files
|
||||
|
@ -4988,7 +4988,7 @@ nautilus_file_get_size_as_string (NautilusFile *file)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
if (nautilus_file_is_directory (file)) {
|
||||
if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) {
|
||||
|
@ -5028,7 +5028,7 @@ nautilus_file_get_size_as_string_with_real_size (NautilusFile *file)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
if (nautilus_file_is_directory (file)) {
|
||||
if (!nautilus_file_get_directory_item_count (file, &item_count, &count_unreadable)) {
|
||||
|
@ -5065,15 +5065,15 @@ nautilus_file_get_deep_count_as_string_internal (NautilusFile *file,
|
|||
goffset total_size;
|
||||
|
||||
/* Must ask for size or some kind of count, but not both. */
|
||||
g_return_val_if_fail (!report_size || (!report_directory_count && !report_file_count), NULL);
|
||||
g_return_val_if_fail (report_size || report_directory_count || report_file_count, NULL);
|
||||
g_assert (!report_size || (!report_directory_count && !report_file_count));
|
||||
g_assert (report_size || report_directory_count || report_file_count);
|
||||
|
||||
if (file == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
|
||||
g_return_val_if_fail (nautilus_file_is_directory (file), NULL);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
g_assert (nautilus_file_is_directory (file));
|
||||
|
||||
status = nautilus_file_get_deep_counts
|
||||
(file, &directory_count, &file_count, &unreadable_count, &total_size, FALSE);
|
||||
|
|
|
@ -68,7 +68,7 @@ nautilus_horizontal_splitter_finalize (GObject *object)
|
|||
static void
|
||||
splitter_expand (NautilusHorizontalSplitter *splitter, int position)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
|
||||
if (position >= CLOSED_THRESHOLD) {
|
||||
return;
|
||||
|
@ -85,7 +85,7 @@ splitter_expand (NautilusHorizontalSplitter *splitter, int position)
|
|||
static void
|
||||
splitter_collapse (NautilusHorizontalSplitter *splitter, int position)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
|
||||
splitter->details->saved_size = position;
|
||||
gtk_paned_set_position (GTK_PANED (splitter), 0);
|
||||
|
@ -94,7 +94,7 @@ splitter_collapse (NautilusHorizontalSplitter *splitter, int position)
|
|||
static void
|
||||
splitter_toggle (NautilusHorizontalSplitter *splitter, int position)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
g_assert (NAUTILUS_IS_HORIZONTAL_SPLITTER (splitter));
|
||||
|
||||
if (gtk_paned_get_position (GTK_PANED (splitter)) >= CLOSED_THRESHOLD) {
|
||||
nautilus_horizontal_splitter_collapse (splitter);
|
||||
|
|
|
@ -257,7 +257,7 @@ nautilus_icon_canvas_item_finalize (GObject *object)
|
|||
{
|
||||
NautilusIconCanvasItemDetails *details;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (object));
|
||||
g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (object));
|
||||
|
||||
details = NAUTILUS_ICON_CANVAS_ITEM (object)->details;
|
||||
|
||||
|
@ -757,7 +757,7 @@ get_current_canvas_bounds (EelCanvasItem *item)
|
|||
{
|
||||
EelIRect bounds;
|
||||
|
||||
g_return_val_if_fail (EEL_IS_CANVAS_ITEM (item), eel_irect_empty);
|
||||
g_assert (EEL_IS_CANVAS_ITEM (item));
|
||||
|
||||
bounds.x0 = item->x1;
|
||||
bounds.y0 = item->y1;
|
||||
|
@ -1466,12 +1466,12 @@ nautilus_icon_canvas_lighten_pixbuf (GdkPixbuf* src, guint lighten_value) {
|
|||
guchar *target_pixels, *original_pixels;
|
||||
guchar *pixsrc, *pixdest;
|
||||
|
||||
g_return_val_if_fail (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB, NULL);
|
||||
g_return_val_if_fail ((!gdk_pixbuf_get_has_alpha (src)
|
||||
g_assert (gdk_pixbuf_get_colorspace (src) == GDK_COLORSPACE_RGB);
|
||||
g_assert ((!gdk_pixbuf_get_has_alpha (src)
|
||||
&& gdk_pixbuf_get_n_channels (src) == 3)
|
||||
|| (gdk_pixbuf_get_has_alpha (src)
|
||||
&& gdk_pixbuf_get_n_channels (src) == 4), NULL);
|
||||
g_return_val_if_fail (gdk_pixbuf_get_bits_per_sample (src) == 8, NULL);
|
||||
&& gdk_pixbuf_get_n_channels (src) == 4));
|
||||
g_assert (gdk_pixbuf_get_bits_per_sample (src) == 8);
|
||||
|
||||
dest = gdk_pixbuf_new (gdk_pixbuf_get_colorspace (src),
|
||||
gdk_pixbuf_get_has_alpha (src),
|
||||
|
@ -2300,8 +2300,8 @@ get_icon_canvas_rectangle (NautilusIconCanvasItem *item,
|
|||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
|
||||
g_return_if_fail (rect != NULL);
|
||||
g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
|
||||
g_assert (rect != NULL);
|
||||
|
||||
eel_canvas_w2c (EEL_CANVAS_ITEM (item)->canvas,
|
||||
item->details->x,
|
||||
|
@ -2341,7 +2341,7 @@ hit_test_stretch_handle (NautilusIconCanvasItem *item,
|
|||
int knob_width, knob_height;
|
||||
int hit_corner;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_ICON_CANVAS_ITEM (item), FALSE);
|
||||
g_assert (NAUTILUS_IS_ICON_CANVAS_ITEM (item));
|
||||
|
||||
/* Make sure there are handles to hit. */
|
||||
if (!item->details->show_stretch_handles) {
|
||||
|
@ -2536,7 +2536,7 @@ nautilus_icon_canvas_item_accessible_do_action (AtkAction *accessible, int i)
|
|||
NautilusIcon *icon;
|
||||
NautilusIconContainer *container;
|
||||
|
||||
g_return_val_if_fail (i < LAST_ACTION, FALSE);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
item = eel_accessibility_get_gobject (ATK_OBJECT (accessible));
|
||||
if (!item) {
|
||||
|
@ -2578,7 +2578,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib
|
|||
{
|
||||
NautilusIconCanvasItemAccessiblePrivate *priv;
|
||||
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
priv = accessible_get_priv (ATK_OBJECT (accessible));
|
||||
if (priv->action_descriptions[i]) {
|
||||
|
@ -2591,7 +2591,7 @@ nautilus_icon_canvas_item_accessible_action_get_description (AtkAction *accessib
|
|||
static const char *
|
||||
nautilus_icon_canvas_item_accessible_action_get_name (AtkAction *accessible, int i)
|
||||
{
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
return nautilus_icon_canvas_item_accessible_action_names[i];
|
||||
}
|
||||
|
@ -2600,7 +2600,7 @@ static const char *
|
|||
nautilus_icon_canvas_item_accessible_action_get_keybinding (AtkAction *accessible,
|
||||
int i)
|
||||
{
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -2612,7 +2612,7 @@ nautilus_icon_canvas_item_accessible_action_set_description (AtkAction *accessib
|
|||
{
|
||||
NautilusIconCanvasItemAccessiblePrivate *priv;
|
||||
|
||||
g_return_val_if_fail (i < LAST_ACTION, FALSE);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
priv = accessible_get_priv (ATK_OBJECT (accessible));
|
||||
|
||||
|
@ -3180,7 +3180,7 @@ nautilus_icon_canvas_item_accessible_create (GObject *for_object)
|
|||
GString *item_text;
|
||||
|
||||
item = NAUTILUS_ICON_CANVAS_ITEM (for_object);
|
||||
g_return_val_if_fail (item != NULL, NULL);
|
||||
g_assert (item != NULL);
|
||||
|
||||
type = nautilus_icon_canvas_item_accessible_get_type ();
|
||||
|
||||
|
|
|
@ -954,7 +954,7 @@ sort_icons (NautilusIconContainer *container,
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->compare_icons != NULL);
|
||||
g_assert (klass->compare_icons != NULL);
|
||||
|
||||
*icons = g_list_sort_with_data (*icons, compare_icons, container);
|
||||
}
|
||||
|
@ -1501,10 +1501,10 @@ placement_grid_position_is_free (PlacementGrid *grid, EelIRect pos)
|
|||
{
|
||||
int x, y;
|
||||
|
||||
g_return_val_if_fail (pos.x0 >= 0 && pos.x0 < grid->num_columns, TRUE);
|
||||
g_return_val_if_fail (pos.y0 >= 0 && pos.y0 < grid->num_rows, TRUE);
|
||||
g_return_val_if_fail (pos.x1 >= 0 && pos.x1 < grid->num_columns, TRUE);
|
||||
g_return_val_if_fail (pos.y1 >= 0 && pos.y1 < grid->num_rows, TRUE);
|
||||
g_assert (pos.x0 >= 0 && pos.x0 < grid->num_columns);
|
||||
g_assert (pos.y0 >= 0 && pos.y0 < grid->num_rows);
|
||||
g_assert (pos.x1 >= 0 && pos.x1 < grid->num_columns);
|
||||
g_assert (pos.y1 >= 0 && pos.y1 < grid->num_rows);
|
||||
|
||||
for (x = pos.x0; x <= pos.x1; x++) {
|
||||
for (y = pos.y0; y <= pos.y1; y++) {
|
||||
|
@ -1522,10 +1522,10 @@ placement_grid_mark (PlacementGrid *grid, EelIRect pos)
|
|||
{
|
||||
int x, y;
|
||||
|
||||
g_return_if_fail (pos.x0 >= 0 && pos.x0 < grid->num_columns);
|
||||
g_return_if_fail (pos.y0 >= 0 && pos.y0 < grid->num_rows);
|
||||
g_return_if_fail (pos.x1 >= 0 && pos.x1 < grid->num_columns);
|
||||
g_return_if_fail (pos.y1 >= 0 && pos.y1 < grid->num_rows);
|
||||
g_assert (pos.x0 >= 0 && pos.x0 < grid->num_columns);
|
||||
g_assert (pos.y0 >= 0 && pos.y0 < grid->num_rows);
|
||||
g_assert (pos.x1 >= 0 && pos.x1 < grid->num_columns);
|
||||
g_assert (pos.y1 >= 0 && pos.y1 < grid->num_rows);
|
||||
|
||||
for (x = pos.x0; x <= pos.x1; x++) {
|
||||
for (y = pos.y0; y <= pos.y1; y++) {
|
||||
|
@ -4173,7 +4173,7 @@ nautilus_icon_container_search_delete_event (GtkWidget *widget,
|
|||
GdkEventAny *event,
|
||||
NautilusIconContainer *container)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||
g_assert (GTK_IS_WIDGET (widget));
|
||||
|
||||
nautilus_icon_container_search_dialog_hide (widget, container);
|
||||
|
||||
|
@ -4185,7 +4185,7 @@ nautilus_icon_container_search_button_press_event (GtkWidget *widget,
|
|||
GdkEventButton *event,
|
||||
NautilusIconContainer *container)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||
g_assert (GTK_IS_WIDGET (widget));
|
||||
|
||||
nautilus_icon_container_search_dialog_hide (widget, container);
|
||||
|
||||
|
@ -4207,8 +4207,8 @@ nautilus_icon_container_search_iter (NautilusIconContainer *container,
|
|||
char *normalized_key, *case_normalized_key;
|
||||
char *normalized_name, *case_normalized_name;
|
||||
|
||||
g_return_val_if_fail (key != NULL, FALSE);
|
||||
g_return_val_if_fail (n >= 1, FALSE);
|
||||
g_assert (key != NULL);
|
||||
g_assert (n >= 1);
|
||||
|
||||
normalized_key = g_utf8_normalize (key, -1, G_NORMALIZE_ALL);
|
||||
if (!normalized_key) {
|
||||
|
@ -4278,7 +4278,7 @@ nautilus_icon_container_search_move (GtkWidget *window,
|
|||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (container->details->search_entry));
|
||||
|
||||
g_return_if_fail (text != NULL);
|
||||
g_assert (text != NULL);
|
||||
|
||||
if (container->details->selected_iter == 0) {
|
||||
return;
|
||||
|
@ -4345,8 +4345,8 @@ nautilus_icon_container_search_key_press_event (GtkWidget *widget,
|
|||
{
|
||||
gboolean retval = FALSE;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
|
||||
g_return_val_if_fail (NAUTILUS_IS_ICON_CONTAINER (container), FALSE);
|
||||
g_assert (GTK_IS_WIDGET (widget));
|
||||
g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
|
||||
/* close window and cancel the search */
|
||||
if (event->keyval == GDK_Escape || event->keyval == GDK_Tab) {
|
||||
|
@ -4398,8 +4398,8 @@ nautilus_icon_container_search_init (GtkWidget *entry,
|
|||
gint len;
|
||||
const gchar *text;
|
||||
|
||||
g_return_if_fail (GTK_IS_ENTRY (entry));
|
||||
g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
g_assert (GTK_IS_ENTRY (entry));
|
||||
g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
|
||||
text = gtk_entry_get_text (GTK_ENTRY (entry));
|
||||
len = strlen (text);
|
||||
|
@ -5503,7 +5503,7 @@ item_event_callback (EelCanvasItem *item,
|
|||
details = container->details;
|
||||
|
||||
icon = NAUTILUS_ICON_CANVAS_ITEM (item)->user_data;
|
||||
g_return_val_if_fail (icon != NULL, FALSE);
|
||||
g_assert (icon != NULL);
|
||||
|
||||
switch (event->type) {
|
||||
case GDK_BUTTON_PRESS:
|
||||
|
@ -5790,7 +5790,7 @@ activate_selected_items_alternate (NautilusIconContainer *container,
|
|||
{
|
||||
GList *selection;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
|
||||
|
||||
if (icon != NULL) {
|
||||
selection = g_list_prepend (NULL, icon->data);
|
||||
|
@ -5836,7 +5836,7 @@ nautilus_icon_container_get_icon_images (NautilusIconContainer *container,
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_val_if_fail (klass->get_icon_images != NULL, NULL);
|
||||
g_assert (klass->get_icon_images != NULL);
|
||||
|
||||
return klass->get_icon_images (container, data, size, emblem_pixbufs, embedded_text, for_drag_accept, need_large_embeddded_text, embedded_text_needs_loading, has_open_window);
|
||||
}
|
||||
|
@ -5851,7 +5851,7 @@ nautilus_icon_container_get_icon_text (NautilusIconContainer *container,
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->get_icon_text != NULL);
|
||||
g_assert (klass->get_icon_text != NULL);
|
||||
|
||||
klass->get_icon_text (container, data, editable_text, additional_text);
|
||||
}
|
||||
|
@ -5862,7 +5862,7 @@ nautilus_icon_container_freeze_updates (NautilusIconContainer *container)
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->freeze_updates != NULL);
|
||||
g_assert (klass->freeze_updates != NULL);
|
||||
|
||||
klass->freeze_updates (container);
|
||||
}
|
||||
|
@ -5873,7 +5873,7 @@ nautilus_icon_container_unfreeze_updates (NautilusIconContainer *container)
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->unfreeze_updates != NULL);
|
||||
g_assert (klass->unfreeze_updates != NULL);
|
||||
|
||||
klass->unfreeze_updates (container);
|
||||
}
|
||||
|
@ -5887,7 +5887,7 @@ nautilus_icon_container_start_monitor_top_left (NautilusIconContainer *container
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->start_monitor_top_left != NULL);
|
||||
g_assert (klass->start_monitor_top_left != NULL);
|
||||
|
||||
klass->start_monitor_top_left (container, data, client, large_text);
|
||||
}
|
||||
|
@ -5913,7 +5913,7 @@ nautilus_icon_container_prioritize_thumbnailing (NautilusIconContainer *containe
|
|||
NautilusIconContainerClass *klass;
|
||||
|
||||
klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
|
||||
g_return_if_fail (klass->prioritize_thumbnailing != NULL);
|
||||
g_assert (klass->prioritize_thumbnailing != NULL);
|
||||
|
||||
klass->prioritize_thumbnailing (container, icon->data);
|
||||
}
|
||||
|
@ -6699,7 +6699,7 @@ get_nth_selected_icon (NautilusIconContainer *container, int index)
|
|||
NautilusIcon *icon;
|
||||
int selection_count;
|
||||
|
||||
g_return_val_if_fail (index > 0, NULL);
|
||||
g_assert (index > 0);
|
||||
|
||||
/* Find the nth selected icon. */
|
||||
selection_count = 0;
|
||||
|
@ -7933,7 +7933,7 @@ nautilus_icon_container_accessible_action_get_description (AtkAction *accessible
|
|||
{
|
||||
NautilusIconContainerAccessiblePrivate *priv;
|
||||
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
priv = accessible_get_priv (ATK_OBJECT (accessible));
|
||||
|
||||
|
@ -7947,7 +7947,7 @@ nautilus_icon_container_accessible_action_get_description (AtkAction *accessible
|
|||
static const char *
|
||||
nautilus_icon_container_accessible_action_get_name (AtkAction *accessible, int i)
|
||||
{
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
return nautilus_icon_container_accessible_action_names[i];
|
||||
}
|
||||
|
@ -7956,7 +7956,7 @@ static const char *
|
|||
nautilus_icon_container_accessible_action_get_keybinding (AtkAction *accessible,
|
||||
int i)
|
||||
{
|
||||
g_return_val_if_fail (i < LAST_ACTION, NULL);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -7968,7 +7968,7 @@ nautilus_icon_container_accessible_action_set_description (AtkAction *accessible
|
|||
{
|
||||
NautilusIconContainerAccessiblePrivate *priv;
|
||||
|
||||
g_return_val_if_fail (i < LAST_ACTION, FALSE);
|
||||
g_assert (i < LAST_ACTION);
|
||||
|
||||
priv = accessible_get_priv (ATK_OBJECT (accessible));
|
||||
|
||||
|
|
|
@ -1390,8 +1390,8 @@ metafile_get_file_uri (NautilusMetafile *metafile,
|
|||
{
|
||||
char *escaped_file_name, *uri;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_METAFILE (metafile), NULL);
|
||||
g_return_val_if_fail (file_name != NULL, NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_assert (file_name != NULL);
|
||||
|
||||
escaped_file_name = g_uri_escape_string (file_name, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, FALSE);
|
||||
|
||||
|
@ -1412,9 +1412,9 @@ rename_file_metadata (NautilusMetafile *metafile,
|
|||
char *old_file_uri, *new_file_uri;
|
||||
char *escaped;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_return_if_fail (old_file_name != NULL);
|
||||
g_return_if_fail (new_file_name != NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_assert (old_file_name != NULL);
|
||||
g_assert (new_file_name != NULL);
|
||||
|
||||
remove_file_metadata (metafile, new_file_name);
|
||||
|
||||
|
@ -1580,10 +1580,10 @@ copy_file_metadata (NautilusMetafile *source_metafile,
|
|||
char *source_file_uri;
|
||||
char *destination_file_uri;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_METAFILE (source_metafile));
|
||||
g_return_if_fail (source_file_name != NULL);
|
||||
g_return_if_fail (NAUTILUS_IS_METAFILE (destination_metafile));
|
||||
g_return_if_fail (destination_file_name != NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (source_metafile));
|
||||
g_assert (source_file_name != NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (destination_metafile));
|
||||
g_assert (destination_file_name != NULL);
|
||||
|
||||
if (source_metafile->is_read
|
||||
&& destination_metafile->is_read) {
|
||||
|
@ -1658,8 +1658,8 @@ remove_file_metadata (NautilusMetafile *metafile,
|
|||
{
|
||||
char *file_uri;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_return_if_fail (file_name != NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_assert (file_name != NULL);
|
||||
|
||||
if (nautilus_metadata_has_scheduled_copy (metafile, file_name)) {
|
||||
nautilus_metadata_schedule_removal (metafile, file_name);
|
||||
|
@ -1682,8 +1682,8 @@ set_metafile_contents (NautilusMetafile *metafile,
|
|||
xmlChar *name;
|
||||
char *unescaped_name;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_return_if_fail (metafile->xml == NULL);
|
||||
g_assert (NAUTILUS_IS_METAFILE (metafile));
|
||||
g_assert (metafile->xml == NULL);
|
||||
|
||||
if (metafile_contents == NULL) {
|
||||
return;
|
||||
|
|
|
@ -83,7 +83,7 @@ expiring_cache_new (time_t expire_time, ExpiringCacheGetValFunc get_value_func,
|
|||
{
|
||||
ExpiringCache *cache;
|
||||
|
||||
g_return_val_if_fail (get_value_func != NULL, NULL);
|
||||
g_assert (get_value_func != NULL);
|
||||
|
||||
cache = g_new (ExpiringCache, 1);
|
||||
cache->expire_time = expire_time;
|
||||
|
@ -130,7 +130,7 @@ expiring_cache_get_value (ExpiringCache *cache, guint key)
|
|||
{
|
||||
ExpiringCacheEntry *entry;
|
||||
|
||||
g_return_val_if_fail (cache != NULL, NULL);
|
||||
g_assert (cache != NULL);
|
||||
|
||||
if (!g_hash_table_lookup_extended (cache->cached_values, GSIZE_TO_POINTER (key),
|
||||
NULL, (gpointer) &entry)) {
|
||||
|
|
|
@ -51,7 +51,7 @@ vfs_contains_file (NautilusDirectory *directory,
|
|||
NautilusFile *file)
|
||||
{
|
||||
g_assert (NAUTILUS_IS_VFS_DIRECTORY (directory));
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
|
||||
g_assert (NAUTILUS_IS_FILE (file));
|
||||
|
||||
return file->details->directory == directory;
|
||||
}
|
||||
|
@ -144,8 +144,8 @@ vfs_are_all_files_seen (NautilusDirectory *directory)
|
|||
static gboolean
|
||||
vfs_is_not_empty (NautilusDirectory *directory)
|
||||
{
|
||||
g_return_val_if_fail (NAUTILUS_IS_VFS_DIRECTORY (directory), FALSE);
|
||||
g_return_val_if_fail (nautilus_directory_is_anyone_monitoring_file_list (directory), FALSE);
|
||||
g_assert (NAUTILUS_IS_VFS_DIRECTORY (directory));
|
||||
g_assert (nautilus_directory_is_anyone_monitoring_file_list (directory));
|
||||
|
||||
return directory->details->file_list != NULL;
|
||||
}
|
||||
|
|
|
@ -1008,7 +1008,7 @@ nautilus_emblem_sidebar_finalize (GObject *object)
|
|||
{
|
||||
NautilusEmblemSidebar *emblem_sidebar;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_EMBLEM_SIDEBAR (object));
|
||||
g_assert (NAUTILUS_IS_EMBLEM_SIDEBAR (object));
|
||||
emblem_sidebar = NAUTILUS_EMBLEM_SIDEBAR (object);
|
||||
|
||||
if (emblem_sidebar->details != NULL) {
|
||||
|
|
|
@ -191,8 +191,8 @@ preferences_show_help (GtkWindow *parent,
|
|||
GError *error = NULL;
|
||||
GtkWidget *dialog;
|
||||
|
||||
g_return_if_fail (helpfile != NULL);
|
||||
g_return_if_fail (sect_id != NULL);
|
||||
g_assert (helpfile != NULL);
|
||||
g_assert (sect_id != NULL);
|
||||
|
||||
gnome_help_display_desktop (NULL,
|
||||
"user-guide",
|
||||
|
|
|
@ -185,7 +185,7 @@ handle_go_back (NautilusNavigationWindow *window, GFile *location)
|
|||
GList *link;
|
||||
NautilusBookmark *bookmark;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_NAVIGATION_WINDOW (window));
|
||||
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
|
||||
|
||||
/* Going back. Move items from the back list to the forward list. */
|
||||
g_assert (g_list_length (window->back_list) > NAUTILUS_WINDOW (window)->details->location_change_distance);
|
||||
|
@ -224,7 +224,7 @@ handle_go_forward (NautilusNavigationWindow *window, GFile *location)
|
|||
GList *link;
|
||||
NautilusBookmark *bookmark;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_NAVIGATION_WINDOW (window));
|
||||
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
|
||||
|
||||
/* Going forward. Move items from the forward list to the back list. */
|
||||
g_assert (g_list_length (window->forward_list) > NAUTILUS_WINDOW (window)->details->location_change_distance);
|
||||
|
|
|
@ -286,7 +286,7 @@ real_set_allow_up (NautilusWindow *window,
|
|||
{
|
||||
GtkAction *action;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
action = gtk_action_group_get_action (window->details->main_action_group,
|
||||
NAUTILUS_ACTION_UP);
|
||||
|
@ -981,7 +981,7 @@ nautilus_window_synch_view_as_menus (NautilusWindow *window)
|
|||
GList *node;
|
||||
GtkAction *action;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
if (window->content_view == NULL) {
|
||||
return;
|
||||
|
@ -1214,7 +1214,7 @@ static void
|
|||
nautilus_window_set_title (NautilusWindow *window,
|
||||
const char *title)
|
||||
{
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
EEL_CALL_METHOD (NAUTILUS_WINDOW_CLASS, window,
|
||||
set_title, (window, title));
|
||||
|
@ -1285,8 +1285,8 @@ real_set_content_view_widget (NautilusWindow *window,
|
|||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
g_return_if_fail (new_view == NULL || NAUTILUS_IS_VIEW (new_view));
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
g_assert (new_view == NULL || NAUTILUS_IS_VIEW (new_view));
|
||||
|
||||
if (new_view == window->content_view) {
|
||||
return;
|
||||
|
@ -1575,7 +1575,7 @@ nautilus_window_get_history (NautilusWindow *window)
|
|||
static NautilusWindowType
|
||||
nautilus_window_get_window_type (NautilusWindow *window)
|
||||
{
|
||||
g_return_val_if_fail (NAUTILUS_IS_WINDOW (window), NAUTILUS_WINDOW_SPATIAL);
|
||||
g_assert (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
return NAUTILUS_WINDOW_GET_CLASS (window)->window_type;
|
||||
}
|
||||
|
|
|
@ -149,10 +149,10 @@ menu_position_under_widget (GtkMenu *menu,
|
|||
GdkScreen *screen;
|
||||
|
||||
widget = GTK_WIDGET (user_data);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_assert (GTK_IS_WIDGET (widget));
|
||||
|
||||
container = gtk_widget_get_ancestor (widget, GTK_TYPE_CONTAINER);
|
||||
g_return_if_fail (container != NULL);
|
||||
g_assert (container != NULL);
|
||||
|
||||
gtk_widget_size_request (widget, &req);
|
||||
gtk_widget_size_request (GTK_WIDGET (menu), &menu_req);
|
||||
|
@ -725,7 +725,7 @@ nautilus_zoom_control_accessible_do_action (AtkAction *accessible, int i)
|
|||
{
|
||||
GtkWidget *widget;
|
||||
|
||||
g_return_val_if_fail (i >= 0 && i < NUM_ACTIONS, FALSE);
|
||||
g_assert (i >= 0 && i < NUM_ACTIONS);
|
||||
|
||||
widget = GTK_ACCESSIBLE (accessible)->widget;
|
||||
if (!widget) {
|
||||
|
@ -750,7 +750,7 @@ static G_CONST_RETURN char *
|
|||
nautilus_zoom_control_accessible_action_get_description (AtkAction *accessible,
|
||||
int i)
|
||||
{
|
||||
g_return_val_if_fail (i >= 0 && i < NUM_ACTIONS, NULL);
|
||||
g_assert (i >= 0 && i < NUM_ACTIONS);
|
||||
|
||||
return _(nautilus_zoom_control_accessible_action_descriptions[i]);
|
||||
}
|
||||
|
@ -759,7 +759,7 @@ static G_CONST_RETURN char *
|
|||
nautilus_zoom_control_accessible_action_get_name (AtkAction *accessible,
|
||||
int i)
|
||||
{
|
||||
g_return_val_if_fail (i >= 0 && i < NUM_ACTIONS, NULL);
|
||||
g_assert (i >= 0 && i < NUM_ACTIONS);
|
||||
|
||||
return _(nautilus_zoom_control_accessible_action_names[i]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue