Method

GtkSortListModelget_pending

Declaration [src]

guint
gtk_sort_list_model_get_pending (
  GtkSortListModel* self
)

Description [src]

Estimates progress of an ongoing sorting operation.

The estimate is the number of items that would still need to be sorted to finish the sorting operation if this was a linear algorithm. So this number is not related to how many items are already correctly sorted.

If you want to estimate the progress, you can use code like this:

pending = gtk_sort_list_model_get_pending (self);
model = gtk_sort_list_model_get_model (self);
progress = 1.0 - pending / (double) MAX (1, g_list_model_get_n_items (model));

If no sort operation is ongoing - in particular when GtkSortListModel:incremental is FALSE - this function returns 0.

Return value

Type: guint

A progress estimate of remaining items to sort.