(Re)-implement natural and case sorting
[geeqie.git] / src / view-file / view-file-icon.cc
index 00b0674..b2a97cb 100644 (file)
@@ -1162,7 +1162,7 @@ static gint page_height(ViewFile *vf)
        gint row_height;
        gint ret;
 
-       adj = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(vf->listview));
+       adj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(vf->listview));
        page_size = static_cast<gint>(gtk_adjustment_get_page_increment(adj));
 
        row_height = options->thumbnails.max_height + THUMB_BORDER_PADDING * 2;
@@ -1675,12 +1675,13 @@ static void vficon_sized_cb(GtkWidget *, GtkAllocation *allocation, gpointer dat
  *-----------------------------------------------------------------------------
  */
 
-void vficon_sort_set(ViewFile *vf, SortType type, gboolean ascend)
+void vficon_sort_set(ViewFile *vf, SortType type, gboolean ascend, gboolean case_sensitive)
 {
-       if (vf->sort_method == type && vf->sort_ascend == ascend) return;
+       if (vf->sort_method == type && vf->sort_ascend == ascend && vf->sort_case == case_sensitive) return;
 
        vf->sort_method = type;
        vf->sort_ascend = ascend;
+       vf->sort_case = case_sensitive;
 
        if (!vf->list) return;
 
@@ -1917,8 +1918,8 @@ static gboolean vficon_refresh_real(ViewFile *vf, gboolean keep_position)
 
                }
 
-       vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend); /* the list might not be sorted if there were renames */
-       new_filelist = filelist_sort(new_filelist, vf->sort_method, vf->sort_ascend);
+       vf->list = filelist_sort(vf->list, vf->sort_method, vf->sort_ascend, vf->sort_case); /* the list might not be sorted if there were renames */
+       new_filelist = filelist_sort(new_filelist, vf->sort_method, vf->sort_ascend, vf->sort_case);
 
        if (VFICON(vf)->selection)
                {