</para>\r
</listitem>\r
</varlistentry>\r
+ <varlistentry>\r
+ <term>\r
+ <guilabel>Natural sort order</guilabel>\r
+ </term>\r
+ <listitem>\r
+ <para>Files and folders are sorted with the dot '.' treated as a special case, so the order is e.g. "event.c" "event.h" "eventgenerator.c". Also, files containing numbers are sorted as "file1" "file5" "file10".</para>\r
+ </listitem>\r
+ </varlistentry>\r
<varlistentry>\r
<term>\r
<guilabel>Disable file extension checks</guilabel>\r
g_free(fd->collate_key_name);
g_free(fd->collate_key_name_nocase);
+#if GTK_CHECK_VERSION(2, 8, 0)
+ if (options->file_sort.natural)
+ {
+ fd->collate_key_name = g_utf8_collate_key_for_filename(fd->name, -1);
+ fd->collate_key_name_nocase = g_utf8_collate_key_for_filename(caseless_name, -1);
+ }
+ else
+ {
+ fd->collate_key_name = g_utf8_collate_key(valid_name, -1);
+ fd->collate_key_name_nocase = g_utf8_collate_key(caseless_name, -1);
+ }
+#else
fd->collate_key_name = g_utf8_collate_key(valid_name, -1);
fd->collate_key_name_nocase = g_utf8_collate_key(caseless_name, -1);
+#endif
g_free(valid_name);
g_free(caseless_name);
options->file_sort.ascending = TRUE;
options->file_sort.case_sensitive = FALSE;
options->file_sort.method = SORT_NAME;
+ options->file_sort.natural = FALSE;
options->fullscreen.above = FALSE;
options->fullscreen.clean_flip = FALSE;
SortType method;
gboolean ascending;
gboolean case_sensitive; /* file sorting method (case) */
+ gboolean natural;
} file_sort;
/* slideshow */
if (options->file_filter.show_parent_directory != c_options->file_filter.show_parent_directory) refresh = TRUE;
if (options->file_filter.show_dot_directory != c_options->file_filter.show_dot_directory) refresh = TRUE;
if (options->file_sort.case_sensitive != c_options->file_sort.case_sensitive) refresh = TRUE;
+ if (options->file_sort.natural != c_options->file_sort.natural) refresh = TRUE;
if (options->file_filter.disable_file_extension_checks != c_options->file_filter.disable_file_extension_checks) refresh = TRUE;
if (options->file_filter.disable != c_options->file_filter.disable) refresh = TRUE;
options->file_filter.disable_file_extension_checks = c_options->file_filter.disable_file_extension_checks;
options->file_sort.case_sensitive = c_options->file_sort.case_sensitive;
+ options->file_sort.natural = c_options->file_sort.natural;
options->file_filter.disable = c_options->file_filter.disable;
config_entry_to_option(sidecar_ext_entry, &options->sidecar.ext, NULL);
options->file_filter.show_parent_directory, &c_options->file_filter.show_parent_directory);
pref_checkbox_new_int(group, _("Case sensitive sort"),
options->file_sort.case_sensitive, &c_options->file_sort.case_sensitive);
+ pref_checkbox_new_int(group, _("Natural sort order"),
+ options->file_sort.natural, &c_options->file_sort.natural);
pref_checkbox_new_int(group, _("Disable file extension checks"),
options->file_filter.disable_file_extension_checks, &c_options->file_filter.disable_file_extension_checks);
WRITE_NL(); WRITE_INT(*options, file_sort.method);
WRITE_NL(); WRITE_BOOL(*options, file_sort.ascending);
WRITE_NL(); WRITE_BOOL(*options, file_sort.case_sensitive);
+ WRITE_NL(); WRITE_BOOL(*options, file_sort.natural);
/* Fullscreen Options */
WRITE_NL(); WRITE_INT(*options, fullscreen.screen);
if (READ_UINT(*options, file_sort.method)) continue;
if (READ_BOOL(*options, file_sort.ascending)) continue;
if (READ_BOOL(*options, file_sort.case_sensitive)) continue;
+ if (READ_BOOL(*options, file_sort.natural)) continue;
/* File operations *options */
if (READ_BOOL(*options, file_ops.enable_in_place_rename)) continue;