replace qsort_r with g_qsort_with_data