aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-05-14 09:53:42 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-05-14 09:53:42 +0800
commiteab1fd11357334c4ec3454ce9efacb220deabc12 (patch)
tree31d0d5f20b3c19e90081e3058e35c39bc7f4f021
parentfe60e68db6cc9066d934f884ec6c4386c7f6570a (diff)
downloadgsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar.gz
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar.bz2
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar.lz
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar.xz
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.tar.zst
gsoc2013-evolution-eab1fd11357334c4ec3454ce9efacb220deabc12.zip
Sort folders in the storage view.
svn path=/trunk/; revision=3023
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-storage-set-view.c19
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;