calendar-button: Remove useless listbox sort
Since the GtkListBox is bound to the calendars GListModel, and since the GListModel is already sorted, there is no longer a need for sorting the rows by name.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
6291f5a82e
commit
972b88a97d
@@ -105,25 +105,6 @@ create_row_func (gpointer data,
|
|||||||
* Callbacks
|
* Callbacks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static gint
|
|
||||||
listbox_sort_func (GtkListBoxRow *row1,
|
|
||||||
GtkListBoxRow *row2,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GcalCalendar *calendar1, *calendar2;
|
|
||||||
gint result;
|
|
||||||
|
|
||||||
calendar1 = g_object_get_data (G_OBJECT (row1), "calendar");
|
|
||||||
calendar2 = g_object_get_data (G_OBJECT (row2), "calendar");
|
|
||||||
|
|
||||||
result = g_ascii_strcasecmp (gcal_calendar_get_name (calendar1), gcal_calendar_get_name (calendar2));
|
|
||||||
|
|
||||||
if (result != 0)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
return g_ascii_strcasecmp (gcal_calendar_get_id (calendar1), gcal_calendar_get_id (calendar2));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_listbox_row_activated_cb (GtkListBox *listbox,
|
on_listbox_row_activated_cb (GtkListBox *listbox,
|
||||||
GtkListBoxRow *row,
|
GtkListBoxRow *row,
|
||||||
@@ -233,9 +214,4 @@ static void
|
|||||||
gcal_calendar_button_init (GcalCalendarButton *self)
|
gcal_calendar_button_init (GcalCalendarButton *self)
|
||||||
{
|
{
|
||||||
gtk_widget_init_template (GTK_WIDGET (self));
|
gtk_widget_init_template (GTK_WIDGET (self));
|
||||||
|
|
||||||
gtk_list_box_set_sort_func (GTK_LIST_BOX (self->calendar_listbox),
|
|
||||||
(GtkListBoxSortFunc) listbox_sort_func,
|
|
||||||
self,
|
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user