~ubuntu-branches/ubuntu/raring/nautilus/raring

« back to all changes in this revision

Viewing changes to debian/patches/git_sideplace_sorting.patch

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Jeremy Bicha
  • Date: 2012-01-31 13:45:01 UTC
  • mfrom: (1.17.25)
  • Revision ID: package-import@ubuntu.com-20120131134501-yn7mqny7fgzx9fao
Tags: 1:3.3.4-0ubuntu1
* New upstream version which fixes:
  - "Opening Popupmenu in Context of Folder with List-View impossible?"
    (lp: #126540)
  - "'Create folder in here' context menu option for nautilus" (lp: #61786)
  - the file count and the size count change in opposite direction.
    (lp: #503330)
  - the mounts in the place menu should have a properties entry.
    (lp: #846289)
  - add command line option to select file (lp: #575719)
  - Media in 'Places' side bar should have same context menu as in 
    'Computer' (lp: #230098)
* debian/nautilus-data.install:
  - updated, ui and icons have been moved into gresources
* debian/patches/05_desktop_menu_export.patch:
   - updated to correctly include the gresources desktop definition

[ Jeremy Bicha ]
* New upstream release.
* debian/control.in:
  - Bump minimum GTK and glib
* Refreshed patches
* Dropped upstream patches:
  - 17_dont_allow_new_tab_on_desktop.patch
  - 18_fix_crash_in_get_current_uri.patch
  - 19_lazily_initialize_notification_service.patch
  - git_sideplace_sorting.patch
  - git_next_row.patch
  - git_dont_document_browser_option.patch
  - git_browser_compat.patch
  - git_bookmarks_reordering.patch
  - git_listview_context_menus.patch
  - git_use_gtk_grid.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
6
 
The XDG dirs section should not hardcode an english ordering, but follow
7
 
the current locale.
8
 
 
9
 
https://bugzilla.gnome.org/show_bug.cgi?id=664464
10
 
---
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
15
 
@@ -136,6 +136,7 @@
16
 
 
17
 
 typedef enum {
18
 
        PLACES_BUILT_IN,
19
 
+       PLACES_XDG_DIR,
20
 
        PLACES_MOUNTED_VOLUME,
21
 
        PLACES_BOOKMARK,
22
 
        PLACES_HEADING,
23
 
@@ -719,7 +720,7 @@
24
 
                mount_uri = g_file_get_uri (root);
25
 
                tooltip = g_file_get_parse_name (root);
26
 
 
27
 
-               last_iter = add_place (sidebar, PLACES_BUILT_IN,
28
 
+               last_iter = add_place (sidebar, PLACES_XDG_DIR,
29
 
                                       SECTION_COMPUTER,
30
 
                                       name, icon, mount_uri,
31
 
                                       NULL, NULL, NULL, 0,
32
 
@@ -3075,6 +3076,50 @@
33
 
        }
34
 
 }
35
 
 
36
 
+static gint
37
 
+places_sidebar_sort_func (GtkTreeModel *model,
38
 
+                         GtkTreeIter *iter_a,
39
 
+                         GtkTreeIter *iter_b,
40
 
+                         gpointer user_data)
41
 
+{
42
 
+       SectionType section_type_a, section_type_b;
43
 
+       PlaceType place_type_a, place_type_b;
44
 
+       gint retval = 0;
45
 
+
46
 
+       gtk_tree_model_get (model, iter_a,
47
 
+                           PLACES_SIDEBAR_COLUMN_SECTION_TYPE, &section_type_a,
48
 
+                           PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type_a,
49
 
+                           -1);
50
 
+       gtk_tree_model_get (model, iter_b,
51
 
+                           PLACES_SIDEBAR_COLUMN_SECTION_TYPE, &section_type_b,
52
 
+                           PLACES_SIDEBAR_COLUMN_ROW_TYPE, &place_type_b,
53
 
+                           -1);
54
 
+
55
 
+       /* fall back to the default order if we're not in the
56
 
+        * XDG part of the computer section.
57
 
+        */
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;
63
 
+
64
 
+               gtk_tree_model_get (model, iter_a,
65
 
+                                   PLACES_SIDEBAR_COLUMN_NAME, &name_a,
66
 
+                                   -1);
67
 
+               gtk_tree_model_get (model, iter_b,
68
 
+                                   PLACES_SIDEBAR_COLUMN_NAME, &name_b,
69
 
+                                   -1);
70
 
+
71
 
+               retval = g_utf8_collate (name_a, name_b);
72
 
+
73
 
+               g_free (name_a);
74
 
+               g_free (name_b);
75
 
+       }
76
 
+
77
 
+       return retval;
78
 
+}
79
 
+
80
 
 static void
81
 
 nautilus_places_sidebar_init (NautilusPlacesSidebar *sidebar)
82
 
 {
83
 
@@ -3211,6 +3256,13 @@
84
 
                                             G_TYPE_STRING);
85
 
 
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,
93
 
+                                        sidebar, NULL);
94
 
 
95
 
        sidebar->filter_model = nautilus_shortcuts_model_filter_new (sidebar,
96
 
                                                                     GTK_TREE_MODEL (sidebar->store),