diff options
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 19 |
2 files changed, 26 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 21c34978b1..4f0924778d 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,12 @@ 2000-05-14 Ettore Perazzoli <ettore@helixcode.com> + * e-storage-set-view.c + (folder_compare_cb): Callback comparison function for comparing + folders based on their names. + (insert_folders): Use it to sort the folder list before using it. + +2000-05-14 Ettore Perazzoli <ettore@helixcode.com> + * e-shell.c (setup_storages): Pass the pointer to the folder type repository. (e_shell_construct): Initialize the folder type repository before diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 15d297f5ef..a858f3b626 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -206,6 +206,23 @@ get_pixmap_and_mask_for_folder (EStorageSetView *storage_set_view, #undef ICON_HEIGHT } +static int +folder_compare_cb (gconstpointer a, gconstpointer b) +{ + EFolder *folder_a; + EFolder *folder_b; + const char *name_a; + const char *name_b; + + folder_a = E_FOLDER (a); + folder_b = E_FOLDER (b); + + name_a = e_folder_get_name (folder_a); + name_b = e_folder_get_name (folder_b); + + return strcmp (name_a, name_b); +} + static void insert_folders (EStorageSetView *storage_set_view, GtkCTreeNode *parent, @@ -229,6 +246,8 @@ insert_folders (EStorageSetView *storage_set_view, if (folder_list == NULL) return; + folder_list = g_list_sort (folder_list, folder_compare_cb); + for (p = folder_list; p != NULL; p = p->next) { EFolder *folder; const char *folder_name; |