diff options
author | ZenWalker <[email protected]> | 2016-06-10 10:41:11 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2016-06-10 10:41:11 +0200 |
commit | af154fdd494b90adae5be5783bb725194fcf1d6b (patch) | |
tree | 251b542943ba6cee52f117ba5737c54b47f16031 /src/fr-window.c | |
parent | 25c3dccb52628440615f97c9877f7dacd37d6646 (diff) | |
download | engrampa-af154fdd494b90adae5be5783bb725194fcf1d6b.tar.bz2 engrampa-af154fdd494b90adae5be5783bb725194fcf1d6b.tar.xz |
use natural order when sorting by filename
file-roller commit:
https://git.gnome.org/browse/file-roller/commit/?id=8703609e95dcee3abbec39dea567137c7fff23e9
Fixes #143
Diffstat (limited to 'src/fr-window.c')
-rw-r--r-- | src/fr-window.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/fr-window.c b/src/fr-window.c index 522b194..c57f453 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -944,7 +944,7 @@ sort_by_name (gconstpointer ptr1, return 1; } - return strcasecmp (fdata1->list_name, fdata2->list_name); + return strcmp (fdata1->sort_key, fdata2->sort_key); } @@ -1118,7 +1118,7 @@ compute_file_list_name (FrWindow *window, return FALSE; if (window->priv->list_mode == FR_WINDOW_LIST_MODE_FLAT) { - fdata->list_name = g_strdup (fdata->name); + file_data_set_list_name (fdata, fdata->name); if (fdata->dir) fdata->dir_size = 0; return FALSE; @@ -1135,7 +1135,7 @@ compute_file_list_name (FrWindow *window, scan = fdata->full_path + current_dir_len; end = strchr (scan, '/'); if ((end == NULL) && ! fdata->dir) { /* file */ - fdata->list_name = g_strdup (scan); + file_data_set_list_name (fdata, scan); } else { /* folder */ char *dir_name; @@ -1154,8 +1154,10 @@ compute_file_list_name (FrWindow *window, if ((end != NULL) && (*(end + 1) != '\0')) fdata->list_dir = TRUE; - fdata->list_name = dir_name; + file_data_set_list_name (fdata, dir_name); fdata->dir_size = get_dir_size (window, current_dir, dir_name); + + g_free (dir_name); } return TRUE; @@ -1181,8 +1183,7 @@ fr_window_compute_list_names (FrWindow *window, for (i = 0; i < files->len; i++) { FileData *fdata = g_ptr_array_index (files, i); - g_free (fdata->list_name); - fdata->list_name = NULL; + file_data_set_list_name (fdata, NULL); fdata->list_dir = FALSE; /* the files array is sorted by path, when the visible list |