1
From cd99b28b903e0c3c69f142dd5c7977bb791d9cf1 Mon Sep 17 00:00:00 2001
2
From: Cosimo Cecchi <cosimoc@gnome.org>
3
Date: Wed, 23 Nov 2011 16:35:29 +0000
4
Subject: places-sidebar: sort the XDG dirs section for the current locale
6
The XDG dirs section should not hardcode an english ordering, but follow
9
https://bugzilla.gnome.org/show_bug.cgi?id=664464
11
Index: nautilus-3.2.1/src/nautilus-places-sidebar.c
12
===================================================================
13
--- nautilus-3.2.1.orig/src/nautilus-places-sidebar.c 2011-10-17 22:29:15.000000000 +0200
14
+++ nautilus-3.2.1/src/nautilus-places-sidebar.c 2011-12-16 12:37:27.668145046 +0100
20
PLACES_MOUNTED_VOLUME,
24
mount_uri = g_file_get_uri (root);
25
tooltip = g_file_get_parse_name (root);
27
- last_iter = add_place (sidebar, PLACES_BUILT_IN,
28
+ last_iter = add_place (sidebar, PLACES_XDG_DIR,
30
name, icon, mount_uri,
32
@@ -3075,6 +3076,50 @@
37
+places_sidebar_sort_func (GtkTreeModel *model,
38
+ GtkTreeIter *iter_a,
39
+ GtkTreeIter *iter_b,
42
+ SectionType section_type_a, section_type_b;
43
+ PlaceType place_type_a, place_type_b;
46
+ gtk_tree_model_get (model, iter_a,
47
+ PLACES_SIDEBAR_COLUMN_SECTION_TYPE, §ion_type_a,
48
+ PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type_a,
50
+ gtk_tree_model_get (model, iter_b,
51
+ PLACES_SIDEBAR_COLUMN_SECTION_TYPE, §ion_type_b,
52
+ PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type_b,
55
+ /* fall back to the default order if we're not in the
56
+ * XDG part of the computer section.
58
+ if ((section_type_a == section_type_b) &&
59
+ (section_type_a == SECTION_COMPUTER) &&
60
+ (place_type_a == place_type_b) &&
61
+ (place_type_a == PLACES_XDG_DIR)) {
62
+ gchar *name_a, *name_b;
64
+ gtk_tree_model_get (model, iter_a,
65
+ PLACES_SIDEBAR_COLUMN_NAME, &name_a,
67
+ gtk_tree_model_get (model, iter_b,
68
+ PLACES_SIDEBAR_COLUMN_NAME, &name_b,
71
+ retval = g_utf8_collate (name_a, name_b);
81
nautilus_places_sidebar_init (NautilusPlacesSidebar *sidebar)
83
@@ -3211,6 +3256,13 @@
86
gtk_tree_view_set_tooltip_column (tree_view, PLACES_SIDEBAR_COLUMN_TOOLTIP);
87
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sidebar->store),
88
+ PLACES_SIDEBAR_COLUMN_NAME,
89
+ GTK_SORT_ASCENDING);
90
+ gtk_tree_sortable_set_sort_func (GTK_TREE_SORTABLE (sidebar->store),
91
+ PLACES_SIDEBAR_COLUMN_NAME,
92
+ places_sidebar_sort_func,
95
sidebar->filter_model = nautilus_shortcuts_model_filter_new (sidebar,
96
GTK_TREE_MODEL (sidebar->store),