Commit c039b035 authored by Cosimo Cecchi's avatar Cosimo Cecchi

all: fix some issues highlighted by static analysis

Thanks to Jasper for the clang scanner tricks.
parent cc479264
......@@ -2802,13 +2802,13 @@ verify_destination (CommonJob *job,
primary = f (_("Error while copying to \"%B\"."), dest);
secondary = f (_("The destination is not a folder."));
response = run_error (job,
primary,
secondary,
NULL,
FALSE,
GTK_STOCK_CANCEL,
NULL);
run_error (job,
primary,
secondary,
NULL,
FALSE,
GTK_STOCK_CANCEL,
NULL);
abort_job (job);
return;
......@@ -2866,13 +2866,13 @@ verify_destination (CommonJob *job,
primary = f (_("Error while copying to \"%B\"."), dest);
secondary = f (_("The destination is read-only."));
response = run_error (job,
primary,
secondary,
NULL,
FALSE,
GTK_STOCK_CANCEL,
NULL);
run_error (job,
primary,
secondary,
NULL,
FALSE,
GTK_STOCK_CANCEL,
NULL);
g_error_free (error);
......@@ -5351,7 +5351,7 @@ link_file (CopyMoveJob *job,
}
/* Other error */
else {
else if (error != NULL) {
if (common->skip_all_error) {
goto out;
}
......
......@@ -1177,8 +1177,6 @@ nautilus_file_get_start_stop_type (NautilusFile *file)
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
ret = G_DRIVE_START_STOP_TYPE_UNKNOWN;
ret = file->details->start_stop_type;
if (ret != G_DRIVE_START_STOP_TYPE_UNKNOWN)
goto out;
......@@ -2710,7 +2708,6 @@ get_time (NautilusFile *file,
return UNKNOWN;
}
time = 0;
switch (type) {
case NAUTILUS_DATE_TYPE_MODIFIED:
time = file->details->mtime;
......
......@@ -1318,8 +1318,6 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
&bounds.x1, &bounds.y1);
icon_bounds = nautilus_icon_canvas_item_get_icon_rectangle (icon->item);
text_bounds = nautilus_icon_canvas_item_get_text_rectangle (icon->item, TRUE);
icon_width = ceil ((bounds.x1 - bounds.x0)/grid_width) * grid_width;
/* Calculate size above/below baseline */
......@@ -1386,9 +1384,6 @@ lay_down_icons_horizontal (NautilusIconContainer *container,
}
lay_down_one_line (container, line_start, NULL, y, max_height_above, positions, TRUE);
/* Advance to next line. */
y += max_height_below + ICON_PAD_BOTTOM;
}
g_array_free (positions, TRUE);
......
......@@ -587,8 +587,6 @@ nautilus_icon_container_selection_items_local (NautilusIconContainer *container,
/* must have at least one item */
g_assert (items);
result = FALSE;
/* get the URI associated with the container */
container_uri_string = get_container_uri (container);
......
......@@ -436,16 +436,8 @@ nautilus_notebook_add_tab (NautilusNotebook *notebook,
nautilus_notebook_sync_tab_label (notebook, slot);
nautilus_notebook_sync_loading (notebook, slot);
/* FIXME gtk bug! */
/* FIXME: this should be fixed in gtk 2.12; check & remove this! */
/* The signal handler may have reordered the tabs */
position = gtk_notebook_page_num (gnotebook, GTK_WIDGET (slot));
if (jump_to)
{
if (jump_to) {
gtk_notebook_set_current_page (gnotebook, position);
}
return position;
......
......@@ -606,10 +606,8 @@ nautilus_path_bar_size_allocate (GtkWidget *widget,
if (direction == GTK_TEXT_DIR_RTL) {
child_allocation.x -= path_bar->spacing;
down_slider_offset = child_allocation.x - widget_allocation.x - path_bar->slider_width;
down_slider_offset = 0;
} else {
down_slider_offset = child_allocation.x - widget_allocation.x;
down_slider_offset = allocation->width - path_bar->slider_width;
child_allocation.x += child_allocation.width + path_bar->spacing;
}
......@@ -1741,7 +1739,6 @@ nautilus_path_bar_update_path (NautilusPathBar *path_bar,
fake_root = NULL;
result = TRUE;
first_directory = TRUE;
last_directory = FALSE;
new_buttons = NULL;
current_button_data = NULL;
......
......@@ -2033,7 +2033,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
g_assert (NAUTILUS_IS_PROPERTIES_WINDOW (window));
status = NAUTILUS_REQUEST_DONE;
file_status = NAUTILUS_REQUEST_NOT_STARTED;
total_count = window->details->total_count;
total_size = window->details->total_size;
unreadable_directory_count = FALSE;
......@@ -4115,8 +4114,7 @@ create_simple_permissions (NautilusPropertiesWindow *window, GtkGrid *page_grid)
}
append_blank_slim_row (page_grid);
group_label = attach_title_field (page_grid, _("Others"));
attach_title_field (page_grid, _("Others"));
if (has_directory) {
add_permissions_combo_box (window, page_grid,
......@@ -4161,7 +4159,8 @@ create_permission_checkboxes (NautilusPropertiesWindow *window,
gtk_grid_attach_next_to (page_grid, GTK_WIDGET (check_button_grid),
GTK_WIDGET (owner_perm_label),
GTK_POS_RIGHT, 1, 3);
/* user */
w = add_permissions_checkbox (window,
check_button_grid,
NULL,
......@@ -4178,14 +4177,15 @@ create_permission_checkboxes (NautilusPropertiesWindow *window,
owner_perm_label,
is_folder);
w = add_permissions_checkbox (window,
check_button_grid,
w,
PERMISSIONS_CHECKBOXES_EXECUTE,
UNIX_PERM_USER_EXEC,
owner_perm_label,
is_folder);
add_permissions_checkbox (window,
check_button_grid,
w,
PERMISSIONS_CHECKBOXES_EXECUTE,
UNIX_PERM_USER_EXEC,
owner_perm_label,
is_folder);
/* group */
w = add_permissions_checkbox (window,
check_button_grid,
NULL,
......@@ -4202,14 +4202,15 @@ create_permission_checkboxes (NautilusPropertiesWindow *window,
group_perm_label,
is_folder);
w = add_permissions_checkbox (window,
check_button_grid,
w,
PERMISSIONS_CHECKBOXES_EXECUTE,
UNIX_PERM_GROUP_EXEC,
group_perm_label,
is_folder);
add_permissions_checkbox (window,
check_button_grid,
w,
PERMISSIONS_CHECKBOXES_EXECUTE,
UNIX_PERM_GROUP_EXEC,
group_perm_label,
is_folder);
/* other */
w = add_permissions_checkbox (window,
check_button_grid,
NULL,
......
......@@ -810,7 +810,6 @@ type_add_rows_from_query (NautilusQueryEditor *editor,
row = nautilus_query_editor_add_row (editor,
NAUTILUS_QUERY_EDITOR_ROW_TYPE);
model = gtk_combo_box_get_model (GTK_COMBO_BOX (row->type_widget));
type_add_custom_type (row, mime_type, desc, &iter);
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (row->type_widget),
......
......@@ -2408,7 +2408,6 @@ update_undo_actions (NautilusView *view)
undo_label = undo_description = redo_label = redo_description = NULL;
is_undo = FALSE;
undo_active = FALSE;
redo_active = FALSE;
......@@ -4536,8 +4535,6 @@ reset_open_with_menu (NautilusView *view, GList *selection)
"OpenWithGroup",
&view->details->open_with_merge_id,
&view->details->open_with_action_group);
num_applications = 0;
other_applications_visible = (selection != NULL);
filter_default = (selection != NULL);
......
......@@ -1465,7 +1465,6 @@ nautilus_window_sync_zoom_widgets (NautilusWindow *window)
can_zoom_in = can_zoom && nautilus_view_can_zoom_in (view);
can_zoom_out = can_zoom && nautilus_view_can_zoom_out (view);
} else {
zoom_level = NAUTILUS_ZOOM_LEVEL_STANDARD;
supports_zooming = FALSE;
can_zoom = FALSE;
can_zoom_in = FALSE;
......@@ -1823,7 +1822,6 @@ nautilus_window_button_press_event (GtkWidget *widget,
NautilusWindow *window;
gboolean handled;
handled = FALSE;
window = NAUTILUS_WINDOW (widget);
if (mouse_extra_buttons && (event->button == mouse_back_button)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment