Skip to content
Browse files

Merge pull request #65 from jasmineaura/develop

Most of remaining deprecations, some cleanups, and a leak fix
  • Loading branch information...
2 parents 8379b1d + c598aa7 commit 3ec2cb1ade8ed91ed472091adcc592485dc49f4d @stefano-k stefano-k committed
Showing with 87 additions and 351 deletions.
  1. +1 −1 configure.in
  2. +0 −13 eel/eel-art-gtk-extensions.c
  3. +1 −21 eel/eel-canvas-rect-ellipse.c
  4. +0 −10 eel/eel-canvas.c
  5. +0 −3 libcaja-private/caja-clipboard.c
  6. +0 −6 libcaja-private/caja-desktop-icon-file.c
  7. +0 −3 libcaja-private/caja-directory-async.c
  8. +0 −2 libcaja-private/caja-directory.c
  9. +1 −1 libcaja-private/caja-dnd.c
  10. +1 −1 libcaja-private/caja-dnd.h
  11. +0 −5 libcaja-private/caja-entry.c
  12. +1 −4 libcaja-private/caja-file-conflict-dialog.c
  13. +1 −8 libcaja-private/caja-file-operations.c
  14. +1 −14 libcaja-private/caja-icon-canvas-item.c
  15. +39 −92 libcaja-private/caja-icon-container.c
  16. +6 −7 libcaja-private/caja-icon-dnd.c
  17. +0 −3 libcaja-private/caja-saved-search-file.c
  18. +0 −8 libcaja-private/caja-search-directory-file.c
  19. +0 −4 libcaja-private/caja-tree-view-drag-dest.c
  20. +0 −5 libcaja-private/caja-vfs-directory.c
  21. +0 −4 libcaja-private/caja-vfs-file.c
  22. +0 −5 src/caja-application.c
  23. +2 −22 src/caja-file-management-properties.c
  24. +0 −4 src/caja-navigation-window-slot.c
  25. +0 −14 src/caja-navigation-window.c
  26. +0 −12 src/caja-pathbar.c
  27. +5 −15 src/caja-places-sidebar.c
  28. +0 −1 src/caja-property-browser.c
  29. +0 −3 src/caja-query-editor.c
  30. +2 −20 src/caja-window-manage-views.c
  31. +0 −3 src/caja-window.c
  32. +2 −2 src/file-manager/fm-desktop-icon-view.c
  33. +4 −10 src/file-manager/fm-directory-view.c
  34. +0 −2 src/file-manager/fm-icon-view.c
  35. +1 −7 src/file-manager/fm-list-view.c
  36. +1 −3 src/file-manager/fm-properties-window.c
  37. +0 −9 src/file-manager/fm-tree-model.c
  38. +0 −4 src/file-manager/fm-tree-view.c
  39. +18 −0 src/glibcompat.h
View
2 configure.in
@@ -3,7 +3,7 @@ AC_PREREQ(2.54)
dnl ===========================================================================
m4_define(glib_minver, 2.25.12)
-m4_define(gio_minver, 2.25.0)
+m4_define(gio_minver, 2.26.0)
m4_define(mate_desktop_minver, 1.5.0)
m4_define(pango_minver, 1.1.2)
m4_define(gtk_minver, 2.24.0)
View
13 eel/eel-art-gtk-extensions.c
@@ -90,13 +90,8 @@ eel_gdk_window_get_bounds (GdkWindow *gdk_window)
gdk_window_get_position (gdk_window, &bounds.x0, &bounds.y0);
-#if GTK_CHECK_VERSION(3, 0, 0)
width = gdk_window_get_width(gdk_window);
height = gdk_window_get_height(gdk_window);
-#else
- gdk_drawable_get_size (gdk_window, &width, &height);
-#endif
-
bounds.x1 = bounds.x0 + width;
bounds.y1 = bounds.y0 + height;
@@ -128,12 +123,8 @@ eel_gdk_window_get_screen_relative_bounds (GdkWindow *gdk_window)
return eel_irect_empty;
}
-#if GTK_CHECK_VERSION(3, 0, 0)
width = gdk_window_get_width(gdk_window);
height = gdk_window_get_height(gdk_window);
-#else
- gdk_drawable_get_size(gdk_window, &width, &height);
-#endif
screen_bounds.x1 = screen_bounds.x0 + width;
screen_bounds.y1 = screen_bounds.y0 + height;
@@ -321,12 +312,8 @@ eel_gdk_window_get_dimensions (GdkWindow *gdk_window)
g_return_val_if_fail (gdk_window != NULL, eel_dimensions_empty);
-#if GTK_CHECK_VERSION(3, 0, 0)
dimensions.width = gdk_window_get_width(gdk_window);
dimensions.height = gdk_window_get_height(gdk_window);
-#else
- gdk_drawable_get_size (gdk_window, &dimensions.width, &dimensions.height);
-#endif
return dimensions;
}
View
22 eel/eel-canvas-rect-ellipse.c
@@ -530,46 +530,26 @@ eel_canvas_re_get_property (GObject *object,
static void
eel_canvas_re_update_shared (EelCanvasItem *item, double i2w_dx, double i2w_dy, int flags)
{
- EelCanvasRE *re;
-
#ifdef VERBOSE
g_print ("eel_canvas_re_update_shared\n");
#endif
- re = EEL_CANVAS_RE (item);
-
if (re_parent_class->update)
(* re_parent_class->update) (item, i2w_dx, i2w_dy, flags);
-
-#ifdef OLD_XFORM
- recalc_bounds (re);
-#endif
}
static void
eel_canvas_re_realize (EelCanvasItem *item)
{
- EelCanvasRE *re;
-
#ifdef VERBOSE
g_print ("eel_canvas_re_realize\n");
#endif
- re = EEL_CANVAS_RE (item);
-
if (re_parent_class->realize)
(* re_parent_class->realize) (item);
-
-#ifdef OLD_XFORM
- (* EEL_CANVAS_ITEM_CLASS (item->object.klass)->update) (item, NULL, NULL, 0);
-#endif
}
static void
eel_canvas_re_unrealize (EelCanvasItem *item)
{
- EelCanvasRE *re;
-
- re = EEL_CANVAS_RE (item);
-
if (re_parent_class->unrealize)
(* re_parent_class->unrealize) (item);
}
@@ -717,7 +697,7 @@ eel_canvas_rect_realize (EelCanvasItem *item)
priv = EEL_CANVAS_RECT (item)->priv;
- dpy = gdk_x11_drawable_get_xdisplay (gtk_widget_get_window (GTK_WIDGET (item->canvas)));
+ dpy = GDK_WINDOW_XDISPLAY (gtk_widget_get_window (GTK_WIDGET (item->canvas)));
priv->use_render = XRenderQueryExtension (dpy, &event_base, &error_base);
if (priv->use_render)
View
10 eel/eel-canvas.c
@@ -523,11 +523,6 @@ eel_canvas_item_set_valist (EelCanvasItem *item, const gchar *first_arg_name, va
g_object_set_valist (G_OBJECT (item), first_arg_name, args);
-#if 0
- /* I commented this out, because item implementations have to schedule update/redraw */
- eel_canvas_item_request_redraw (item);
-#endif
-
item->canvas->need_repick = TRUE;
}
@@ -1386,12 +1381,10 @@ static void
eel_canvas_group_get_property (GObject *gobject, guint param_id,
GValue *value, GParamSpec *pspec)
{
- EelCanvasItem *item;
EelCanvasGroup *group;
g_return_if_fail (EEL_IS_CANVAS_GROUP (gobject));
- item = EEL_CANVAS_ITEM (gobject);
group = EEL_CANVAS_GROUP (gobject);
switch (param_id)
@@ -2856,9 +2849,6 @@ pick_current_item (EelCanvas *canvas, GdkEvent *event)
&& !canvas->left_grabbed_item)
{
GdkEvent new_event;
- EelCanvasItem *item;
-
- item = canvas->current_item;
new_event = canvas->pick_event;
new_event.type = GDK_LEAVE_NOTIFY;
View
3 libcaja-private/caja-clipboard.c
@@ -436,10 +436,7 @@ static void
target_destroy_callback (GtkWidget *object,
gpointer callback_data)
{
- TargetCallbackData *target_data;
-
g_assert (callback_data != NULL);
- target_data = callback_data;
if (clipboard_items_are_merged_in (object))
{
View
6 libcaja-private/caja-desktop-icon-file.c
@@ -365,9 +365,6 @@ caja_desktop_icon_file_set_metadata (CajaFile *file,
const char *key,
const char *value)
{
- CajaDesktopIconFile *desktop_file;
-
- desktop_file = CAJA_DESKTOP_ICON_FILE (file);
caja_desktop_set_metadata_string (file, file->details->name, key, value);
}
@@ -376,9 +373,6 @@ caja_desktop_icon_file_set_metadata_as_list (CajaFile *file,
const char *key,
char **value)
{
- CajaDesktopIconFile *desktop_file;
-
- desktop_file = CAJA_DESKTOP_ICON_FILE (file);
caja_desktop_set_metadata_stringv (file, file->details->name, key, (const gchar **) value);
}
View
3 libcaja-private/caja-directory-async.c
@@ -3162,9 +3162,6 @@ deep_count_callback (GObject *source_object,
static void
deep_count_load (DeepCountState *state, GFile *location)
{
- CajaDirectory *directory;
-
- directory = state->directory;
state->deep_count_location = g_object_ref (location);
#ifdef DEBUG_LOAD_DIRECTORY
View
2 libcaja-private/caja-directory.c
@@ -266,9 +266,7 @@ collect_all_directories (gpointer key, gpointer value, gpointer callback_data)
{
CajaDirectory *directory;
GList **dirs;
- GFile *location;
- location = (GFile *) key;
directory = CAJA_DIRECTORY (value);
dirs = callback_data;
View
2 libcaja-private/caja-dnd.c
@@ -1040,7 +1040,7 @@ caja_drag_autoscroll_calculate_delta (GtkWidget *widget, float *x_scroll_delta,
void
caja_drag_autoscroll_start (CajaDragInfo *drag_info,
GtkWidget *widget,
- GtkFunction callback,
+ GSourceFunc callback,
gpointer user_data)
{
if (caja_drag_autoscroll_in_scroll_region (widget))
View
2 libcaja-private/caja-dnd.h
@@ -188,7 +188,7 @@ void caja_drag_autoscroll_calculate_delta (GtkWidget *widget,
float *y_scroll_delta);
void caja_drag_autoscroll_start (CajaDragInfo *drag_info,
GtkWidget *widget,
- GtkFunction callback,
+ GSourceFunc callback,
gpointer user_data);
void caja_drag_autoscroll_stop (CajaDragInfo *drag_info);
View
5 libcaja-private/caja-entry.c
@@ -66,9 +66,6 @@ static GtkEditableInterface *parent_editable_interface = NULL;
static void
caja_entry_init (CajaEntry *entry)
{
- GtkWidget *widget;
-
- widget = GTK_WIDGET (entry);
entry->details = g_new0 (CajaEntryDetails, 1);
entry->details->user_edit = TRUE;
@@ -172,10 +169,8 @@ caja_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event)
int result;
gboolean old_had, new_had;
int old_start, old_end, new_start, new_end;
- CajaEntry *entry;
GtkEditable *editable;
- entry = CAJA_ENTRY (widget);
editable = GTK_EDITABLE (widget);
old_had = gtk_editable_get_selection_bounds (editable, &old_start, &old_end);
View
5 libcaja-private/caja-file-conflict-dialog.c
@@ -100,12 +100,11 @@ file_list_ready_cb (GList *files,
CajaFileConflictDialog *fcd = user_data;
CajaFile *src, *dest, *dest_dir;
time_t src_mtime, dest_mtime;
- GtkDialog *dialog;
gboolean source_is_dir, dest_is_dir, should_show_type;
CajaFileConflictDialogDetails *details;
char *primary_text, *message, *secondary_text;
const gchar *message_extra;
- char *src_name, *dest_name, *dest_dir_name, *edit_name;
+ char *dest_name, *dest_dir_name, *edit_name;
char *label_text;
char *size, *date, *type = NULL;
GdkPixbuf *pixbuf;
@@ -113,7 +112,6 @@ file_list_ready_cb (GList *files,
GString *str;
PangoFontDescription *desc;
- dialog = GTK_DIALOG (fcd);
details = fcd->details;
details->handle = NULL;
@@ -125,7 +123,6 @@ file_list_ready_cb (GList *files,
src_mtime = caja_file_get_mtime (src);
dest_mtime = caja_file_get_mtime (dest);
- src_name = caja_file_get_display_name (src);
dest_name = caja_file_get_display_name (dest);
dest_dir_name = caja_file_get_display_name (dest_dir);
View
9 libcaja-private/caja-file-operations.c
@@ -4661,7 +4661,7 @@ move_file_prepare (CopyMoveJob *move_job,
GFile *dest, *new_dest;
GError *error;
CommonJob *job;
- gboolean overwrite, renamed;
+ gboolean overwrite;
char *primary, *secondary, *details;
int response;
GFileCopyFlags flags;
@@ -4669,7 +4669,6 @@ move_file_prepare (CopyMoveJob *move_job,
gboolean handled_invalid_filename;
overwrite = FALSE;
- renamed = FALSE;
handled_invalid_filename = *dest_fs_type != NULL;
job = (CommonJob *)move_job;
@@ -4817,7 +4816,6 @@ move_file_prepare (CopyMoveJob *move_job,
g_object_unref (dest);
dest = get_target_file_for_display_name (dest_dir,
response->new_name);
- renamed = TRUE;
conflict_response_data_free (response);
goto retry;
} else {
@@ -5341,8 +5339,6 @@ link_job (GIOSchedulerJob *io_job,
{
CopyMoveJob *job;
CommonJob *common;
- GList *copy_files;
- GArray *copy_positions;
GFile *src;
GdkPoint *point;
char *dest_fs_type;
@@ -5354,9 +5350,6 @@ link_job (GIOSchedulerJob *io_job,
common = &job->common;
common->io_job = io_job;
- copy_files = NULL;
- copy_positions = NULL;
-
dest_fs_type = NULL;
caja_progress_info_start (job->common.progress);
View
15 libcaja-private/caja-icon-canvas-item.c
@@ -1089,10 +1089,6 @@ draw_frame (CajaIconCanvasItem *item,
int width,
int height)
{
- CajaIconContainer *container;
-
- container = CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas);
-
#if GTK_CHECK_VERSION(3,0,0)
cairo_save (cr);
#else
@@ -1293,11 +1289,9 @@ measure_label_text (CajaIconCanvasItem *item)
CajaIconContainer *container;
gint editable_height, editable_height_for_layout, editable_height_for_entire_text, editable_width, editable_dx;
gint additional_height, additional_width, additional_dx;
- EelCanvasItem *canvas_item;
PangoLayout *editable_layout;
PangoLayout *additional_layout;
- gboolean have_editable, have_additional, needs_highlight;
- int max_text_width;
+ gboolean have_editable, have_additional;
/* check to see if the cached values are still valid; if so, there's
* no work necessary
@@ -1309,7 +1303,6 @@ measure_label_text (CajaIconCanvasItem *item)
}
details = item->details;
- needs_highlight = details->is_highlighted_for_selection || details->is_highlighted_for_drop;
have_editable = details->editable_text != NULL && details->editable_text[0] != '\0';
have_additional = details->additional_text != NULL && details->additional_text[0] != '\0';
@@ -1333,8 +1326,6 @@ measure_label_text (CajaIconCanvasItem *item)
return;
#endif
- canvas_item = EEL_CANVAS_ITEM (item);
-
editable_width = 0;
editable_height = 0;
editable_height_for_layout = 0;
@@ -1344,8 +1335,6 @@ measure_label_text (CajaIconCanvasItem *item)
additional_height = 0;
additional_dx = 0;
- max_text_width = floor (caja_icon_canvas_item_get_max_text_width (item));
-
container = CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas);
editable_layout = NULL;
additional_layout = NULL;
@@ -3153,7 +3142,6 @@ caja_icon_canvas_item_accessible_do_action (AtkAction *accessible, int i)
{
CajaIconCanvasItem *item;
CajaIconCanvasItemAccessibleActionContext *ctx;
- CajaIcon *icon;
CajaIconContainer *container;
g_assert (i < LAST_ACTION);
@@ -3163,7 +3151,6 @@ caja_icon_canvas_item_accessible_do_action (AtkAction *accessible, int i)
{
return FALSE;
}
- icon = item->user_data;
container = CAJA_ICON_CONTAINER (EEL_CANVAS_ITEM (item)->canvas);
switch (i)
{
View
131 libcaja-private/caja-icon-container.c
@@ -331,7 +331,7 @@ icon_set_position (CajaIcon *icon,
int container_x, container_y, container_width, container_height;
EelDRect icon_bounds;
int item_width, item_height;
- int height_above, height_below, width_left, width_right;
+ int height_above, width_left;
int min_x, max_x, min_y, max_y;
if (icon->x == x && icon->y == y)
@@ -385,9 +385,7 @@ icon_set_position (CajaIcon *icon,
/* determine icon rectangle relative to item rectangle */
height_above = icon_bounds.y0 - y1;
- height_below = y2 - icon_bounds.y1;
width_left = icon_bounds.x0 - x1;
- width_right = x2 - icon_bounds.x1;
min_x = container_left + DESKTOP_PAD_HORIZONTAL + width_left;
max_x = container_right - DESKTOP_PAD_HORIZONTAL - item_width + width_left;
@@ -610,8 +608,8 @@ caja_icon_container_scroll (CajaIconContainer *container,
old_h_value = gtk_adjustment_get_value (hadj);
old_v_value = gtk_adjustment_get_value (vadj);
- eel_gtk_adjustment_set_value (hadj, gtk_adjustment_get_value (hadj) + delta_x);
- eel_gtk_adjustment_set_value (vadj, gtk_adjustment_get_value (vadj) + delta_y);
+ gtk_adjustment_set_value (hadj, gtk_adjustment_get_value (hadj) + delta_x);
+ gtk_adjustment_set_value (vadj, gtk_adjustment_get_value (vadj) + delta_y);
/* return TRUE if we did scroll */
return gtk_adjustment_get_value (hadj) != old_h_value || gtk_adjustment_get_value (vadj) != old_v_value;
@@ -715,24 +713,20 @@ icon_get_row_and_column_bounds (CajaIconContainer *container,
item_get_canvas_bounds (EEL_CANVAS_ITEM (icon->item), bounds, safety_pad);
- for (p = container->details->icons; p != NULL; p = p->next)
- {
+ for (p = container->details->icons; p != NULL; p = p->next) {
one_icon = p->data;
- if (icon == one_icon)
- {
+ if (icon == one_icon) {
continue;
}
- if (compare_icons_horizontal (container, icon, one_icon) == 0)
- {
+ if (compare_icons_horizontal (container, icon, one_icon) == 0) {
item_get_canvas_bounds (EEL_CANVAS_ITEM (one_icon->item), &one_bounds, safety_pad);
bounds->x0 = MIN (bounds->x0, one_bounds.x0);
bounds->x1 = MAX (bounds->x1, one_bounds.x1);
}
- if (compare_icons_vertical (container, icon, one_icon) == 0)
- {
+ if (compare_icons_vertical (container, icon, one_icon) == 0) {
item_get_canvas_bounds (EEL_CANVAS_ITEM (one_icon->item), &one_bounds, safety_pad);
bounds->y0 = MIN (bounds->y0, one_bounds.y0);
bounds->y1 = MAX (bounds->y1, one_bounds.y1);
@@ -746,52 +740,40 @@ static void
reveal_icon (CajaIconContainer *container,
CajaIcon *icon)
{
- CajaIconContainerDetails *details;
GtkAllocation allocation;
GtkAdjustment *hadj, *vadj;
EelIRect bounds;
- if (!icon_is_positioned (icon))
- {
+ if (!icon_is_positioned (icon)) {
set_pending_icon_to_reveal (container, icon);
return;
}
set_pending_icon_to_reveal (container, NULL);
- details = container->details;
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
- if (caja_icon_container_is_auto_layout (container))
- {
+ if (caja_icon_container_is_auto_layout (container)) {
/* ensure that we reveal the entire row/column */
icon_get_row_and_column_bounds (container, icon, &bounds, TRUE);
- }
- else
- {
+ } else {
item_get_canvas_bounds (EEL_CANVAS_ITEM (icon->item), &bounds, TRUE);
}
- if (bounds.y0 < gtk_adjustment_get_value (vadj))
- {
- eel_gtk_adjustment_set_value (vadj, bounds.y0);
- }
- else if (bounds.y1 > gtk_adjustment_get_value (vadj) + allocation.height)
- {
- eel_gtk_adjustment_set_value
- (vadj, bounds.y1 - allocation.height);
+ if (bounds.y0 < gtk_adjustment_get_value (vadj)) {
+ gtk_adjustment_set_value (vadj, bounds.y0);
+ } else if (bounds.y1 > gtk_adjustment_get_value (vadj) + allocation.height) {
+ gtk_adjustment_set_value
+ (vadj, bounds.y1 - allocation.height);
}
- if (bounds.x0 < gtk_adjustment_get_value (hadj))
- {
- eel_gtk_adjustment_set_value (hadj, bounds.x0);
- }
- else if (bounds.x1 > gtk_adjustment_get_value (hadj) + allocation.width)
- {
- eel_gtk_adjustment_set_value
- (hadj, bounds.x1 - allocation.width);
+ if (bounds.x0 < gtk_adjustment_get_value (hadj)) {
+ gtk_adjustment_set_value (hadj, bounds.x0);
+ } else if (bounds.x1 > gtk_adjustment_get_value (hadj) + allocation.width) {
+ gtk_adjustment_set_value
+ (hadj, bounds.x1 - allocation.width);
}
}
@@ -802,8 +784,7 @@ process_pending_icon_to_reveal (CajaIconContainer *container)
pending_icon_to_reveal = get_pending_icon_to_reveal (container);
- if (pending_icon_to_reveal != NULL)
- {
+ if (pending_icon_to_reveal != NULL) {
reveal_icon (container, pending_icon_to_reveal);
}
}
@@ -827,8 +808,7 @@ keyboard_icon_reveal_timeout_callback (gpointer data)
* (see bugzilla.gnome.org 40612).
*/
if (icon == container->details->keyboard_focus
- || icon->is_selected)
- {
+ || icon->is_selected) {
reveal_icon (container, icon);
}
container->details->keyboard_icon_reveal_timer_id = 0;
@@ -843,8 +823,7 @@ unschedule_keyboard_icon_reveal (CajaIconContainer *container)
details = container->details;
- if (details->keyboard_icon_reveal_timer_id != 0)
- {
+ if (details->keyboard_icon_reveal_timer_id != 0) {
g_source_remove (details->keyboard_icon_reveal_timer_id);
}
}
@@ -1236,12 +1215,6 @@ caja_icon_container_update_scroll_region (CajaIconContainer *container)
gtk_adjustment_set_step_increment (vadj, step_increment);
gtk_adjustment_changed (vadj);
}
-
- /* Now that we have a new scroll region, clamp the
- * adjustments so we are within the valid scroll area.
- */
- eel_gtk_adjustment_clamp_value (hadj);
- eel_gtk_adjustment_clamp_value (vadj);
}
static int
@@ -1390,7 +1363,7 @@ lay_down_icons_horizontal (CajaIconContainer *container,
{
GList *p, *line_start;
CajaIcon *icon;
- double canvas_width, y, canvas_height;
+ double canvas_width, y;
GArray *positions;
IconPositions *position;
EelDRect bounds;
@@ -1418,8 +1391,6 @@ lay_down_icons_horizontal (CajaIconContainer *container,
/* Lay out icons a line at a time. */
canvas_width = CANVAS_WIDTH(container, allocation);
- canvas_height = CANVAS_HEIGHT(container, allocation);
-
max_icon_width = max_text_width = 0.0;
if (container->details->label_position == CAJA_ICON_LABEL_POSITION_BESIDE)
@@ -1619,12 +1590,11 @@ lay_down_icons_vertical (CajaIconContainer *container,
{
GList *p, *line_start;
CajaIcon *icon;
- double canvas_width, x, canvas_height;
+ double x, canvas_height;
GArray *positions;
IconPositions *position;
EelDRect icon_bounds;
EelDRect text_bounds;
- EelCanvasItem *item;
GtkAllocation allocation;
double line_height;
@@ -1654,7 +1624,6 @@ lay_down_icons_vertical (CajaIconContainer *container,
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
/* Lay out icons a column at a time. */
- canvas_width = CANVAS_WIDTH(container, allocation);
canvas_height = CANVAS_HEIGHT(container, allocation);
max_icon_width = max_text_width = 0.0;
@@ -1682,7 +1651,6 @@ lay_down_icons_vertical (CajaIconContainer *container,
for (p = icons; p != NULL; p = p->next)
{
icon = p->data;
- item = EEL_CANVAS_ITEM (icon->item);
/* If this icon doesn't fit, it's time to lay out the column that's queued up. */
@@ -2154,14 +2122,13 @@ lay_down_icons_vertical_desktop (CajaIconContainer *container, GList *icons)
GList *p, *placed_icons, *unplaced_icons;
int total, new_length, placed;
CajaIcon *icon;
- int width, height, max_width, column_width, icon_width, icon_height;
+ int height, max_width, column_width, icon_width, icon_height;
int x, y, x1, x2, y1, y2;
EelDRect icon_rect;
GtkAllocation allocation;
/* Get container dimensions */
gtk_widget_get_allocation (GTK_WIDGET (container), &allocation);
- width = CANVAS_WIDTH(container, allocation);
height = CANVAS_HEIGHT(container, allocation);
/* Determine which icons have and have not been placed */
@@ -4987,7 +4954,7 @@ continue_stretching (CajaIconContainer *container,
if (container->details->stretch_idle_id == 0)
{
- container->details->stretch_idle_id = g_idle_add ((GtkFunction) update_stretch_at_idle, container);
+ container->details->stretch_idle_id = g_idle_add ((GSourceFunc) update_stretch_at_idle, container);
}
}
@@ -5550,7 +5517,6 @@ caja_icon_container_search_move (GtkWidget *window,
{
gboolean ret;
gint len;
- gint count = 0;
const gchar *text;
text = gtk_entry_get_text (GTK_ENTRY (container->details->search_entry));
@@ -5588,7 +5554,6 @@ caja_icon_container_search_move (GtkWidget *window,
else
{
/* return to old iter */
- count = 0;
caja_icon_container_search_iter (container, text,
container->details->selected_iter);
}
@@ -5734,9 +5699,7 @@ caja_icon_container_search_init (GtkWidget *entry,
static void
caja_icon_container_ensure_interactive_directory (CajaIconContainer *container)
{
- GtkWidget *frame, *vbox, *toplevel;
-
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (container));
+ GtkWidget *frame, *vbox;
if (container->details->search_window != NULL)
{
@@ -7089,11 +7052,9 @@ item_event_callback (EelCanvasItem *item,
gpointer data)
{
CajaIconContainer *container;
- CajaIconContainerDetails *details;
CajaIcon *icon;
container = CAJA_ICON_CONTAINER (data);
- details = container->details;
icon = CAJA_ICON_CANVAS_ITEM (item)->user_data;
g_assert (icon != NULL);
@@ -7275,7 +7236,6 @@ caja_icon_container_scroll_to_icon (CajaIconContainer *container,
GList *l;
CajaIcon *icon;
GtkAdjustment *hadj, *vadj;
- EelCanvasItem *item;
EelIRect bounds;
GtkAllocation allocation;
@@ -7288,40 +7248,27 @@ caja_icon_container_scroll_to_icon (CajaIconContainer *container,
caja_icon_container_layout_now (container);
l = container->details->icons;
- while (l != NULL)
- {
+ while (l != NULL) {
icon = l->data;
if (icon->data == data &&
- icon_is_positioned (icon))
- {
+ icon_is_positioned (icon)) {
- item = EEL_CANVAS_ITEM (icon->item);
-
- if (caja_icon_container_is_auto_layout (container))
- {
+ if (caja_icon_container_is_auto_layout (container)) {
/* ensure that we reveal the entire row/column */
icon_get_row_and_column_bounds (container, icon, &bounds, TRUE);
- }
- else
- {
+ } else {
item_get_canvas_bounds (EEL_CANVAS_ITEM (icon->item), &bounds, TRUE);
}
- if (caja_icon_container_is_layout_vertical (container))
- {
- if (caja_icon_container_is_layout_rtl (container))
- {
- eel_gtk_adjustment_set_value (hadj, bounds.x1 - allocation.width);
+ if (caja_icon_container_is_layout_vertical (container)) {
+ if (caja_icon_container_is_layout_rtl (container)) {
+ gtk_adjustment_set_value (hadj, bounds.x1 - allocation.width);
+ } else {
+ gtk_adjustment_set_value (hadj, bounds.x0);
}
- else
- {
- eel_gtk_adjustment_set_value (hadj, bounds.x0);
- }
- }
- else
- {
- eel_gtk_adjustment_set_value (vadj, bounds.y0);
+ } else {
+ gtk_adjustment_set_value (vadj, bounds.y0);
}
}
View
13 libcaja-private/caja-icon-dnd.c
@@ -456,7 +456,7 @@ set_direct_save_uri (GtkWidget *widget, GdkDragContext *context, CajaDragInfo *d
g_object_unref (child);
/* Change the uri property */
- gdk_property_change (GDK_DRAWABLE (gdk_drag_context_get_source_window (context)),
+ gdk_property_change (gdk_drag_context_get_source_window (context),
gdk_atom_intern (CAJA_ICON_DND_XDNDDIRECTSAVE_TYPE, FALSE),
gdk_atom_intern ("text/plain", FALSE), 8,
GDK_PROP_MODE_REPLACE, (const guchar *) uri,
@@ -1577,7 +1577,6 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container,
int start_y)
{
CajaIconDndInfo *dnd_info;
- GdkDragContext *context;
g_return_if_fail (CAJA_IS_ICON_CONTAINER (container));
g_return_if_fail (event != NULL);
@@ -1594,11 +1593,11 @@ caja_icon_dnd_begin_drag (CajaIconContainer *container,
gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container)));
/* start the drag */
- context = gtk_drag_begin (GTK_WIDGET (container),
- dnd_info->drag_info.target_list,
- actions,
- button,
- (GdkEvent *) event);
+ gtk_drag_begin (GTK_WIDGET (container),
+ dnd_info->drag_info.target_list,
+ actions,
+ button,
+ (GdkEvent *) event);
}
static gboolean
View
3 libcaja-private/caja-saved-search-file.c
@@ -32,9 +32,6 @@ G_DEFINE_TYPE(CajaSavedSearchFile, caja_saved_search_file, CAJA_TYPE_VFS_FILE)
static void
caja_saved_search_file_init (CajaSavedSearchFile *search_file)
{
- CajaFile *file;
-
- file = CAJA_FILE (search_file);
}
static void
View
8 libcaja-private/caja-search-directory-file.c
@@ -98,13 +98,10 @@ search_directory_file_get_item_count (CajaFile *file,
guint *count,
gboolean *count_unreadable)
{
- CajaSearchDirectory *search_dir;
GList *file_list;
if (count)
{
- search_dir = CAJA_SEARCH_DIRECTORY (file->details->directory);
-
file_list = caja_directory_get_file_list (file->details->directory);
*count = g_list_length (file_list);
@@ -122,14 +119,11 @@ search_directory_file_get_deep_counts (CajaFile *file,
guint *unreadable_directory_count,
goffset *total_size)
{
- CajaSearchDirectory *search_dir;
CajaFile *dir_file;
GList *file_list, *l;
guint dirs, files;
GFileType type;
- search_dir = CAJA_SEARCH_DIRECTORY (file->details->directory);
-
file_list = caja_directory_get_file_list (file->details->directory);
dirs = files = 0;
@@ -241,10 +235,8 @@ caja_search_directory_file_init (CajaSearchDirectoryFile *search_file)
static void
caja_search_directory_file_class_init (CajaSearchDirectoryFileClass *klass)
{
- GObjectClass *object_class;
CajaFileClass *file_class;
- object_class = G_OBJECT_CLASS (klass);
file_class = CAJA_FILE_CLASS (klass);
file_class->default_file_type = G_FILE_TYPE_DIRECTORY;
View
4 libcaja-private/caja-tree-view-drag-dest.c
@@ -203,12 +203,8 @@ highlight_expose (GtkWidget *widget,
/* FIXMEchpe: is bin window right here??? */
bin_window = gtk_tree_view_get_bin_window (GTK_TREE_VIEW (widget));
-#if GTK_CHECK_VERSION(3, 0, 0)
width = gdk_window_get_width(bin_window);
height = gdk_window_get_height(bin_window);
-#else
- gdk_drawable_get_size(bin_window, &width, &height);
-#endif
gtk_paint_focus (gtk_widget_get_style (widget),
#if GTK_CHECK_VERSION(3,0,0)
View
5 libcaja-private/caja-vfs-directory.c
@@ -41,9 +41,6 @@ EEL_CLASS_BOILERPLATE (CajaVFSDirectory,
static void
caja_vfs_directory_init (gpointer object, gpointer klass)
{
- CajaVFSDirectory *directory;
-
- directory = CAJA_VFS_DIRECTORY (object);
}
static gboolean
@@ -151,10 +148,8 @@ vfs_is_not_empty (CajaDirectory *directory)
static void
caja_vfs_directory_class_init (gpointer klass)
{
- GObjectClass *object_class;
CajaDirectoryClass *directory_class;
- object_class = G_OBJECT_CLASS (klass);
directory_class = CAJA_DIRECTORY_CLASS (klass);
directory_class->contains_file = vfs_contains_file;
View
4 libcaja-private/caja-vfs-file.c
@@ -748,10 +748,6 @@ vfs_file_poll_for_media (CajaFile *file)
static void
caja_vfs_file_init (gpointer object, gpointer klass)
{
- CajaVFSFile *file;
-
- file = CAJA_VFS_FILE (object);
-
}
static void
View
5 src/caja-application.c
@@ -464,12 +464,10 @@ menu_provider_items_updated_handler (CajaMenuProvider *provider, GtkWidget* pare
static void
menu_provider_init_callback (void)
{
- GList *items;
GList *providers;
GList *l;
providers = caja_module_get_extensions_for_type (CAJA_TYPE_MENU_PROVIDER);
- items = NULL;
for (l = providers; l != NULL; l = l->next)
{
@@ -784,7 +782,6 @@ open_window (CajaApplication *application,
{
GFile *location;
CajaWindow *window;
- gboolean existing;
if (uri == NULL) {
location = g_file_new_for_path (g_get_home_dir ());
@@ -792,8 +789,6 @@ open_window (CajaApplication *application,
location = g_file_new_for_uri (uri);
}
- existing = FALSE;
-
if (browser_window ||
g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_ALWAYS_USE_BROWSER)) {
window = caja_application_create_navigation_window (application,
View
24 src/caja-file-management-properties.c
@@ -726,35 +726,15 @@ bind_builder_bool (GtkBuilder *builder,
"active", G_SETTINGS_BIND_DEFAULT);
}
-static gboolean
-inverted_get_mapping (GValue *value,
- GVariant *variant,
- gpointer user_data)
-{
- g_value_set_boolean (value, !g_variant_get_boolean (variant));
- return TRUE;
-}
-
-static GVariant *
-inverted_set_mapping (const GValue *value,
- const GVariantType *expected_type,
- gpointer user_data)
-{
- return g_variant_new_boolean (!g_value_get_boolean (value));
-}
-
static void
bind_builder_bool_inverted (GtkBuilder *builder,
GSettings *settings,
const char *widget_name,
const char *prefs)
{
- g_settings_bind_with_mapping (settings, prefs,
+ g_settings_bind (settings, prefs,
gtk_builder_get_object (builder, widget_name),
- "active", G_SETTINGS_BIND_DEFAULT,
- inverted_get_mapping,
- inverted_set_mapping,
- NULL, NULL);
+ "active", G_SETTINGS_BIND_INVERT_BOOLEAN);
}
static gboolean
View
4 src/caja-navigation-window-slot.c
@@ -133,11 +133,9 @@ caja_navigation_window_slot_update_query_editor (CajaWindowSlot *slot)
CajaDirectory *directory;
CajaSearchDirectory *search_directory;
CajaQuery *query;
- CajaNavigationWindow *navigation_window;
GtkWidget *query_editor;
g_assert (slot->pane->window != NULL);
- navigation_window = CAJA_NAVIGATION_WINDOW (slot->pane->window);
query_editor = NULL;
@@ -192,11 +190,9 @@ static void
caja_navigation_window_slot_active (CajaWindowSlot *slot)
{
CajaNavigationWindow *window;
- CajaNavigationWindowSlot *navigation_slot;
CajaNavigationWindowPane *pane;
int page_num;
- navigation_slot = CAJA_NAVIGATION_WINDOW_SLOT (slot);
pane = CAJA_NAVIGATION_WINDOW_PANE (slot->pane);
window = CAJA_NAVIGATION_WINDOW (slot->pane->window);
View
14 src/caja-navigation-window.c
@@ -509,16 +509,6 @@ caja_navigation_window_tear_down_sidebar (CajaNavigationWindow *window)
window->sidebar = NULL;
}
-static void
-caja_navigation_window_unrealize (GtkWidget *widget)
-{
- CajaNavigationWindow *window;
-
- window = CAJA_NAVIGATION_WINDOW (widget);
-
- GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
-}
-
static gboolean
caja_navigation_window_state_event (GtkWidget *widget,
GdkEventWindowState *event)
@@ -759,14 +749,11 @@ static void
real_sync_title (CajaWindow *window,
CajaWindowSlot *slot)
{
- CajaNavigationWindow *navigation_window;
CajaNavigationWindowPane *pane;
CajaNotebook *notebook;
char *full_title;
char *window_title;
- navigation_window = CAJA_NAVIGATION_WINDOW (window);
-
EEL_CALL_PARENT (CAJA_WINDOW_CLASS,
sync_title, (window, slot));
@@ -1265,7 +1252,6 @@ caja_navigation_window_class_init (CajaNavigationWindowClass *class)
GTK_OBJECT_CLASS (class)->destroy = caja_navigation_window_destroy;
#endif
GTK_WIDGET_CLASS (class)->show = caja_navigation_window_show;
- GTK_WIDGET_CLASS (class)->unrealize = caja_navigation_window_unrealize;
GTK_WIDGET_CLASS (class)->window_state_event = caja_navigation_window_state_event;
GTK_WIDGET_CLASS (class)->key_press_event = caja_navigation_window_key_press_event;
GTK_WIDGET_CLASS (class)->button_press_event = caja_navigation_window_button_press_event;
View
12 src/caja-pathbar.c
@@ -1403,7 +1403,6 @@ button_clicked_cb (GtkWidget *button,
ButtonData *button_data;
CajaPathBar *path_bar;
GList *button_list;
- gboolean child_is_hidden;
button_data = BUTTON_DATA (data);
if (button_data->ignore_changes)
@@ -1418,17 +1417,6 @@ button_clicked_cb (GtkWidget *button,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
- if (button_list->prev)
- {
- ButtonData *child_data;
-
- child_data = BUTTON_DATA (button_list->prev->data);
- child_is_hidden = child_data->file_is_hidden;
- }
- else
- {
- child_is_hidden = FALSE;
- }
g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0, button_data->path);
}
View
20 src/caja-places-sidebar.c
@@ -53,7 +53,7 @@
#include "caja-places-sidebar.h"
#include "caja-window.h"
-#include "glibcompat.h" /* for g_list_free_full */
+#include "glibcompat.h" /* for g_list_free_full and g_clear_object */
#define EJECT_BUTTON_XPAD 6
#define ICON_CELL_XPAD 6
@@ -3332,20 +3332,10 @@ caja_places_sidebar_dispose (GObject *object)
sidebar->eject_highlight_path = NULL;
}
- if (sidebar->store != NULL) {
- g_object_unref (sidebar->store);
- sidebar->store = NULL;
- }
-
- if (sidebar->volume_monitor != NULL) {
- g_object_unref (sidebar->volume_monitor);
- sidebar->volume_monitor = NULL;
- }
-
- if (sidebar->bookmarks != NULL) {
- g_object_unref (sidebar->bookmarks);
- sidebar->bookmarks = NULL;
- }
+ g_clear_object (&sidebar->store);
+ g_clear_object (&sidebar->volume_monitor);
+ g_clear_object (&sidebar->bookmarks);
+ g_clear_object (&sidebar->filter_model);
eel_remove_weak_pointer (&(sidebar->go_to_after_mount_slot));
View
1 src/caja-property-browser.c
@@ -1109,7 +1109,6 @@ caja_emblem_dialog_new (CajaPropertyBrowser *property_browser)
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 2);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), table, TRUE, TRUE, 0);
gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
View
3 src/caja-query-editor.c
@@ -782,13 +782,10 @@ remove_group_types_from_list (char **group_types, GList *mime_types)
GList *l, *next;
char **group_type;
char *mime_type;
- gboolean found;
group_type = group_types;
while (*group_type != NULL)
{
- found = FALSE;
-
for (l = mime_types; l != NULL; l = next)
{
mime_type = l->data;
View
22 src/caja-window-manage-views.c
@@ -126,13 +126,10 @@ caja_window_report_selection_changed (CajaWindowInfo *window)
static void
set_displayed_location (CajaWindowSlot *slot, GFile *location)
{
- CajaWindow *window;
GFile *bookmark_location;
gboolean recreate;
char *name;
- window = slot->pane->window;
-
if (slot->current_location_bookmark == NULL || location == NULL)
{
recreate = TRUE;
@@ -529,14 +526,13 @@ caja_window_slot_open_location_full (CajaWindowSlot *slot,
char *old_uri, *new_uri;
int new_slot_position;
GList *l;
- gboolean target_spatial, target_navigation, target_same;
+ gboolean target_navigation, target_same;
gboolean is_desktop;
window = slot->pane->window;
target_window = NULL;
target_slot = NULL;
- target_spatial = target_navigation = target_same = FALSE;
old_uri = caja_window_slot_get_location_uri (slot);
if (old_uri == NULL)
@@ -573,11 +569,6 @@ caja_window_slot_open_location_full (CajaWindowSlot *slot,
} else {
target_same = TRUE;
}
- }
- else if (CAJA_IS_SPATIAL_WINDOW (window))
- {
- /* don't always use browser: if source is spatial, target is spatial */
- target_spatial = TRUE;
} else if (flags & CAJA_WINDOW_OPEN_FLAG_NEW_WINDOW) {
/* if it's specified to open a new window, and we're not using spatial,
* the target is a navigation.
@@ -585,9 +576,6 @@ caja_window_slot_open_location_full (CajaWindowSlot *slot,
target_navigation = TRUE;
}
break;
- case CAJA_WINDOW_OPEN_IN_SPATIAL :
- target_spatial = TRUE;
- break;
case CAJA_WINDOW_OPEN_IN_NAVIGATION :
target_navigation = TRUE;
break;
@@ -1121,14 +1109,12 @@ mount_not_mounted_callback (GObject *source_object,
gpointer user_data)
{
MountNotMountedData *data;
- CajaWindow *window;
CajaWindowSlot *slot;
GError *error;
GCancellable *cancellable;
data = user_data;
slot = data->slot;
- window = slot->pane->window;
cancellable = data->cancellable;
g_free (data);
@@ -1733,15 +1719,12 @@ found_mount_cb (GObject *source_object,
{
FindMountData *data = user_data;
GMount *mount;
- CajaWindowSlot *slot;
if (g_cancellable_is_cancelled (data->cancellable))
{
goto out;
}
- slot = data->slot;
-
mount = g_file_find_enclosing_mount_finish (G_FILE (source_object),
res,
NULL);
@@ -2080,7 +2063,6 @@ display_view_selection_failure (CajaWindow *window, CajaFile *file,
char *error_message;
char *detail_message;
char *scheme_string;
- GtkDialog *dialog;
/* Some sort of failure occurred. How 'bout we tell the user? */
full_uri_for_display = g_file_get_parse_name (location);
@@ -2179,7 +2161,7 @@ display_view_selection_failure (CajaWindow *window, CajaFile *file,
detail_message = g_strdup_printf (_("Error: %s\nPlease select another viewer and try again."), error->message);
}
- dialog = eel_show_error_dialog (error_message, detail_message, NULL);
+ eel_show_error_dialog (error_message, detail_message, NULL);
g_free (uri_for_display);
g_free (error_message);
View
3 src/caja-window.c
@@ -1395,13 +1395,10 @@ refresh_stored_viewers (CajaWindow *window)
static void
load_view_as_menu (CajaWindow *window)
{
- CajaWindowSlot *slot;
GList *node;
int index;
guint merge_id;
- slot = window->details->active_pane->active_slot;
-
if (window->details->short_list_merge_id != 0)
{
gtk_ui_manager_remove_ui (window->details->ui_manager,
View
4 src/file-manager/fm-desktop-icon-view.c
@@ -575,8 +575,8 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (icon_container));
vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (icon_container));
- eel_gtk_adjustment_set_value (hadj, 0);
- eel_gtk_adjustment_set_value (vadj, 0);
+ gtk_adjustment_set_value (hadj, 0);
+ gtk_adjustment_set_value (vadj, 0);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (desktop_icon_view),
GTK_SHADOW_NONE);
View
14 src/file-manager/fm-directory-view.c
@@ -1189,10 +1189,8 @@ select_pattern (FMDirectoryView *view)
GtkWidget *example;
GtkWidget *table;
GtkWidget *entry;
- GList *ret;
char *example_pattern;
- ret = NULL;
dialog = gtk_dialog_new_with_buttons (_("Select Items Matching"),
fm_directory_view_get_containing_window (view),
GTK_DIALOG_DESTROY_WITH_PARENT,
@@ -1318,7 +1316,6 @@ action_save_search_as_callback (GtkAction *action,
{
FMDirectoryView *directory_view;
CajaSearchDirectory *search;
- CajaQuery *query;
GtkWidget *dialog, *table, *label, *entry, *chooser, *save_button;
const char *entry_text;
char *filename, *filename_utf8, *dirname, *path, *uri;
@@ -1330,8 +1327,6 @@ action_save_search_as_callback (GtkAction *action,
CAJA_IS_SEARCH_DIRECTORY (directory_view->details->model)) {
search = CAJA_SEARCH_DIRECTORY (directory_view->details->model);
- query = caja_search_directory_get_query (search);
-
dialog = gtk_dialog_new_with_buttons (_("Save Search as"),
fm_directory_view_get_containing_window (directory_view),
0,
@@ -6834,6 +6829,7 @@ connect_to_server_response_callback (GtkDialog *dialog,
int response_id,
gpointer data)
{
+#ifdef GIO_CONVERSION_DONE
GtkEntry *entry;
char *uri;
const char *name;
@@ -6846,9 +6842,7 @@ connect_to_server_response_callback (GtkDialog *dialog,
uri = g_object_get_data (G_OBJECT (dialog), "link-uri");
icon = g_object_get_data (G_OBJECT (dialog), "link-icon");
name = gtk_entry_get_text (entry);
-#ifdef GIO_CONVERSION_DONE
mate_vfs_connect_to_server (uri, (char *)name, icon);
-#endif
gtk_widget_destroy (GTK_WIDGET (dialog));
break;
case GTK_RESPONSE_NONE:
@@ -6859,6 +6853,9 @@ connect_to_server_response_callback (GtkDialog *dialog,
default :
g_assert_not_reached ();
}
+#endif
+ /* FIXME: the above code should make a server connection permanent */
+ gtk_widget_destroy (GTK_WIDGET (dialog));
}
static void
@@ -9551,9 +9548,6 @@ metadata_for_files_in_directory_ready_callback (CajaDirectory *directory,
static void
finish_undoredo_callback (gpointer data)
{
- FMDirectoryView *view;
-
- view = FM_DIRECTORY_VIEW (data);
}
char **
View
2 src/file-manager/fm-icon-view.c
@@ -1470,12 +1470,10 @@ fm_icon_view_set_zoom_level (FMIconView *view,
static void
fm_icon_view_bump_zoom_level (FMDirectoryView *view, int zoom_increment)
{
- FMIconView *icon_view;
CajaZoomLevel new_level;
g_return_if_fail (FM_IS_ICON_VIEW (view));
- icon_view = FM_ICON_VIEW (view);
new_level = fm_icon_view_get_zoom_level (view) + zoom_increment;
if (new_level >= CAJA_ZOOM_LEVEL_SMALLEST &&
View
8 src/file-manager/fm-list-view.c
@@ -531,7 +531,6 @@ motion_notify_callback (GtkWidget *widget,
gpointer callback_data)
{
FMListView *view;
- GdkDragContext *context;
view = FM_LIST_VIEW (callback_data);
@@ -581,7 +580,7 @@ motion_notify_callback (GtkWidget *widget,
event->x,
event->y))
{
- context = gtk_drag_begin
+ gtk_drag_begin
(widget,
source_target_list,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK,
@@ -663,7 +662,6 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
GtkTreeView *tree_view;
GtkTreePath *path;
gboolean call_parent;
- gboolean allow_drag;
GtkTreeSelection *selection;
GtkWidgetClass *tree_view_class;
gint64 current_time;
@@ -715,7 +713,6 @@ button_press_callback (GtkWidget *widget, GdkEventButton *event, gpointer callba
view->details->ignore_button_release = FALSE;
call_parent = TRUE;
- allow_drag = FALSE;
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y,
&path, NULL, NULL, NULL))
{
@@ -1220,11 +1217,8 @@ sort_criterion_changes_due_to_user (GtkTreeView *tree_view)
GList *columns, *p;
GtkTreeViewColumn *column;
GSignalInvocationHint *ihint;
- unsigned int sort_signal_id;
gboolean ret;
- sort_signal_id = g_signal_lookup ("clicked", gtk_tree_view_column_get_type ());
-
ret = FALSE;
columns = gtk_tree_view_get_columns (tree_view);
View
4 src/file-manager/fm-properties-window.c
@@ -739,13 +739,11 @@ static void
rename_callback (CajaFile *file, GFile *res_loc, GError *error, gpointer callback_data)
{
FMPropertiesWindow *window;
- char *new_name;
window = FM_PROPERTIES_WINDOW (callback_data);
/* Complain to user if rename failed. */
if (error != NULL) {
- new_name = window->details->pending_name;
fm_report_error_renaming_file (file,
window->details->pending_name,
error,
@@ -5226,7 +5224,7 @@ create_properties_window (StartupData *startup_data)
CAJA_FILE_ATTRIBUTE_INFO |
CAJA_FILE_ATTRIBUTE_LINK_INFO;
- caja_file_monitor_add (CAJA_FILE (l->data),
+ caja_file_monitor_add (file,
&window->details->original_files,
attributes);
}
View
9 src/file-manager/fm-tree-model.c
@@ -753,8 +753,6 @@ report_dummy_row_contents_changed (FMTreeModel *model, TreeNode *parent)
static void
stop_monitoring_directory (FMTreeModel *model, TreeNode *node)
{
- CajaDirectory *directory;
-
if (node->done_loading_id == 0)
{
g_assert (node->files_added_id == 0);
@@ -762,8 +760,6 @@ stop_monitoring_directory (FMTreeModel *model, TreeNode *node)
return;
}
- directory = node->directory;
-
g_signal_handler_disconnect (node->directory, node->done_loading_id);
g_signal_handler_disconnect (node->directory, node->files_added_id);
g_signal_handler_disconnect (node->directory, node->files_changed_id);
@@ -1347,12 +1343,10 @@ static void
fm_tree_model_get_value (GtkTreeModel *model, GtkTreeIter *iter, int column, GValue *value)
{
TreeNode *node, *parent;
- FMTreeModel *fm_model;
g_return_if_fail (FM_IS_TREE_MODEL (model));
g_return_if_fail (iter_is_valid (FM_TREE_MODEL (model), iter));
- fm_model = FM_TREE_MODEL (model);
node = iter->user_data;
switch (column)
@@ -1482,15 +1476,12 @@ fm_tree_model_iter_has_child (GtkTreeModel *model, GtkTreeIter *iter)
static int
fm_tree_model_iter_n_children (GtkTreeModel *model, GtkTreeIter *iter)
{
- FMTreeModel *tree_model;
TreeNode *parent, *node;
int n;
g_return_val_if_fail (FM_IS_TREE_MODEL (model), FALSE);
g_return_val_if_fail (iter == NULL || iter_is_valid (FM_TREE_MODEL (model), iter), FALSE);
- tree_model = FM_TREE_MODEL (model);
-
if (iter == NULL)
{
return 1;
View
4 src/file-manager/fm-tree-view.c
@@ -617,10 +617,6 @@ static char *
get_root_uri_callback (CajaTreeViewDragDest *dest,
gpointer user_data)
{
- FMTreeView *view;
-
- view = FM_TREE_VIEW (user_data);
-
/* Don't allow drops on background */
return NULL;
}
View
18 src/glibcompat.h
@@ -38,4 +38,22 @@ g_list_free_full (GList *list, GDestroyNotify free_func)
}
#endif
+#if !GLIB_CHECK_VERSION(2,28,0)
+static inline void
+g_clear_object_inline(volatile GObject **object_ptr)
+{
+ gpointer * const ptr = (gpointer)object_ptr;
+ gpointer old;
+
+ do {
+ old = g_atomic_pointer_get(ptr);
+ } while G_UNLIKELY(!g_atomic_pointer_compare_and_exchange(ptr, old, NULL));
+
+ if (old)
+ g_object_unref(old);
+}
+#undef g_clear_object
+#define g_clear_object(obj) g_clear_object_inline((volatile GObject **)(obj))
+#endif
+
#endif /* GLIB_COMPAT_H */

0 comments on commit 3ec2cb1

Please sign in to comment.
Something went wrong with that request. Please try again.