Commit b5023c72 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Share target list for all instances (#357573)

2006-10-18  Alexander Larsson  <alexl@redhat.com>

	* src/file-manager/fm-list-view.c:
	Share target list for all instances (#357573)

	* src/nautilus-location-bar.c: (style_set_handler):
	Don't leak layout (#352693)

	* src/nautilus-zoom-control.c:
	Fix O(n^2) use of list (#357589)

	All patches from paolo borelli.
parent 3545f9b0
2006-10-18 Alexander Larsson <alexl@redhat.com>
* src/file-manager/fm-list-view.c:
Share target list for all instances (#357573)
* src/nautilus-location-bar.c: (style_set_handler):
Don't leak layout (#352693)
* src/nautilus-zoom-control.c:
Fix O(n^2) use of list (#357589)
All patches from paolo borelli.
2006-10-18 Alexander Larsson <alexl@redhat.com>
* src/Makefile.am:
......
......@@ -86,8 +86,6 @@ struct FMListViewDetails {
NautilusTreeViewDragDest *drag_dest;
GtkTargetList *source_target_list;
GtkTreePath *double_click_path[2]; /* Both clicks in a double click need to be on the same row */
GtkTreePath *new_selection_path; /* Path of the new selection after removing a file */
......@@ -142,6 +140,8 @@ static GList * default_visible_columns_auto_value;
static GList * default_column_order_auto_value;
static GdkCursor * hand_cursor = NULL;
static GtkTargetList * source_target_list = NULL;
static GList *fm_list_view_get_selection (FMDirectoryView *view);
static GList *fm_list_view_get_selection_for_file_transfer (FMDirectoryView *view);
static void fm_list_view_set_zoom_level (FMListView *view,
......@@ -487,6 +487,17 @@ motion_notify_callback (GtkWidget *widget,
}
if (view->details->drag_button != 0) {
if (!source_target_list) {
const GtkTargetEntry *drag_types;
int n_drag_types;
fm_list_model_get_drag_types (&drag_types,
&n_drag_types);
source_target_list = gtk_target_list_new (drag_types,
n_drag_types);
}
if (gtk_drag_check_threshold (widget,
view->details->drag_x,
view->details->drag_y,
......@@ -494,7 +505,7 @@ motion_notify_callback (GtkWidget *widget,
event->y)) {
context = gtk_drag_begin
(widget,
view->details->source_target_list,
source_target_list,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK | GDK_ACTION_ASK,
view->details->drag_button,
(GdkEvent*)event);
......@@ -1188,10 +1199,8 @@ create_and_set_up_tree_view (FMListView *view)
{
GtkCellRenderer *cell;
GtkTreeViewColumn *column;
const GtkTargetEntry *drag_types;
GtkBindingSet *binding_set;
AtkObject *atk_obj;
int num_drag_types;
GList *nautilus_columns;
GList *l;
......@@ -1206,8 +1215,6 @@ create_and_set_up_tree_view (FMListView *view)
binding_set = gtk_binding_set_by_class (GTK_WIDGET_GET_CLASS (view->details->tree_view));
gtk_binding_entry_clear (binding_set, GDK_BackSpace, 0);
fm_list_model_get_drag_types (&drag_types, &num_drag_types);
view->details->drag_dest =
nautilus_tree_view_drag_dest_new (view->details->tree_view);
......@@ -1271,10 +1278,6 @@ create_and_set_up_tree_view (FMListView *view)
g_signal_connect_object (view->details->model, "subdirectory_unloaded",
G_CALLBACK (subdirectory_unloaded_callback), view, 0);
view->details->source_target_list =
gtk_target_list_new (drag_types, num_drag_types);
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (view->details->tree_view), GTK_SELECTION_MULTIPLE);
gtk_tree_view_set_rules_hint (view->details->tree_view, TRUE);
......@@ -2461,8 +2464,6 @@ fm_list_view_finalize (GObject *object)
if (list_view->details->new_selection_path) {
gtk_tree_path_free (list_view->details->new_selection_path);
}
gtk_target_list_unref (list_view->details->source_target_list);
g_list_free (list_view->details->cells);
g_hash_table_destroy (list_view->details->columns);
......
......@@ -250,6 +250,8 @@ style_set_handler (GtkWidget *widget, GtkStyle *previous_style)
width += 2 * GTK_MISC (widget)->xpad;
gtk_widget_set_size_request (widget, width, -1);
g_object_unref (layout);
}
static gboolean
......
......@@ -210,8 +210,8 @@ nautilus_zoom_control_instance_init (NautilusZoomControl *zoom_control)
zoom_control->details->has_min_zoom_level = TRUE;
zoom_control->details->has_max_zoom_level = TRUE;
for (i = NAUTILUS_ZOOM_LEVEL_SMALLEST; i <= NAUTILUS_ZOOM_LEVEL_LARGEST; i++) {
zoom_control->details->preferred_zoom_levels = g_list_append (
for (i = NAUTILUS_ZOOM_LEVEL_LARGEST; i >= NAUTILUS_ZOOM_LEVEL_SMALLEST; i--) {
zoom_control->details->preferred_zoom_levels = g_list_prepend (
zoom_control->details->preferred_zoom_levels,
GINT_TO_POINTER (i));
}
......
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